X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/64c8c2628cbeadba5dce7e18e41028108142b766..29059cd958303cc1a984231155547746a98c3ef3:/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 17563053..291041b3 100644 --- a/src/views/virtual-machine-panel/virtual-machine-user-panel.tsx +++ b/src/views/virtual-machine-panel/virtual-machine-user-panel.tsx @@ -57,10 +57,11 @@ const styles: StyleRulesCallback = (theme: ArvadosTheme) => ({ } }); -const mapStateToProps = ({ virtualMachines }: RootState) => { +const mapStateToProps = (state: RootState) => { return { - requestedDate: virtualMachines.date, - ...virtualMachines + requestedDate: state.virtualMachines.date, + userUuid: state.auth.user!.uuid, + ...state.virtualMachines }; }; @@ -72,6 +73,7 @@ const mapDispatchToProps = (dispatch: Dispatch): Pick; + userUuid: string; links: ListResults; } @@ -108,7 +110,7 @@ const CardContentWithoutVirtualMachines = (props: VirtualMachineProps) => - + You do not have access to any virtual machines. Some Arvados features require using the command line. You may request access to a hosted virtual machine with the command line shell. @@ -147,7 +149,7 @@ const virtualMachineSendRequest = (props: VirtualMachineProps) => SEND REQUEST FOR SHELL ACCESS {props.requestedDate && - + A request for shell access was sent on {props.requestedDate} } ; @@ -166,11 +168,11 @@ const virtualMachinesTable = (props: VirtualMachineProps) => {props.virtualMachines.items.map((it, index) => {it.hostname} - {getUsername(props.links)} - ssh {getUsername(props.links)}@{it.hostname}.arvados + {getUsername(props.links, props.userUuid)} + ssh {getUsername(props.links, props.userUuid)}@{it.hostname}.arvados - - Log in as {getUsername(props.links)} + + Log in as {getUsername(props.links, props.userUuid)} @@ -178,16 +180,16 @@ const virtualMachinesTable = (props: VirtualMachineProps) => ; -const getUsername = (links: ListResults) => { - return links.items[0].properties.username; +const getUsername = (links: ListResults, userUuid: string) => { + return links.items.map(it => it.tailUuid === userUuid ? it.properties.username : ''); }; const CardSSHSection = (props: VirtualMachineProps) => - - In order to access virtual machines using SSH, add an SSH key to your account and add a section like this to your SSH configuration file ( ~/.ssh/config): + + In order to access virtual machines using SSH, add an SSH key to your account and add a section like this to your SSH configuration file ( ~/.ssh/config):