VocabularyURL: string;
FileViewersConfigURL: string;
};
+ Login: {
+ LoginCluster: string;
+ };
}
export class Config {
workbench2Url: string;
vocabularyUrl: string;
fileViewersConfigUrl: string;
+ loginCluster: string;
}
export const fetchConfig = () => {
config.workbench2Url = clusterConfigJSON.Services.Workbench2.ExternalURL;
config.workbenchUrl = clusterConfigJSON.Services.Workbench1.ExternalURL;
config.keepWebServiceUrl = clusterConfigJSON.Services.WebDAV.ExternalURL;
+ config.loginCluster = clusterConfigJSON.Login.LoginCluster;
mapRemoteHosts(clusterConfigJSON, config);
return { config, apiHost: workbenchConfig.API_HOST };
workbenchUrl: "",
workbench2Url: "",
vocabularyUrl: "",
- fileViewersConfigUrl: ""
+ fileViewersConfigUrl: "",
+ loginCluster: ""
});
const getDefaultConfig = (): WorkbenchConfig => {
export const ARVADOS_API_PATH = "arvados/v1";
export const CLUSTER_CONFIG_URL = "arvados/v1/config";
-export const getClusterConfigURL = (apiHost: string) => `${window.location.protocol}//${apiHost}/${CLUSTER_CONFIG_URL}?nocache=${(new Date()).getTime()}`;
\ No newline at end of file
+export const getClusterConfigURL = (apiHost: string) => `${window.location.protocol}//${apiHost}/${CLUSTER_CONFIG_URL}?nocache=${(new Date()).getTime()}`;
setAuthorizationHeader(services, token);
}
dispatch(authActions.CONFIG({ config }));
- dispatch(authActions.SET_HOME_CLUSTER(homeCluster || config.uuidPrefix));
+ dispatch(authActions.SET_HOME_CLUSTER(config.loginCluster || homeCluster || config.uuidPrefix));
if (token && user) {
dispatch(authActions.INIT({ user, token }));
dispatch<any>(initSessions(services.authService, config, user));
remoteConfig.uuidPrefix = response.data.ClusterID;
remoteConfig.workbench2Url = response.data.Services.Workbench2.ExternalURL;
mapRemoteHosts(response.data, remoteConfig);
- dispatch(authActions.REMOTE_CLUSTER_CONFIG({ config: remoteConfig}));
+ dispatch(authActions.REMOTE_CLUSTER_CONFIG({ config: remoteConfig }));
});
});
};
sessions: Session[];
localCluster: string;
homeCluster: string;
+ loginCluster: string;
remoteHosts: { [key: string]: string };
remoteHostsConfig: { [key: string]: Config };
}
sessions: [],
localCluster: "",
homeCluster: "",
+ loginCluster: "",
remoteHosts: {},
remoteHostsConfig: {}
};
return { ...state, apiToken: token };
},
SAVE_USER: (user: UserResource) => {
- return { ...state, user};
+ return { ...state, user };
},
CONFIG: ({ config }) => {
return {
...state,
localCluster: config.uuidPrefix,
remoteHosts: { ...config.remoteHosts, [config.uuidPrefix]: new URL(config.rootUrl).host },
- homeCluster: config.uuidPrefix
+ homeCluster: config.loginCluster || config.uuidPrefix,
+ loginCluster: config.loginCluster
};
},
REMOTE_CLUSTER_CONFIG: ({ config }) => {
type LoginPanelProps = DispatchProp<any> & WithStyles<CssRules> & {
remoteHosts: { [key: string]: string },
homeCluster: string,
- uuidPrefix: string
+ uuidPrefix: string,
+ loginCluster: string
};
export const LoginPanel = withStyles(styles)(
connect((state: RootState) => ({
remoteHosts: state.auth.remoteHosts,
homeCluster: state.auth.homeCluster,
- uuidPrefix: state.auth.localCluster
- }))(({ classes, dispatch, remoteHosts, homeCluster, uuidPrefix }: LoginPanelProps) =>
+ uuidPrefix: state.auth.localCluster,
+ loginCluster: state.auth.loginCluster
+ }))(({ classes, dispatch, remoteHosts, homeCluster, uuidPrefix, loginCluster }: LoginPanelProps) =>
<Grid container justify="center" alignItems="center"
className={classes.root}
style={{ marginTop: 56, overflowY: "auto", height: "100%" }}>
Arvados Workbench uses your name and email address only for identification, and does not retrieve any other personal information from Google.
</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" }}