WelcomePageHTML: string;
InactivePageHTML: string;
SSHHelpPageHTML: string;
+ SSHHelpHostSuffix: string;
SiteName: string;
};
Login: {
return Axios.get<ClusterConfigJSON>(getClusterConfigURL(workbenchConfig.API_HOST)).then(async response => {
const clusterConfigJSON = response.data;
const apiRevision = await getApiRevision(clusterConfigJSON.Services.Controller.ExternalURL);
- const config = {...buildConfig(clusterConfigJSON), apiRevision};
+ const config = { ...buildConfig(clusterConfigJSON), apiRevision };
const warnLocalConfig = (varName: string) => console.warn(
`A value for ${varName} was found in ${WORKBENCH_CONFIG_URL}. To use the Arvados centralized configuration instead, \
remove the entire ${varName} entry from ${WORKBENCH_CONFIG_URL}`);
WelcomePageHTML: "",
InactivePageHTML: "",
SSHHelpPageHTML: "",
+ SSHHelpHostSuffix: "",
SiteName: "",
},
Login: {
);
const attributes = (user: UserResource, classes: any) => {
- const { uuid, ownerUuid, createdAt, modifiedAt, modifiedByClientUuid, modifiedByUserUuid, firstName, lastName, href, username } = user;
+ const { uuid, ownerUuid, createdAt, modifiedAt, modifiedByClientUuid, modifiedByUserUuid,
+ firstName, lastName, username, email, isActive, isAdmin } = user;
return (
<span>
<Grid container direction="row">
<Grid item xs={5} className={classes.rightContainer}>
+ {uuid && <Grid item>Uuid</Grid>}
{firstName && <Grid item>First name</Grid>}
{lastName && <Grid item>Last name</Grid>}
- {ownerUuid && <Grid item>Owner uuid</Grid>}
+ {email && <Grid item>Email</Grid>}
+ {username && <Grid item>Username</Grid>}
+ {isActive && <Grid item>Is active</Grid>}
+ {isAdmin && <Grid item>Is admin</Grid>}
{createdAt && <Grid item>Created at</Grid>}
{modifiedAt && <Grid item>Modified at</Grid>}
+ {ownerUuid && <Grid item>Owner uuid</Grid>}
{modifiedByUserUuid && <Grid item>Modified by user uuid</Grid>}
{modifiedByClientUuid && <Grid item>Modified by client uuid</Grid>}
- {uuid && <Grid item>uuid</Grid>}
- {href && <Grid item>Href</Grid>}
- {username && <Grid item>Username</Grid>}
- {username && <Grid item>Username</Grid>}
</Grid>
<Grid item xs={7} className={classes.leftContainer}>
+ <Grid item>{uuid}</Grid>
<Grid item>{firstName}</Grid>
<Grid item>{lastName}</Grid>
- <Grid item>{ownerUuid}</Grid>
+ <Grid item>{email}</Grid>
+ <Grid item>{username}</Grid>
+ <Grid item>{isActive}</Grid>
+ <Grid item>{isAdmin}</Grid>
<Grid item>{createdAt}</Grid>
<Grid item>{modifiedAt}</Grid>
+ <Grid item>{ownerUuid}</Grid>
<Grid item>{modifiedByUserUuid}</Grid>
<Grid item>{modifiedByClientUuid}</Grid>
- <Grid item>{uuid}</Grid>
- <Grid item>{href}</Grid>
- <Grid item>{username}</Grid>
- <Grid item>{username}</Grid>
</Grid>
</Grid>
</span>
import { RootState } from '~/store/store';
import { ListResults } from '~/services/common-service/common-service';
import { HelpIcon } from '~/components/icon/icon';
+// import * as CopyToClipboard from 'react-copy-to-clipboard';
type CssRules = 'button' | 'codeSnippet' | 'link' | 'linkIcon' | 'rightAlign' | 'cardWithoutMachines' | 'icon';
requestedDate: state.virtualMachines.date,
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.WebShell.ExternalURL,
...state.virtualMachines
};
userUuid: string;
links: ListResults<any>;
helpText: string;
+ hostSuffix: string;
webShell: string;
}
</TableRow>
</TableHead>
<TableBody>
- {props.virtualMachines.items.map((it, index) =>
- <TableRow key={index}>
- <TableCell>{it.hostname}</TableCell>
- <TableCell>{getUsername(props.links, props.userUuid)}</TableCell>
- <TableCell>ssh {getUsername(props.links, props.userUuid)}@{it.hostname}</TableCell>
- {props.webShell !== "" && <TableCell>
- <a href={`${props.webShell}${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>
- )}
+ {props.virtualMachines.items.map(it =>
+ props.links.items.map(lk => {
+ if (lk.tailUuid === props.userUuid) {
+ const username = lk.properties.username;
+ const command = `ssh ${username}@${it.hostname}${props.hostSuffix}`;
+ return <TableRow key={lk.uuid}>
+ <TableCell>{it.hostname}</TableCell>
+ <TableCell>{username}</TableCell>
+ <TableCell>
+ {command}
+ </TableCell>
+ {props.webShell !== "" && <TableCell>
+ <a href={`${props.webShell}${it.href}/webshell/${username}`} target="_blank" className={props.classes.link}>
+ Log in as {username}
+ </a>
+ </TableCell>}
+ </TableRow>;
+ }
+ return;
+ }
+ ))}
</TableBody>
</Table>;
-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>