[ARVADOS-WORKBENCH2] updated: 1.3.0-232-g34bf7853
Git user
git at public.curoverse.com
Tue Dec 18 09:39:06 EST 2018
Summary of changes:
.../virtual-machine-admin-panel.tsx | 10 ++++++----
.../virtual-machine-user-panel.tsx | 20 +++++++++++---------
2 files changed, 17 insertions(+), 13 deletions(-)
via 34bf785353d3e199b68443d013ad32b695ca7882 (commit)
from fdfda0ff25ac572f30cac69f6297af7bcf2d4502 (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 34bf785353d3e199b68443d013ad32b695ca7882
Author: Pawel Kowalczyk <pawel.kowalczyk at contractors.roche.com>
Date: Tue Dec 18 15:38:50 2018 +0100
refs #14498-usernames-in-machines
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-admin-panel.tsx b/src/views/virtual-machine-panel/virtual-machine-admin-panel.tsx
index dda2889f..85a204e3 100644
--- a/src/views/virtual-machine-panel/virtual-machine-admin-panel.tsx
+++ b/src/views/virtual-machine-panel/virtual-machine-admin-panel.tsx
@@ -29,10 +29,11 @@ const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
},
});
-const mapStateToProps = ({ virtualMachines }: RootState) => {
+const mapStateToProps = (state: RootState) => {
return {
- logins: virtualMachines.logins,
- ...virtualMachines
+ logins: state.virtualMachines.logins,
+ userUuid: state.auth.user!.uuid,
+ ...state.virtualMachines
};
};
@@ -46,6 +47,7 @@ const mapDispatchToProps = (dispatch: Dispatch): Pick<VirtualMachinesPanelAction
interface VirtualMachinesPanelDataProps {
virtualMachines: ListResults<any>;
logins: VirtualMachineLogins;
+ userUuid: string;
}
interface VirtualMachinesPanelActionProps {
@@ -98,7 +100,7 @@ const virtualMachinesTable = (props: VirtualMachineProps) =>
<TableRow key={index}>
<TableCell>{it.uuid}</TableCell>
<TableCell>{it.hostname}</TableCell>
- <TableCell>["{props.logins.items[0].username}"]</TableCell>
+ <TableCell>["{props.logins.items.map(it => it.userUuid === props.userUuid ? it.username : '')}"]</TableCell>
<TableCell className={props.classes.moreOptions}>
<Tooltip title="More options" disableFocusListener>
<IconButton onClick={event => props.onOptionsMenuOpen(event, it)} className={props.classes.moreOptionsButton}>
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 fbb1f23f..5cb4565e 100644
--- a/src/views/virtual-machine-panel/virtual-machine-user-panel.tsx
+++ b/src/views/virtual-machine-panel/virtual-machine-user-panel.tsx
@@ -57,10 +57,11 @@ const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
}
});
-const mapStateToProps = ({ virtualMachines }: RootState) => {
+const mapStateToProps = (state: RootState) => {
return {
- requestedDate: virtualMachines.date,
- ...virtualMachines
+ requestedDate: state.virtualMachines.date,
+ userUuid: state.auth.user!.uuid,
+ ...state.virtualMachines
};
};
@@ -72,6 +73,7 @@ const mapDispatchToProps = (dispatch: Dispatch): Pick<VirtualMachinesPanelAction
interface VirtualMachinesPanelDataProps {
requestedDate: string;
virtualMachines: ListResults<any>;
+ userUuid: string;
links: ListResults<any>;
}
@@ -166,11 +168,11 @@ const virtualMachinesTable = (props: VirtualMachineProps) =>
{props.virtualMachines.items.map((it, index) =>
<TableRow key={index}>
<TableCell>{it.hostname}</TableCell>
- <TableCell>{getUsername(props.links)}</TableCell>
- <TableCell>ssh {getUsername(props.links)}@{it.hostname}.arvados</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)}`} target="_blank" className={props.classes.link}>
- Log in as {getUsername(props.links)}
+ <a href={`https://workbench.c97qk.arvadosapi.com${it.href}/webshell/${getUsername(props.links, props.userUuid)}`} target="_blank" className={props.classes.link}>
+ Log in as {getUsername(props.links, props.userUuid)}
</a>
</TableCell>
</TableRow>
@@ -178,8 +180,8 @@ const virtualMachinesTable = (props: VirtualMachineProps) =>
</TableBody>
</Table>;
-const getUsername = (links: ListResults<any>) => {
- return links.items[0].properties.username;
+const getUsername = (links: ListResults<any>, userUuid: string) => {
+ return links.items.map(it => it.tailUuid === userUuid ? it.properties.username : '');
};
const CardSSHSection = (props: VirtualMachineProps) =>
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list