import React from 'react'; import PropTypes from 'prop-types'; import { Link } from '@reach/router'; import Logo from '../../components/logo'; import { gettext, siteRoot, isPro, isDefaultAdmin, canViewSystemInfo, canViewStatistic, canConfigSystem, canManageLibrary, canManageUser, canManageGroup, canViewUserLog, canViewAdminLog, constanceEnabled, multiTenancy, multiInstitution, sysadminExtraEnabled, enableGuestInvitation, enableTermsAndConditions, enableFileScan, enableWorkWeixin } from '../../utils/constants'; const propTypes = { isSidePanelClosed: PropTypes.bool.isRequired, onCloseSidePanel: PropTypes.func.isRequired, currentTab: PropTypes.string.isRequired, tabItemClick: PropTypes.func.isRequired }; class SidePanel extends React.Component { getActiveClass = (tab) => { return this.props.currentTab == tab ? 'active' : ''; } render() { return (

{gettext('System Admin')}

    {canViewSystemInfo &&
  • this.props.tabItemClick('info')} > {gettext('Info')}
  • } {isPro && canViewStatistic &&
  • {gettext('Statistic')}
  • } {isDefaultAdmin &&
  • this.props.tabItemClick('devices')} > {gettext('Devices')}
  • } {constanceEnabled && canConfigSystem &&
  • this.props.tabItemClick('web-settings')} > {gettext('Settings')}
  • } {canManageLibrary &&
  • this.props.tabItemClick('libraries')} > {gettext('Libraries')}
  • } {canManageUser &&
  • {gettext('Users')}
  • } {canManageGroup &&
  • this.props.tabItemClick('groups')} > {gettext('Groups')}
  • } {isPro && canManageGroup &&
  • {gettext('Departments')}
  • } {multiTenancy && isDefaultAdmin &&
  • {gettext('Organizations')}
  • } {multiInstitution && isDefaultAdmin &&
  • {gettext('Institutions')}
  • } {isDefaultAdmin &&
  • this.props.tabItemClick('notifications')} > {gettext('Notifications')}
  • } {isDefaultAdmin &&
  • this.props.tabItemClick('links')} > {gettext('Links')}
  • } {sysadminExtraEnabled && canViewUserLog &&
  • {gettext('Logs')}
  • } {isPro && isDefaultAdmin && enableFileScan &&
  • this.props.tabItemClick('file-scan-records')} > {gettext('File Scan')}
  • } {isPro && isDefaultAdmin &&
  • {gettext('Virus Scan')}
  • } {enableGuestInvitation && isDefaultAdmin &&
  • {gettext('Invitations')}
  • } {isDefaultAdmin && enableTermsAndConditions &&
  • {gettext('Terms and Conditions')}
  • } {isPro && canViewAdminLog &&
  • {gettext('Admin Logs')}
  • } {isDefaultAdmin && enableWorkWeixin &&
  • this.props.tabItemClick('work-weixin')} > {'企业微信集成'}
  • }
); } } SidePanel.propTypes = propTypes; export default SidePanel;