remoteHosts: { [key: string]: string },
homeCluster: string,
uuidPrefix: string,
+ loginCluster: string,
welcomePage: string
};
remoteHosts: state.auth.remoteHosts,
homeCluster: state.auth.homeCluster,
uuidPrefix: state.auth.localCluster,
- welcomePage: state.config.clusterConfig.Workbench.WelcomePageHTML
- }))(({ classes, dispatch, remoteHosts, homeCluster, uuidPrefix, welcomePage }: LoginPanelProps) =>
+ loginCluster: state.auth.loginCluster,
+ welcomePage: state.auth.config.clusterConfig.Workbench.WelcomePageHTML
+ }))(({ classes, dispatch, remoteHosts, homeCluster, uuidPrefix, loginCluster, welcomePage }: LoginPanelProps) =>
<Grid container justify="center" alignItems="center"
className={classes.root}
style={{ marginTop: 56, overflowY: "auto", height: "100%" }}>
<Typography>
<div dangerouslySetInnerHTML={{ __html: welcomePage }} style={{ margin: "1em" }} />
</Typography>
- {Object.keys(remoteHosts).length > 1 &&
+ {Object.keys(remoteHosts).length > 1 && loginCluster === "" &&
+
<Typography component="div" align="right">
<label>Please select the cluster that hosts your user account:</label>
<Select native value={homeCluster} style={{ margin: "1em" }}
<Typography component="div" align="right">
<Button variant="contained" color="primary" style={{ margin: "1em" }} className={classes.button}
- onClick={() => dispatch(login(uuidPrefix, homeCluster, remoteHosts))}>
- Log in to {uuidPrefix}
- {uuidPrefix !== homeCluster &&
- <span> with user from {homeCluster}</span>}
+ onClick={() => dispatch(login(uuidPrefix, homeCluster, loginCluster, remoteHosts))}>
+ Log in
+ {uuidPrefix !== homeCluster && loginCluster !== homeCluster &&
+ <span> to {uuidPrefix} with user from {homeCluster}</span>}
</Button>
</Typography>
</Grid>