export const ResourceCluster = (props: { uuid: string }) => {
const CLUSTER_ID_LENGTH = 5;
- const pos = props.uuid.indexOf('-');
+ const pos = props.uuid.length > CLUSTER_ID_LENGTH ? props.uuid.indexOf('-') : 5;
const clusterId = pos >= CLUSTER_ID_LENGTH ? props.uuid.substr(0, pos) : '';
const ci = pos >= CLUSTER_ID_LENGTH ? (((((
(props.uuid.charCodeAt(0) * props.uuid.charCodeAt(1))
title={
<div>
{loggedIn.length === 1 ?
- <span>Searching local cluster <ResourceCluster uuid={props.localCluster + "-"} /></span>
+ <span>Searching local cluster <ResourceCluster uuid={props.localCluster} /></span>
: <span>Searching clusters: {loggedIn.map((ss) => <span key={ss.clusterId}>
- <a href={props.remoteHostsConfig[ss.clusterId].workbench2Url} style={{ textDecoration: 'none' }}> <ResourceCluster uuid={ss.clusterId + "-"} /></a></span>)}</span>}
+ <a href={props.remoteHostsConfig[ss.clusterId].workbench2Url} style={{ textDecoration: 'none' }}> <ResourceCluster uuid={ss.clusterId} /></a></span>)}</span>}
{loggedIn.length === 1 && props.localCluster !== homeCluster ?
<span>To search multiple clusters, <a href={props.remoteHostsConfig[homeCluster] && props.remoteHostsConfig[homeCluster].workbench2Url}> start from your home Workbench.</a></span>
: <span style={{ marginLeft: "2em" }}>Use <Link to={Routes.SITE_MANAGER} >Site Manager</Link> to manage which clusters will be searched.</span>}
const validating = session.status === SessionStatus.BEING_VALIDATED;
return <TableRow key={index} className={classes.tableRow}>
<TableCell>{remoteHostsConfig[session.clusterId] ?
- <a href={remoteHostsConfig[session.clusterId].workbench2Url} style={{ textDecoration: 'none' }}> <ResourceCluster uuid={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>