[ARVADOS-WORKBENCH2] created: 1.4.1-261-ge62c661a

Git user git at public.arvados.org
Mon Feb 3 21:04:45 UTC 2020


        at  e62c661a8de391ae269a0170901c6b0290970620 (commit)


commit e62c661a8de391ae269a0170901c6b0290970620
Author: Peter Amstutz <peter.amstutz at curii.com>
Date:   Mon Feb 3 16:03:56 2020 -0500

    16111: Display customizable SSHHelpPageHTML
    
    Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <peter.amstutz at curii.com>

diff --git a/src/common/config.ts b/src/common/config.ts
index f44dc168..23faaf91 100644
--- a/src/common/config.ts
+++ b/src/common/config.ts
@@ -41,6 +41,9 @@ export interface ClusterConfigJSON {
         },
         WebDAVDownload: {
             ExternalURL: string
+        },
+        WebShell: {
+            ExternalURL: string
         }
     };
     Workbench: {
@@ -49,6 +52,7 @@ export interface ClusterConfigJSON {
         FileViewersConfigURL: string;
         WelcomePageHTML: string;
         InactivePageHTML: string;
+        SSHHelpPageHTML: string;
         SiteName: string;
     };
     Login: {
@@ -155,6 +159,7 @@ export const mockClusterConfigJSON = (config: Partial<ClusterConfigJSON>): Clust
         Websocket: { ExternalURL: "" },
         WebDAV: { ExternalURL: "" },
         WebDAVDownload: { ExternalURL: "" },
+        WebShell: { ExternalURL: "" },
     },
     Workbench: {
         ArvadosDocsite: "",
@@ -162,6 +167,7 @@ export const mockClusterConfigJSON = (config: Partial<ClusterConfigJSON>): Clust
         FileViewersConfigURL: "",
         WelcomePageHTML: "",
         InactivePageHTML: "",
+        SSHHelpPageHTML: "",
         SiteName: "",
     },
     Login: {
diff --git a/src/views/virtual-machine-panel/virtual-machine-user-panel.tsx b/src/views/virtual-machine-panel/virtual-machine-user-panel.tsx
index 291041b3..a641ec63 100644
--- a/src/views/virtual-machine-panel/virtual-machine-user-panel.tsx
+++ b/src/views/virtual-machine-panel/virtual-machine-user-panel.tsx
@@ -7,14 +7,11 @@ import { connect } from 'react-redux';
 import { Grid, Typography, Button, Card, CardContent, TableBody, TableCell, TableHead, TableRow, Table, Tooltip } from '@material-ui/core';
 import { StyleRulesCallback, WithStyles, withStyles } from '@material-ui/core/styles';
 import { ArvadosTheme } from '~/common/custom-theme';
-import { DefaultCodeSnippet } from '~/components/default-code-snippet/default-code-snippet';
-import { Link } from 'react-router-dom';
 import { compose, Dispatch } from 'redux';
 import { saveRequestedDate, loadVirtualMachinesUserData } from '~/store/virtual-machines/virtual-machines-actions';
 import { RootState } from '~/store/store';
 import { ListResults } from '~/services/common-service/common-service';
 import { HelpIcon } from '~/components/icon/icon';
-import { Routes } from '~/routes/routes';
 
 type CssRules = 'button' | 'codeSnippet' | 'link' | 'linkIcon' | 'rightAlign' | 'cardWithoutMachines' | 'icon';
 
@@ -61,6 +58,8 @@ const mapStateToProps = (state: RootState) => {
     return {
         requestedDate: state.virtualMachines.date,
         userUuid: state.auth.user!.uuid,
+        helpText: state.auth.config.clusterConfig.Workbench.SSHHelpPageHTML,
+        webShell: state.auth.config.clusterConfig.Services.WebShell.ExternalURL,
         ...state.virtualMachines
     };
 };
@@ -75,6 +74,8 @@ interface VirtualMachinesPanelDataProps {
     virtualMachines: ListResults<any>;
     userUuid: string;
     links: ListResults<any>;
+    helpText: string;
+    webShell: string;
 }
 
 interface VirtualMachinesPanelActionProps {
@@ -161,7 +162,7 @@ const virtualMachinesTable = (props: VirtualMachineProps) =>
                 <TableCell>Host name</TableCell>
                 <TableCell>Login name</TableCell>
                 <TableCell>Command line</TableCell>
-                <TableCell>Web shell</TableCell>
+                {props.webShell !== "" && <TableCell>Web shell</TableCell>}
             </TableRow>
         </TableHead>
         <TableBody>
@@ -169,12 +170,12 @@ const virtualMachinesTable = (props: VirtualMachineProps) =>
                 <TableRow key={index}>
                     <TableCell>{it.hostname}</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, props.userUuid)}`} target="_blank" className={props.classes.link}>
+                    <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>
+                    </TableCell>}
                 </TableRow>
             )}
         </TableBody>
@@ -188,17 +189,9 @@ const CardSSHSection = (props: VirtualMachineProps) =>
     <Grid item xs={12}>
         <Card>
             <CardContent>
-                <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>
+                    <div dangerouslySetInnerHTML={{ __html: props.helpText }} style={{ margin: "1em" }} />
                 </Typography>
-                <DefaultCodeSnippet
-                    className={props.classes.codeSnippet}
-                    lines={[textSSH]} />
             </CardContent>
         </Card>
     </Grid>;
-
-const textSSH = `Host *.arvados
-    TCPKeepAlive yes
-    ServerAliveInterval 60
-    ProxyCommand ssh -p2222 turnout at switchyard.api.ardev.roche.com -x -a $SSH_PROXY_FLAGS %h`;
\ No newline at end of file

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list