[ARVADOS-WORKBENCH2] updated: 1.2.1-1065-g9dbb203
Git user
git at public.curoverse.com
Fri Nov 30 11:16:53 EST 2018
Summary of changes:
src/models/virtual-machines.ts | 6 ++---
.../virtual-machines/virtual-machines-actions.ts | 4 +--
.../virtual-machine-panel.tsx | 29 ++++++++--------------
3 files changed, 15 insertions(+), 24 deletions(-)
via 9dbb20349af9d1fa275e01147c53242d3b4680f5 (commit)
from 93cb6b20b9f7893c588d9679c7b904ee35238f1b (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 9dbb20349af9d1fa275e01147c53242d3b4680f5
Author: Pawel Kowalczyk <pawel.kowalczyk at contractors.roche.com>
Date: Fri Nov 30 17:16:41 2018 +0100
virtual-machines-admin-panel
Feature #14498
Arvados-DCO-1.1-Signed-off-by: Pawel Kowalczyk <pawel.kowalczyk at contractors.roche.com>
diff --git a/src/models/virtual-machines.ts b/src/models/virtual-machines.ts
index acc084a..85d0a56 100644
--- a/src/models/virtual-machines.ts
+++ b/src/models/virtual-machines.ts
@@ -12,9 +12,9 @@ export interface VirtualMachinesLoginsItems {
hostname: string;
username: string;
public_key: string;
- user_uuid: string;
- virtual_machine_uuid: string;
- authorized_key_uuid: string;
+ userUuid: string;
+ virtualMachineUuid: string;
+ authorizedKeyUuid: string;
}
export interface VirtualMachineLogins {
diff --git a/src/store/virtual-machines/virtual-machines-actions.ts b/src/store/virtual-machines/virtual-machines-actions.ts
index bb942bb..d87433f 100644
--- a/src/store/virtual-machines/virtual-machines-actions.ts
+++ b/src/store/virtual-machines/virtual-machines-actions.ts
@@ -57,8 +57,8 @@ export const loadVirtualMachinesData = () =>
});
dispatch(virtualMachinesActions.SET_VIRTUAL_MACHINES(virtualMachines));
dispatch(virtualMachinesActions.SET_LINKS(links));
- const logins = await services.virtualMachineService.logins(virtualMachinesUuids[0]);
- dispatch(virtualMachinesActions.SET_LOGINS(logins));
+ const getAllLogins = await services.virtualMachineService.getAllLogins();
+ dispatch(virtualMachinesActions.SET_LOGINS(getAllLogins));
};
export const saveRequestedDate = () =>
diff --git a/src/views/virtual-machine-panel/virtual-machine-panel.tsx b/src/views/virtual-machine-panel/virtual-machine-panel.tsx
index 6c89554..de5e33a 100644
--- a/src/views/virtual-machine-panel/virtual-machine-panel.tsx
+++ b/src/views/virtual-machine-panel/virtual-machine-panel.tsx
@@ -113,7 +113,7 @@ export const VirtualMachinePanel = compose(
const { virtualMachines, links, isAdmin } = this.props;
return (
<Grid container spacing={16}>
- {virtualMachines.itemsAvailable === 0 && <CardContentWithNoVirtualMachines {...this.props} />}
+ {!isAdmin && virtualMachines.itemsAvailable > 0 && <CardContentWithNoVirtualMachines {...this.props} />}
{virtualMachines.itemsAvailable > 0 && links.itemsAvailable > 0 && <CardContentWithVirtualMachines {...this.props} />}
{!isAdmin && <CardSSHSection {...this.props} />}
</Grid>
@@ -148,16 +148,8 @@ const CardContentWithVirtualMachines = (props: VirtualMachineProps) =>
<Grid item xs={12}>
<Card>
<CardContent>
- {props.isAdmin ?
- <span>
- <div className={props.classes.rightAlign}>
- <Button variant="contained" color="primary" className={props.classes.button} onClick={props.saveRequestedDate}>
- <AddIcon /> NEW VIRTUAL MACHINE
- </Button>
- </div>
- {adminVirtualMachinesTable(props)}
- </span> :
- <span>
+ {props.isAdmin ? <span>{adminVirtualMachinesTable(props)}</span>
+ : <span>
<div className={props.classes.rightAlign}>
<Button variant="contained" color="primary" className={props.classes.button} onClick={props.saveRequestedDate}>
SEND REQUEST FOR SHELL ACCESS
@@ -195,11 +187,11 @@ const userVirtualMachinesTable = (props: VirtualMachineProps) =>
{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>{getUsername(props.links)}</TableCell>
+ <TableCell>ssh {getUsername(props.links)}@{it.hostname}.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 href={`https://workbench.c97qk.arvadosapi.com${it.href}/webshell/${getUsername(props.links)}`} target="_blank" className={props.classes.link}>
+ Log in as {getUsername(props.links)}
</a>
</TableCell>
</TableRow>
@@ -221,7 +213,7 @@ const adminVirtualMachinesTable = (props: VirtualMachineProps) =>
{props.logins.items.length > 0 && props.virtualMachines.items.map((it, index) =>
<TableRow key={index}>
<TableCell>{it.uuid}</TableCell>
- <TableCell>{props.logins.items[0].hostname}</TableCell>
+ <TableCell>{it.hostname}</TableCell>
<TableCell>["{props.logins.items[0].username}"]</TableCell>
<TableCell className={props.classes.moreOptions}>
<Tooltip title="More options" disableFocusListener>
@@ -235,9 +227,8 @@ const adminVirtualMachinesTable = (props: VirtualMachineProps) =>
</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;
+const getUsername = (links: ListResults<any>) => {
+ return links.items[0].properties.username;
};
const CardSSHSection = (props: VirtualMachineProps) =>
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list