Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
FSL
gui
fsl-gui-bet
Commits
80fa4527
Commit
80fa4527
authored
Mar 21, 2022
by
Taylor Hanayik
Browse files
add initial support for short file names in command preview
parent
aca83be7
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/App.jsx
View file @
80fa4527
...
...
@@ -12,6 +12,7 @@ let urlParams = new URLSearchParams(window.location.search)
let
host
=
urlParams
.
get
(
'
host
'
)
let
socketServerPort
=
urlParams
.
get
(
'
socketServerPort
'
)
let
fileServerPort
=
urlParams
.
get
(
'
fileServerPort
'
)
let
useShortDisplay
=
urlParams
.
get
(
'
shortNames
'
)
// can be set from global FSL settings on user's machine
console
.
log
(
host
,
socketServerPort
,
fileServerPort
)
// different socket clients for different widgets
...
...
@@ -370,6 +371,14 @@ export default function Bet() {
}
}
function
shortenFileName
(
name
)
{
if
(
useShortDisplay
)
{
return
name
.
split
(
'
/
'
).
pop
()
//assumes mac or linux for now...
}
else
{
return
name
}
}
function
updateCommandString
()
{
let
command
=
'
bet
'
for
(
let
[
key
,
value
]
of
Object
.
entries
({...
betOpts
}))
{
...
...
@@ -380,7 +389,7 @@ export default function Bet() {
// if true the just pass the key to set boolean bet values
value
=
''
}
command
+=
`
${(
key
==
'
input
'
||
key
==
'
output
'
)
?
''
:
key
}
${
value
}
`
command
+=
`
${(
key
==
'
input
'
||
key
==
'
output
'
)
?
''
:
key
}
${
(
key
==
'
input
'
||
key
==
'
output
'
)
?
shortenFileName
(
value
)
:
value
}
`
}
}
setCommandString
(
command
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment