CardContent,
CircularProgress,
Grid,
+ IconButton,
StyleRulesCallback,
Table,
TableBody,
import { addSession } from "~/store/auth/auth-action-session";
import { SITE_MANAGER_REMOTE_HOST_VALIDATION } from "~/validators/validators";
import { Config } from '~/common/config';
+import { ResourceCluster } from '~/views-components/data-explorer/renderers';
+import { TrashIcon } from "~/components/icon/icon";
type CssRules = 'root' | 'link' | 'buttonContainer' | 'table' | 'tableRow' |
'remoteSiteInfo' | 'buttonAdd' | 'buttonLoggedIn' | 'buttonLoggedOut' |
export interface SiteManagerPanelRootActionProps {
toggleSession: (session: Session) => void;
+ removeSession: (session: Session) => void;
}
export interface SiteManagerPanelRootDataProps {
sessions: Session[];
remoteHostsConfig: { [key: string]: Config };
+ localClusterConfig: Config;
}
type SiteManagerPanelRootProps = SiteManagerPanelRootDataProps & SiteManagerPanelRootActionProps & WithStyles<CssRules> & InjectedFormProps;
const submitSession = (remoteHost: string) =>
(dispatch: Dispatch) => {
- dispatch<any>(addSession(remoteHost)).then(() => {
+ dispatch<any>(addSession(remoteHost, undefined, true)).then(() => {
dispatch(reset(SITE_MANAGER_FORM_NAME));
}).catch((e: any) => {
const errors = {
}
}),
withStyles(styles))
- (({ classes, sessions, handleSubmit, toggleSession, remoteHostsConfig }: SiteManagerPanelRootProps) =>
+ (({ classes, sessions, handleSubmit, toggleSession, removeSession, localClusterConfig, remoteHostsConfig }: SiteManagerPanelRootProps) =>
<Card className={classes.root}>
<CardContent>
<Grid container direction="row">
<Grid item xs={12}>
<Typography paragraph={true} >
You can log in to multiple Arvados sites here, then use the multi-site search page to search collections and projects on all sites at once.
- </Typography>
+ </Typography>
</Grid>
</Grid>
<Grid item xs={12}>
<TableRow className={classes.tableRow}>
<TableCell>Cluster ID</TableCell>
<TableCell>Host</TableCell>
- <TableCell>Username</TableCell>
<TableCell>Email</TableCell>
+ <TableCell>UUID</TableCell>
<TableCell>Status</TableCell>
+ <TableCell>Actions</TableCell>
</TableRow>
</TableHead>
<TableBody>
const validating = session.status === SessionStatus.BEING_VALIDATED;
return <TableRow key={index} className={classes.tableRow}>
<TableCell>{remoteHostsConfig[session.clusterId] ?
- <a href={remoteHostsConfig[session.clusterId].workbench2Url}>{session.clusterId}</a>
+ <a href={remoteHostsConfig[session.clusterId].workbench2Url} style={{ textDecoration: 'none' }}> <ResourceCluster uuid={session.clusterId} /></a>
: session.clusterId}</TableCell>
<TableCell>{session.remoteHost}</TableCell>
- <TableCell>{validating ? <CircularProgress size={20} /> : session.username}</TableCell>
<TableCell>{validating ? <CircularProgress size={20} /> : session.email}</TableCell>
+ <TableCell>{validating ? <CircularProgress size={20} /> : session.uuid}</TableCell>
<TableCell className={classes.statusCell}>
<Button fullWidth
disabled={validating || session.status === SessionStatus.INVALIDATED || session.active}
{validating ? "Validating" : (session.loggedIn ? "Logged in" : "Logged out")}
</Button>
</TableCell>
+ <TableCell>
+ {session.clusterId !== localClusterConfig.uuidPrefix &&
+ !localClusterConfig.clusterConfig.RemoteClusters[session.clusterId] &&
+ <IconButton onClick={() => removeSession(session)}>
+ <TrashIcon />
+ </IconButton>}
+ </TableCell>
</TableRow>;
})}
</TableBody>