import { CopyIcon } from 'components/icon/icon';
import CopyToClipboard from 'react-copy-to-clipboard';
import { snackbarActions, SnackbarKind } from 'store/snackbar/snackbar-actions';
+import { sanitizeHTML } from 'common/html-sanitize';
type CssRules = 'button' | 'codeSnippet' | 'link' | 'linkIcon' | 'rightAlign' | 'cardWithoutMachines' | 'icon' | 'chipsRoot' | 'copyIcon' | 'tableWrapper' | 'webshellButton';
const command = `ssh ${username}@${it.hostname}${props.hostSuffix}`;
let tokenParam = "";
if (props.tokenLocation === SESSION_STORAGE || props.tokenLocation === EXTRA_TOKEN) {
- tokenParam = `&token=${encodeURIComponent(props.token)}`;
+ tokenParam = `&token=${encodeURIComponent(props.token)}`;
}
const loginHref = `/webshell/?host=${encodeURIComponent(props.webshellUrl + '/' + it.hostname)}&timeout=${props.idleTimeout}&login=${encodeURIComponent(username)}${tokenParam}`;
return <TableRow key={lk.uuid}>
<TableCell>
<Grid container spacing={8} className={props.classes.chipsRoot}>
{
- (lk.properties.groups || []).map((group, i) => (
- <Grid item key={i}>
- <Chip label={group} />
- </Grid>
- ))
+ (lk.properties.groups || []).map((group, i) => (
+ <Grid item key={i}>
+ <Chip label={group} />
+ </Grid>
+ ))
}
</Grid>
</TableCell>
<TableCell>
{command}
- <Tooltip title="Copy to clipboard">
+ <Tooltip title="Copy link to clipboard">
<span className={props.classes.copyIcon}>
<CopyToClipboard text={command || ""} onCopy={() => props.onCopy!("Copied")}>
<CopyIcon />
size="small"
href={loginHref}
target="_blank"
- rel="noopener noreferrer">
- Log in as {username}
+ rel="noopener">
+ Log in as {username}
</Button>
</TableCell>
</TableRow>;
<Card>
<CardContent>
<Typography>
- <div dangerouslySetInnerHTML={{ __html: props.helpText }} style={{ margin: "1em" }} />
+ <div dangerouslySetInnerHTML={{ __html: sanitizeHTML(props.helpText) }} style={{ margin: "1em" }} />
</Typography>
</CardContent>
</Card>