[ARVADOS-WORKBENCH2] updated: 1.2.1-1019-g25d3415

Git user git at public.curoverse.com
Thu Nov 29 06:32:14 EST 2018


Summary of changes:
 src/services/auth-service/auth-service.ts          | 14 +++-
 .../virtual-machines/virtual-machines-actions.ts   |  3 +
 .../virtual-machine-panel.tsx                      | 86 +++++++++++++++-------
 3 files changed, 71 insertions(+), 32 deletions(-)

       via  25d3415ed6b183eb627bfc06e2d5d977c85ad828 (commit)
       via  7b837842dac38a9bb654b759a5651c7c4975e10a (commit)
       via  c4882a6046934f1beea8dc1cc741e690cec357af (commit)
      from  9c22ff485ae2e065ae705fd5066fda6d508cf236 (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 25d3415ed6b183eb627bfc06e2d5d977c85ad828
Merge: 9c22ff4 7b83784
Author: Pawel Kowalczyk <pawel.kowalczyk at contractors.roche.com>
Date:   Thu Nov 29 12:32:06 2018 +0100

    isAdmin prop
    
    Feature #14498
    
    Arvados-DCO-1.1-Signed-off-by: Pawel Kowalczyk <pawel.kowalczyk at contractors.roche.com>

diff --cc src/services/auth-service/auth-service.ts
index 247869e,397b319..8221e48
--- a/src/services/auth-service/auth-service.ts
+++ b/src/services/auth-service/auth-service.ts
@@@ -4,7 -4,7 +4,7 @@@
  
  import { User } from "~/models/user";
  import { AxiosInstance } from "axios";
--import { ApiActions, ProgressFn } from "~/services/api/api-actions";
++import { ApiActions } from "~/services/api/api-actions";
  import * as uuid from "uuid/v4";
  
  export const API_TOKEN_KEY = 'apiToken';
@@@ -57,9 -61,9 +61,10 @@@ export class AuthService 
          const lastName = localStorage.getItem(USER_LAST_NAME_KEY);
          const uuid = localStorage.getItem(USER_UUID_KEY);
          const ownerUuid = localStorage.getItem(USER_OWNER_UUID_KEY);
-         const isAdmin = Boolean(localStorage.getItem(USER_IS_ADMIN));
+         const isAdmin = this.getIsAdmin();
++        console.log(isAdmin);
  
-         return email && firstName && lastName && uuid && ownerUuid && isAdmin
+         return email && firstName && lastName && uuid && ownerUuid
              ? { email, firstName, lastName, uuid, ownerUuid, isAdmin }
              : undefined;
      }
diff --cc src/store/virtual-machines/virtual-machines-actions.ts
index ae75356,9bd7988..6f59c91
--- a/src/store/virtual-machines/virtual-machines-actions.ts
+++ b/src/store/virtual-machines/virtual-machines-actions.ts
@@@ -47,6 -48,6 +47,9 @@@ export const loadVirtualMachinesData = 
          });
          dispatch(virtualMachinesActions.SET_VIRTUAL_MACHINES(virtualMachines));
          dispatch(virtualMachinesActions.SET_LINKS(links));
++        const getAllLogins = await services.virtualMachineService.getAllLogins();
++        console.log(getAllLogins);  
++        dispatch(virtualMachinesActions.SET_LOGINS(getAllLogins));
      };
  
  export const saveRequestedDate = () =>
diff --cc src/views/virtual-machine-panel/virtual-machine-panel.tsx
index 5eb9b19,c94c3a7..504910e
--- a/src/views/virtual-machine-panel/virtual-machine-panel.tsx
+++ b/src/views/virtual-machine-panel/virtual-machine-panel.tsx
@@@ -76,7 -75,6 +76,7 @@@ interface VirtualMachinesPanelDataProp
      virtualMachines: ListResults<any>;
      logins: VirtualMachinesLoginsResource[];
      links: ListResults<any>;
-     isAdmin: string;
++    isAdmin: boolean;
  }
  
  interface VirtualMachinesPanelActionProps {
@@@ -149,34 -147,34 +149,64 @@@ const CardContentWithVirtualMachines = 
                          </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>
--                        {props.virtualMachines.items.map((it, index) =>
--                            <TableRow key={index}>
--                                <TableCell>{it.hostname}</TableCell>
--                                <TableCell>{getUsername(props.links, it)}</TableCell>
--                                <TableCell>ssh {getUsername(props.links, it)}@shell.arvados</TableCell>
--                                <TableCell>
--                                    <a href={`https://workbench.c97qk.arvadosapi.com${it.href}/webshell/${getUsername(props.links, it)}`} target="_blank" className={props.classes.link}>
--                                        Log in as {getUsername(props.links, it)}
--                                    </a>
--                                </TableCell>
--                            </TableRow>
--                        )}
--                    </TableBody>
--                </Table>
++                {console.log(props.isAdmin)}
++                {props.isAdmin ? adminVirtualMachinesTable(props) : userVirtualMachinesTable(props)}
              </CardContent>
          </Card>
      </Grid>;
  
++const userVirtualMachinesTable = (props: VirtualMachineProps) =>
++    <Table>
++        <TableHead>
++            <TableRow>
++                <TableCell>Host name</TableCell>
++                <TableCell>Login name</TableCell>
++                <TableCell>Command line</TableCell>
++                <TableCell>Web shell</TableCell>
++            </TableRow>
++        </TableHead>
++        <TableBody>
++            {props.virtualMachines.items.map((it, index) =>
++                <TableRow key={index}>
++                    <TableCell>{it.hostname}</TableCell>
++                    <TableCell>{getUsername(props.links, it)}</TableCell>
++                    <TableCell>ssh {getUsername(props.links, it)}@shell.arvados</TableCell>
++                    <TableCell>
++                        <a href={`https://workbench.c97qk.arvadosapi.com${it.href}/webshell/${getUsername(props.links, it)}`} target="_blank" className={props.classes.link}>
++                            Log in as {getUsername(props.links, it)}
++                        </a>
++                    </TableCell>
++                </TableRow>
++            )}
++        </TableBody>
++    </Table>;
++
++const adminVirtualMachinesTable = (props: VirtualMachineProps) =>
++    <Table>
++        <TableHead>
++            <TableRow>
++                <TableCell>Uuid</TableCell>
++                <TableCell>Host name</TableCell>
++                <TableCell>Logins</TableCell>
++                <TableCell/>
++            </TableRow>
++        </TableHead>
++        <TableBody>
++            {props.virtualMachines.items.map((it, index) =>
++                <TableRow key={index}>
++                    <TableCell>{it.uuid}</TableCell>
++                    <TableCell>shell</TableCell>
++                    <TableCell>ssh {getUsername(props.links, it)}@shell.arvados</TableCell>
++                    <TableCell>
++                        <a href={`https://workbench.c97qk.arvadosapi.com${it.href}/webshell/${getUsername(props.links, it)}`} target="_blank" className={props.classes.link}>
++                            Log in as {getUsername(props.links, it)}
++                        </a>
++                    </TableCell>
++                </TableRow>
++            )}
++        </TableBody>
++    </Table>;
++
  const getUsername = (links: ListResults<any>, virtualMachine: VirtualMachinesResource) => {
      const link = links.items.find((item: any) => item.headUuid === virtualMachine.uuid);
      return link.properties.username || undefined;

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list