X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/3c7e3cdc547ad5468421e1c049daa94b0d4b8bc0..c331c8cdce120fc46e412deea700141267c832e6:/src/views/virtual-machine-panel/virtual-machine-user-panel.tsx diff --git a/src/views/virtual-machine-panel/virtual-machine-user-panel.tsx b/src/views/virtual-machine-panel/virtual-machine-user-panel.tsx index b5f7d5f55f..196cba1643 100644 --- a/src/views/virtual-machine-panel/virtual-machine-user-panel.tsx +++ b/src/views/virtual-machine-panel/virtual-machine-user-panel.tsx @@ -12,10 +12,13 @@ import { saveRequestedDate, loadVirtualMachinesUserData } from 'store/virtual-ma import { RootState } from 'store/store'; import { ListResults } from 'services/common-service/common-service'; import { HelpIcon } from 'components/icon/icon'; +import { SESSION_STORAGE } from "services/auth-service/auth-service"; // import * as CopyToClipboard from 'react-copy-to-clipboard'; type CssRules = 'button' | 'codeSnippet' | 'link' | 'linkIcon' | 'rightAlign' | 'cardWithoutMachines' | 'icon'; +const EXTRA_TOKEN = "exra"; + const styles: StyleRulesCallback = (theme: ArvadosTheme) => ({ button: { marginTop: theme.spacing.unit, @@ -61,7 +64,9 @@ const mapStateToProps = (state: RootState) => { userUuid: state.auth.user!.uuid, helpText: state.auth.config.clusterConfig.Workbench.SSHHelpPageHTML, hostSuffix: state.auth.config.clusterConfig.Workbench.SSHHelpHostSuffix || "", - webShell: state.auth.config.clusterConfig.Services.Workbench1.ExternalURL, + token: state.auth.extraApiToken || state.auth.apiToken || '', + tokenLocation: state.auth.extraApiToken ? EXTRA_TOKEN : (state.auth.apiTokenLocation || ''), + webshellUrl: state.auth.config.clusterConfig.Services.WebShell.ExternalURL, ...state.virtualMachines }; }; @@ -78,7 +83,9 @@ interface VirtualMachinesPanelDataProps { links: ListResults; helpText: string; hostSuffix: string; - webShell: string; + token: string; + tokenLocation: string, + webshellUrl: string; } interface VirtualMachinesPanelActionProps { @@ -134,7 +141,7 @@ const CardContentWithVirtualMachines = (props: VirtualMachineProps) => {virtualMachineSendRequest(props)}
- + @@ -165,7 +172,7 @@ const virtualMachinesTable = (props: VirtualMachineProps) => Host name Login name Command line - {props.webShell !== "" && Web shell} + Web shell @@ -174,20 +181,24 @@ const virtualMachinesTable = (props: VirtualMachineProps) => if (lk.tailUuid === props.userUuid) { const username = lk.properties.username; const command = `ssh ${username}@${it.hostname}${props.hostSuffix}`; + let tokenParam = ""; + if (props.tokenLocation === SESSION_STORAGE || props.tokenLocation === EXTRA_TOKEN) { + tokenParam = `&token=${encodeURIComponent(props.token)}`; + } return {it.hostname} {username} {command} - {props.webShell !== "" && - + + Log in as {username} - } + ; } - return; + return null; } ))}