X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/d75bc00b51e9c8db81e91e8ab28d915d7cbd4768..76cc719bbb330ab23759c090a28c4c178d953436:/src/views/site-manager-panel/site-manager-panel-root.tsx diff --git a/src/views/site-manager-panel/site-manager-panel-root.tsx b/src/views/site-manager-panel/site-manager-panel-root.tsx index a8f7439a..223e373c 100644 --- a/src/views/site-manager-panel/site-manager-panel-root.tsx +++ b/src/views/site-manager-panel/site-manager-panel-root.tsx @@ -8,6 +8,7 @@ import { CardContent, CircularProgress, Grid, + IconButton, StyleRulesCallback, Table, TableBody, @@ -28,6 +29,7 @@ import { addSession } from "~/store/auth/auth-action-session"; import { SITE_MANAGER_REMOTE_HOST_VALIDATION } from "~/validators/validators"; import { Config } from '~/common/config'; import { ResourceCluster } from '~/views-components/data-explorer/renderers'; +import { TrashIcon } from "~/components/icon/icon"; type CssRules = 'root' | 'link' | 'buttonContainer' | 'table' | 'tableRow' | 'remoteSiteInfo' | 'buttonAdd' | 'buttonLoggedIn' | 'buttonLoggedOut' | @@ -86,11 +88,13 @@ const styles: StyleRulesCallback = (theme: ArvadosTheme) => ({ export interface SiteManagerPanelRootActionProps { toggleSession: (session: Session) => void; + removeSession: (session: Session) => void; } export interface SiteManagerPanelRootDataProps { sessions: Session[]; remoteHostsConfig: { [key: string]: Config }; + localClusterConfig: Config; } type SiteManagerPanelRootProps = SiteManagerPanelRootDataProps & SiteManagerPanelRootActionProps & WithStyles & InjectedFormProps; @@ -98,7 +102,7 @@ const SITE_MANAGER_FORM_NAME = 'siteManagerForm'; const submitSession = (remoteHost: string) => (dispatch: Dispatch) => { - dispatch(addSession(remoteHost)).then(() => { + dispatch(addSession(remoteHost, undefined, true)).then(() => { dispatch(reset(SITE_MANAGER_FORM_NAME)); }).catch((e: any) => { const errors = { @@ -117,7 +121,7 @@ export const SiteManagerPanelRoot = compose( } }), withStyles(styles)) - (({ classes, sessions, handleSubmit, toggleSession, remoteHostsConfig }: SiteManagerPanelRootProps) => + (({ classes, sessions, handleSubmit, toggleSession, removeSession, localClusterConfig, remoteHostsConfig }: SiteManagerPanelRootProps) => @@ -136,6 +140,7 @@ export const SiteManagerPanelRoot = compose( Email UUID Status + Actions @@ -156,6 +161,13 @@ export const SiteManagerPanelRoot = compose( {validating ? "Validating" : (session.loggedIn ? "Logged in" : "Logged out")} + + {session.clusterId !== localClusterConfig.uuidPrefix && + !localClusterConfig.clusterConfig.RemoteClusters[session.clusterId] && + removeSession(session)}> + + } + ; })}