Commit 80fa4527 authored by Taylor Hanayik's avatar Taylor Hanayik
Browse files

add initial support for short file names in command preview

parent aca83be7
......@@ -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)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment