X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/0da5b926cb7aa461e8d45d86d5fc423d90e768a1..2ba76201944d5ad4ef84aaf16c18f5bbb38a8b89:/src/views/login-panel/login-panel.tsx?ds=sidebyside diff --git a/src/views/login-panel/login-panel.tsx b/src/views/login-panel/login-panel.tsx index 48c6e163ff..b9f3194ab0 100644 --- a/src/views/login-panel/login-panel.tsx +++ b/src/views/login-panel/login-panel.tsx @@ -4,13 +4,11 @@ import * as React from 'react'; import { connect, DispatchProp } from 'react-redux'; -import { Grid, Typography, Button } from '@material-ui/core'; +import { Grid, Typography, Button, Select, FormControl } from '@material-ui/core'; import { StyleRulesCallback, WithStyles, withStyles } from '@material-ui/core/styles'; -import { login } from '~/store/auth/auth-action'; +import { login, authActions } from '~/store/auth/auth-action'; import { ArvadosTheme } from '~/common/custom-theme'; import { RootState } from '~/store/store'; -import { getProperty } from '~/store/properties/properties'; -import { propertiesActions } from '~/store/properties/properties-actions'; import * as classNames from 'classnames'; type CssRules = 'root' | 'container' | 'title' | 'content' | 'content__bolder' | 'button'; @@ -52,26 +50,20 @@ const styles: StyleRulesCallback = (theme: ArvadosTheme) => ({ }); type LoginPanelProps = DispatchProp & WithStyles & { - remoteHosts: any, + remoteHosts: { [key: string]: string }, homeCluster: string, uuidPrefix: string }; -export const REMOTE_HOSTS_NAME = 'remoteHosts'; -export const HOME_CLUSTER_NAME = 'homeCluster'; -export const setRemoteHosts = (remoteHosts: any) => - propertiesActions.SET_PROPERTY({ key: REMOTE_HOSTS_NAME, value: remoteHosts }); - -export const setHomeCluster = (homeCluster: string) => - propertiesActions.SET_PROPERTY({ key: HOME_CLUSTER_NAME, value: homeCluster }); - export const LoginPanel = withStyles(styles)( connect((state: RootState) => ({ - remoteHosts: state.properties.remoteHosts, - homeCluster: state.properties.homeCluster, - uuidPrefix: state.properties.uuidPrefix + remoteHosts: state.auth.remoteHosts, + homeCluster: state.auth.homeCluster, + uuidPrefix: state.auth.localCluster }))(({ classes, dispatch, remoteHosts, homeCluster, uuidPrefix }: LoginPanelProps) => - + Welcome to the Arvados Workbench @@ -90,21 +82,23 @@ export const LoginPanel = withStyles(styles)( Arvados Workbench uses your name and email address only for identification, and does not retrieve any other personal information from Google. - -
- -
-
+ {Object.keys(remoteHosts).length > 1 && + + + + } + - +
-
+
));