[ARVADOS-WORKBENCH2] updated: 1.2.0-876-g9bfdbac

Git user git at public.curoverse.com
Mon Nov 19 04:59:51 EST 2018


Summary of changes:
 .../virtual-machine-panel.tsx                      | 163 +++++++++++----------
 1 file changed, 84 insertions(+), 79 deletions(-)

       via  9bfdbacc69b6ccbcedd07b3d906efbac6e192202 (commit)
      from  1b8cc6ffa4ca2790b46bcee51455b8227cc456ed (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit 9bfdbacc69b6ccbcedd07b3d906efbac6e192202
Author: Pawel Kowalczyk <pawel.kowalczyk at contractors.roche.com>
Date:   Mon Nov 19 10:59:36 2018 +0100

    added compose from redux
    
    Feature #13864
    
    Arvados-DCO-1.1-Signed-off-by: Pawel Kowalczyk <pawel.kowalczyk at contractors.roche.com>

diff --git a/src/views/virtual-machine-panel/virtual-machine-panel.tsx b/src/views/virtual-machine-panel/virtual-machine-panel.tsx
index 37dde64..7d9adde 100644
--- a/src/views/virtual-machine-panel/virtual-machine-panel.tsx
+++ b/src/views/virtual-machine-panel/virtual-machine-panel.tsx
@@ -4,12 +4,12 @@
 
 import * as React from 'react';
 import { connect } from 'react-redux';
-import { Grid, Typography, Button, Card, CardContent, TableBody, TableCell, TableHead, TableRow, Table } from '@material-ui/core';
+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 { Dispatch } from 'redux';
+import { Dispatch, compose } from 'redux';
 import { saveRequestedDate, loadVirtualMachinesData } from '~/store/virtual-machines/virtual-machines-actions';
 import { RootState } from '~/store/store';
 import { ListResults } from '~/services/common-service/common-resource-service';
@@ -38,7 +38,7 @@ const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
     },
     linkIcon: {
         textDecoration: 'none',
-        color: theme.palette.grey["400"],
+        color: theme.palette.grey["500"],
         textAlign: 'right',
         "&:hover": {
             color: theme.palette.common.black,
@@ -76,95 +76,100 @@ interface VirtualMachinesPanelActionProps {
 
 type VirtualMachineProps = VirtualMachinesPanelActionProps & VirtualMachinesPanelDataProps & WithStyles<CssRules>;
 
-export const VirtualMachinePanel = withStyles(styles)(connect(mapStateToProps, mapDispatchToProps)(
-    class extends React.Component<VirtualMachineProps> {
-        componentDidMount() {
-            this.props.loadVirtualMachinesData();
-        }
+export const VirtualMachinePanel = compose(
+    withStyles(styles),
+    connect(mapStateToProps, mapDispatchToProps))(
+        class extends React.Component<VirtualMachineProps> {
+            componentDidMount() {
+                this.props.loadVirtualMachinesData();
+            }
 
-        render() {
-            const { classes, saveRequestedDate, requestedDate, virtualMachines, logins } = this.props;
-            return (
-                <Grid container spacing={16}>
-                    <Grid item xs={12}>
-                        <Card>
-                            <CardContent>
-                                {virtualMachines.itemsAvailable === 0
-                                    ? cardContentWithNoVirtualMachines(requestedDate, saveRequestedDate, classes)
-                                    : cardContentWithVirtualMachines(virtualMachines, classes)}
-                            </CardContent>
-                        </Card>
-                    </Grid>
-                    <Grid item xs={12}>
+            render() {
+                const { classes, saveRequestedDate, requestedDate, virtualMachines, logins } = this.props;
+                return (
+                    <Grid container spacing={16}>
+                        {cardContentWithNoVirtualMachines(requestedDate, saveRequestedDate, classes)}
+                        {virtualMachines.itemsAvailable > 0 && cardContentWithVirtualMachines(virtualMachines, classes)}
                         {cardSSHSection(classes)}
                     </Grid>
-                </Grid >
-            );
+                );
+            }
         }
-    })
-);
+    );
 
 const cardContentWithNoVirtualMachines = (requestedDate: string, saveRequestedDate: () => void, classes: any) =>
-    <span>
-        <Typography variant="body2">
-            You do not have access to any virtual machines. Some Arvados features require using the command line. You may request access to a hosted virtual machine with the command line shell.
-        </Typography>
-        <Button variant="contained" color="primary" className={classes.button} onClick={saveRequestedDate}>
-            SEND REQUEST FOR SHELL ACCESS
-        </Button>
-        {requestedDate &&
-            <Typography variant="body1">
-                A request for shell access was sent on {requestedDate}
-            </Typography>}
-    </span>;
+    <Grid item xs={12}>
+        <Card>
+            <CardContent>
+                <Typography variant="body2">
+                    You do not have access to any virtual machines. Some Arvados features require using the command line. You may request access to a hosted virtual machine with the command line shell.
+                </Typography>
+                <Button variant="contained" color="primary" className={classes.button} onClick={saveRequestedDate}>
+                    SEND REQUEST FOR SHELL ACCESS
+                </Button>
+                {requestedDate &&
+                    <Typography variant="body1">
+                        A request for shell access was sent on {requestedDate}
+                    </Typography>}
+            </CardContent>
+        </Card>
+    </Grid>;
 
 const login = 'pawelkowalczyk';
 
 const cardContentWithVirtualMachines = (virtualMachines: ListResults<any>, classes: any) =>
-    <span>
-        <div className={classes.icon}>
-            <a href="https://doc.arvados.org/user/getting_started/vm-login-with-webshell.html" target="_blank" className={classes.linkIcon}>
-                <HelpIcon />
-            </a>
-        </div>
-        <Table>
-            <TableHead>
-                <TableRow>
-                    <TableCell>Host name</TableCell>
-                    <TableCell>Login name</TableCell>
-                    <TableCell>Command line</TableCell>
-                    <TableCell>Web shell</TableCell>
-                </TableRow>
-            </TableHead>
-            <TableBody>
-                {virtualMachines.items.map((it, index) =>
-                    <TableRow key={index}>
-                        <TableCell>{it.hostname}</TableCell>
-                        <TableCell>{login}</TableCell>
-                        <TableCell>ssh {login}@shell.arvados</TableCell>
-                        <TableCell>
-                            <a href={`https://workbench.c97qk.arvadosapi.com${it.href}/webshell/${login}`} target="_blank" className={classes.link}>
-                                Log in as {login}
-                            </a>
-                        </TableCell>
-                    </TableRow>
-                )}
-            </TableBody>
-        </Table>
-    </span >;
+    <Grid item xs={12}>
+        <Card>
+            <CardContent>
+                <div className={classes.icon}>
+                    <a href="https://doc.arvados.org/user/getting_started/vm-login-with-webshell.html" target="_blank" className={classes.linkIcon}>
+                        <Tooltip title="Access VM using webshell">
+                            <HelpIcon />
+                        </Tooltip>
+                    </a>
+                </div>
+                <Table>
+                    <TableHead>
+                        <TableRow>
+                            <TableCell>Host name</TableCell>
+                            <TableCell>Login name</TableCell>
+                            <TableCell>Command line</TableCell>
+                            <TableCell>Web shell</TableCell>
+                        </TableRow>
+                    </TableHead>
+                    <TableBody>
+                        {virtualMachines.items.map((it, index) =>
+                            <TableRow key={index}>
+                                <TableCell>{it.hostname}</TableCell>
+                                <TableCell>{login}</TableCell>
+                                <TableCell>ssh {login}@shell.arvados</TableCell>
+                                <TableCell>
+                                    <a href={`https://workbench.c97qk.arvadosapi.com${it.href}/webshell/${login}`} target="_blank" className={classes.link}>
+                                        Log in as {login}
+                                    </a>
+                                </TableCell>
+                            </TableRow>
+                        )}
+                    </TableBody>
+                </Table>
+            </CardContent>
+        </Card>
+    </Grid>;
 
 // dodac link do ssh panelu jak juz bedzie
 const cardSSHSection = (classes: any) =>
-    <Card>
-        <CardContent>
-            <Typography variant="body2">
-                In order to access virtual machines using SSH, <Link to='' className={classes.link}>add an SSH key to your account</Link> and add a section like this to your SSH configuration file ( ~/.ssh/config):
-            </Typography>
-            <DefaultCodeSnippet
-                className={classes.codeSnippet}
-                lines={[textSSH]} />
-        </CardContent>
-    </Card>;
+    <Grid item xs={12}>
+        <Card>
+            <CardContent>
+                <Typography variant="body2">
+                    In order to access virtual machines using SSH, <Link to='' className={classes.link}>add an SSH key to your account</Link> and add a section like this to your SSH configuration file ( ~/.ssh/config):
+                </Typography>
+                <DefaultCodeSnippet
+                    className={classes.codeSnippet}
+                    lines={[textSSH]} />
+            </CardContent>
+        </Card>
+    </Grid>;
 
 const textSSH = `Host *.arvados
     TCPKeepAlive yes

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list