}
});
-const mapStateToProps = ({ virtualMachines }: RootState) => {
+const mapStateToProps = (state: RootState) => {
return {
- requestedDate: virtualMachines.date,
- ...virtualMachines
+ requestedDate: state.virtualMachines.date,
+ userUuid: state.auth.user!.uuid,
+ ...state.virtualMachines
};
};
interface VirtualMachinesPanelDataProps {
requestedDate: string;
virtualMachines: ListResults<any>;
+ userUuid: string;
links: ListResults<any>;
}
<Card>
<CardContent className={props.classes.cardWithoutMachines}>
<Grid item xs={6}>
- <Typography variant="body2">
+ <Typography variant='body1'>
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.
</Typography>
</Grid>
SEND REQUEST FOR SHELL ACCESS
</Button>
{props.requestedDate &&
- <Typography variant="body1">
+ <Typography >
A request for shell access was sent on {props.requestedDate}
</Typography>}
</span>;
{props.virtualMachines.items.map((it, index) =>
<TableRow key={index}>
<TableCell>{it.hostname}</TableCell>
- <TableCell>{getUsername(props.links)}</TableCell>
- <TableCell>ssh {getUsername(props.links)}@{it.hostname}.arvados</TableCell>
+ <TableCell>{getUsername(props.links, props.userUuid)}</TableCell>
+ <TableCell>ssh {getUsername(props.links, props.userUuid)}@{it.hostname}.arvados</TableCell>
<TableCell>
- <a href={`https://workbench.c97qk.arvadosapi.com${it.href}/webshell/${getUsername(props.links)}`} target="_blank" className={props.classes.link}>
- Log in as {getUsername(props.links)}
+ <a href={`https://workbench.c97qk.arvadosapi.com${it.href}/webshell/${getUsername(props.links, props.userUuid)}`} target="_blank" className={props.classes.link}>
+ Log in as {getUsername(props.links, props.userUuid)}
</a>
</TableCell>
</TableRow>
</TableBody>
</Table>;
-const getUsername = (links: ListResults<any>) => {
- return links.items[0].properties.username;
+const getUsername = (links: ListResults<any>, userUuid: string) => {
+ return links.items.map(it => it.tailUuid === userUuid ? it.properties.username : '');
};
const CardSSHSection = (props: VirtualMachineProps) =>
<Grid item xs={12}>
<Card>
<CardContent>
- <Typography variant="body2">
+ <Typography variant='body1'>
In order to access virtual machines using SSH, <Link to={Routes.SSH_KEYS_USER} className={props.classes.link}>add an SSH key to your account</Link> and add a section like this to your SSH configuration file ( ~/.ssh/config):
</Typography>
<DefaultCodeSnippet