import React from 'react'; import PropTypes from 'prop-types'; import { Link } from '@reach/router'; import Logo from '../../components/logo'; import { gettext, siteRoot, isPro, otherPermission, canViewSystemInfo, canViewStatistic, canConfigSystem, canManageLibrary, canManageUser, canManageGroup, canViewUserLog, canViewAdminLog, constanceEnabled, multiTenancy, multiInstitution, sysadminExtraEnabled, enableGuestInvitation, enableTermsAndConditions, enableFileScan, enableWorkWeixin, enableShareLinkReportAbuse } 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 &&
  • this.props.tabItemClick('statistic')} > {gettext('Statistic')}
  • } {otherPermission &&
  • this.props.tabItemClick('devices')} > {gettext('Devices')}
  • } {constanceEnabled && canConfigSystem &&
  • this.props.tabItemClick('web-settings')} > {gettext('Settings')}
  • } {canManageLibrary &&
  • this.props.tabItemClick('libraries')} > {gettext('Libraries')}
  • } {canManageUser &&
  • this.props.tabItemClick('users')} > {gettext('Users')}
  • } {canManageGroup &&
  • this.props.tabItemClick('groups')} > {gettext('Groups')}
  • } {isPro && canManageGroup &&
  • this.props.tabItemClick('departments')} > {gettext('Departments')}
  • } {multiTenancy && otherPermission &&
  • this.props.tabItemClick('organizations')} > {gettext('Organizations')}
  • } {multiInstitution && otherPermission &&
  • this.props.tabItemClick('institutions')} > {gettext('Institutions')}
  • } {otherPermission &&
  • this.props.tabItemClick('notifications')} > {gettext('Notifications')}
  • } {otherPermission &&
  • this.props.tabItemClick('links')} > {gettext('Links')}
  • } {sysadminExtraEnabled && canViewUserLog &&
  • this.props.tabItemClick('logs')} > {gettext('Logs')}
  • } {isPro && otherPermission && enableFileScan &&
  • this.props.tabItemClick('file-scan-records')} > {gettext('File Scan')}
  • } {isPro && otherPermission &&
  • this.props.tabItemClick('virus-scan-records')} > {gettext('Virus Scan')}
  • } {enableGuestInvitation && otherPermission &&
  • this.props.tabItemClick('invitations')} > {gettext('Invitations')}
  • } {otherPermission && enableTermsAndConditions &&
  • this.props.tabItemClick('termsandconditions')} > {gettext('Terms and Conditions')}
  • } {isPro && canViewAdminLog &&
  • this.props.tabItemClick('adminLogs')} > {gettext('Admin Logs')}
  • } {otherPermission && enableWorkWeixin &&
  • this.props.tabItemClick('work-weixin')} > {'企业微信集成'}
  • } {otherPermission && enableShareLinkReportAbuse &&
  • this.props.tabItemClick('abuse-reports')} > {gettext('Abuse Reports')}
  • }
); } } SidePanel.propTypes = propTypes; export default SidePanel;