21700: Install Bundler system-wide in Rails postinst
[arvados.git] / services / workbench2 / src / views / site-manager-panel / site-manager-panel.tsx
1 // Copyright (C) The Arvados Authors. All rights reserved.
2 //
3 // SPDX-License-Identifier: AGPL-3.0
4
5 import { RootState } from 'store/store';
6 import { Dispatch } from 'redux';
7 import { connect } from 'react-redux';
8 import {
9     SiteManagerPanelRoot, SiteManagerPanelRootActionProps,
10     SiteManagerPanelRootDataProps
11 } from "views/site-manager-panel/site-manager-panel-root";
12 import { Session } from "models/session";
13 import { toggleSession, removeSession } from "store/auth/auth-action-session";
14
15 const mapStateToProps = (state: RootState): SiteManagerPanelRootDataProps => {
16     return {
17         sessions: state.auth.sessions,
18         remoteHostsConfig: state.auth.remoteHostsConfig,
19         localClusterConfig: state.auth.remoteHostsConfig[state.auth.localCluster]
20     };
21 };
22
23 const mapDispatchToProps = (dispatch: Dispatch): SiteManagerPanelRootActionProps => ({
24     toggleSession: (session: Session) => {
25         dispatch<any>(toggleSession(session));
26     },
27     removeSession: (session: Session) => {
28         dispatch<any>(removeSession(session.clusterId));
29     },
30 });
31
32 export const SiteManagerPanel = connect(mapStateToProps, mapDispatchToProps)(SiteManagerPanelRoot);