import React, { Component, Fragment } from 'react'; import PropTypes from 'prop-types'; import { Link } from '@gatsbyjs/reach-router'; import { siteRoot, gettext } from '../../utils/constants'; import MainPanelTopbar from './main-panel-topbar'; import { Button } from 'reactstrap'; import ModalPortal from '../../components/modal-portal'; import OrgLogsExportExcelDialog from '../../components/dialog/org-admin-logs-export-excel-dialog'; class OrgLogs extends Component { constructor(props) { super(props); this.state = { isExportExcelDialogOpen: false, logType: '', }; } componentDidMount() { let href = window.location.href.split('/'); let logtype = href[href.length - 2]; if (logtype === 'logadmin') { logtype = 'fileaudit'; } this.setState({ logType: logtype }); } toggleExportExcelDialog = () => { this.setState({ isExportExcelDialogOpen: !this.state.isExportExcelDialogOpen }); }; tabItemClick = (param) => { this.setState({ logType: param }); this.props.tabItemClick(param); }; render() { const { isExportExcelDialogOpen, logType } = this.state; return ( {this.props.currentTab === 'repo-transfer' ? : }
  • this.tabItemClick('fileaudit')}> {gettext('File Access')}
  • this.tabItemClick('file-update')}> {gettext('File Update')}
  • this.tabItemClick('perm-audit')}> {gettext('Permission')}
  • this.tabItemClick('repo-transfer')}> {gettext('Repo Transfer')}
{this.props.children}
{isExportExcelDialogOpen && }
); } } const propTypes = { currentTab: PropTypes.string.isRequired, tabItemClick: PropTypes.func.isRequired, children: PropTypes.any.isRequired, }; OrgLogs.propTypes = propTypes; export default OrgLogs;