// Copyright (C) The Arvados Authors. All rights reserved. // // SPDX-License-Identifier: AGPL-3.0 import React from "react"; import { MenuItem } from "@mui/material"; import { User } from "models/user"; import { DropdownMenu } from "components/dropdown-menu/dropdown-menu"; import { AdminMenuIcon } from "components/icon/icon"; import { DispatchProp, connect } from 'react-redux'; import { RootState } from "store/store"; import { openRepositoriesPanel } from "store/repositories/repositories-actions"; import * as NavigationAction from 'store/navigation/navigation-action'; import { openAdminVirtualMachines } from "store/virtual-machines/virtual-machines-actions"; import { openUserPanel } from "store/users/users-actions"; interface AdminMenuProps { user?: User; currentRoute: string; } const mapStateToProps = (state: RootState): AdminMenuProps => ({ user: state.auth.user, currentRoute: state.router.location ? state.router.location.pathname : '' }); export const AdminMenu = connect(mapStateToProps)( ({ user, dispatch, currentRoute }: AdminMenuProps & DispatchProp) => user ? } id="admin-menu" title="Admin Panel" key={currentRoute}> dispatch(openRepositoriesPanel())}>Repositories dispatch(openAdminVirtualMachines())}>Shell Access dispatch(NavigationAction.navigateToSshKeysAdmin)}>Ssh Keys dispatch(NavigationAction.navigateToApiClientAuthorizations)}>Api Tokens dispatch(openUserPanel())}>Users dispatch(NavigationAction.navigateToGroups)}>Groups dispatch(NavigationAction.navigateToKeepServices)}>Keep Services dispatch(NavigationAction.navigateToLinks)}>Links : null);