2019-02-27 19:44:22 +08:00
|
|
|
import React from 'react';
|
2022-12-29 12:21:47 +08:00
|
|
|
import ReactDom from 'react-dom';
|
|
|
|
import { Router } from '@gatsbyjs/reach-router';
|
2019-02-27 19:44:22 +08:00
|
|
|
import { siteRoot } from '../../utils/constants';
|
|
|
|
import SidePanel from './side-panel';
|
2022-11-10 13:27:55 +08:00
|
|
|
|
|
|
|
import OrgStatisticFile from './statistic/statistic-file';
|
|
|
|
import OrgStatisticStorage from './statistic/statistic-storage';
|
|
|
|
import OrgStatisticTraffic from './statistic/statistic-traffic';
|
|
|
|
import OrgStatisticUsers from './statistic/statistic-users';
|
|
|
|
import OrgStatisticReport from './statistic/statistic-reports';
|
2023-09-04 09:50:14 +08:00
|
|
|
import OrgDesktopDevices from './devices/desktop-devices';
|
|
|
|
import OrgMobileDevices from './devices/mobile-devices';
|
|
|
|
import OrgDevicesErrors from './devices/devices-errors';
|
2023-03-11 13:07:00 +08:00
|
|
|
import OrgWebSettings from './web-settings/web-settings';
|
2020-04-27 14:46:41 +08:00
|
|
|
import OrgUsers from './org-users-users';
|
2021-07-22 11:54:10 +08:00
|
|
|
import OrgUsersSearchUsers from './org-users-search-users';
|
2020-04-27 14:46:41 +08:00
|
|
|
import OrgAdmins from './org-users-admins';
|
2019-08-01 15:32:57 +08:00
|
|
|
import OrgUserProfile from './org-user-profile';
|
|
|
|
import OrgUserRepos from './org-user-repos';
|
|
|
|
import OrgUserSharedRepos from './org-user-shared-repos';
|
2019-03-13 10:32:38 +08:00
|
|
|
import OrgGroups from './org-groups';
|
2021-07-22 16:48:38 +08:00
|
|
|
import OrgGroupsSearchGroups from './org-groups-search-groups';
|
2019-08-02 20:58:36 +08:00
|
|
|
import OrgGroupInfo from './org-group-info';
|
|
|
|
import OrgGroupRepos from './org-group-repos';
|
|
|
|
import OrgGroupMembers from './org-group-members';
|
2019-03-15 16:30:20 +08:00
|
|
|
import OrgLibraries from './org-libraries';
|
2019-03-18 13:15:08 +08:00
|
|
|
import OrgInfo from './org-info';
|
2019-03-26 16:56:15 +08:00
|
|
|
import OrgLinks from './org-links';
|
2019-04-01 13:38:25 +08:00
|
|
|
import OrgDepartments from './org-departments';
|
|
|
|
import OrgDepartmentsList from './org-departments-list';
|
|
|
|
import OrgDepartmentItem from './org-department-item';
|
2019-04-03 16:54:24 +08:00
|
|
|
import OrgLogs from './org-logs';
|
|
|
|
import OrgLogsFileAudit from './org-logs-file-audit';
|
|
|
|
import OrgLogsFileUpdate from './org-logs-file-update';
|
|
|
|
import OrgLogsPermAudit from './org-logs-perm-audit';
|
2022-12-26 09:56:51 +08:00
|
|
|
import OrgSAMLConfig from './org-saml-config';
|
2019-02-27 19:44:22 +08:00
|
|
|
|
|
|
|
import '../../css/layout.css';
|
|
|
|
import '../../css/toolbar.css';
|
|
|
|
|
|
|
|
class Org extends React.Component {
|
|
|
|
constructor(props) {
|
|
|
|
super(props);
|
|
|
|
this.state = {
|
|
|
|
isSidePanelClosed: false,
|
2020-04-27 14:46:41 +08:00
|
|
|
currentTab: 'users'
|
2019-02-27 19:44:22 +08:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
componentDidMount() {
|
|
|
|
let href = window.location.href.split('/');
|
|
|
|
let currentTab = href[href.length - 2];
|
2019-08-06 14:59:49 +08:00
|
|
|
|
|
|
|
if (location.href.indexOf(`${siteRoot}org/useradmin`) != -1) {
|
2019-02-27 19:44:22 +08:00
|
|
|
currentTab = 'users';
|
|
|
|
}
|
2022-11-10 13:27:55 +08:00
|
|
|
if (location.href.indexOf(`${siteRoot}org/statistics-admin/`) != -1) {
|
|
|
|
currentTab = 'statistics-admin';
|
|
|
|
}
|
|
|
|
if (location.href.indexOf(`${siteRoot}org/deviceadmin/`) != -1) {
|
|
|
|
currentTab = 'deviceadmin';
|
|
|
|
}
|
2019-08-06 14:59:49 +08:00
|
|
|
if (location.href.indexOf(`${siteRoot}org/groupadmin`) != -1) {
|
|
|
|
currentTab = 'groupadmin';
|
|
|
|
}
|
|
|
|
if (location.href.indexOf(`${siteRoot}org/departmentadmin`) != -1) {
|
2019-04-01 13:38:25 +08:00
|
|
|
currentTab = 'departmentadmin';
|
|
|
|
}
|
2019-02-27 19:44:22 +08:00
|
|
|
this.setState({currentTab: currentTab});
|
|
|
|
}
|
|
|
|
|
|
|
|
onCloseSidePanel = () => {
|
|
|
|
this.setState({isSidePanelClosed: !this.state.isSidePanelClosed});
|
|
|
|
}
|
|
|
|
|
|
|
|
tabItemClick = (param) => {
|
2020-11-02 13:56:35 +08:00
|
|
|
this.setState({currentTab: param});
|
2019-05-02 20:37:09 +08:00
|
|
|
}
|
2019-02-27 19:44:22 +08:00
|
|
|
|
2019-04-29 22:20:56 +08:00
|
|
|
render() {
|
2019-05-05 15:18:54 +08:00
|
|
|
let { isSidePanelClosed, currentTab } = this.state;
|
2019-02-27 19:44:22 +08:00
|
|
|
return (
|
|
|
|
<div id="main">
|
2020-11-02 13:56:35 +08:00
|
|
|
<SidePanel isSidePanelClosed={isSidePanelClosed} onCloseSidePanel={this.onCloseSidePanel} currentTab={currentTab} tabItemClick={this.tabItemClick}/>
|
2022-10-12 18:10:12 +08:00
|
|
|
<div className="main-panel">
|
2019-04-01 14:46:14 +08:00
|
|
|
<Router className="reach-router">
|
2022-11-10 13:27:55 +08:00
|
|
|
<OrgInfo path={siteRoot + 'org/info/'} />
|
|
|
|
<OrgStatisticFile path={siteRoot + 'org/statistics-admin/file/'} />
|
|
|
|
<OrgStatisticStorage path={siteRoot + 'org/statistics-admin/total-storage/'} />
|
|
|
|
<OrgStatisticUsers path={siteRoot + 'org/statistics-admin/active-users/'} />
|
|
|
|
<OrgStatisticTraffic path={siteRoot + 'org/statistics-admin/traffic/'} />
|
|
|
|
<OrgStatisticReport path={siteRoot + 'org/statistics-admin/reports/'} />
|
|
|
|
<OrgDesktopDevices path={siteRoot + 'org/deviceadmin/desktop-devices/'} />
|
|
|
|
<OrgMobileDevices path={siteRoot + 'org/deviceadmin/mobile-devices/'} />
|
|
|
|
<OrgDevicesErrors path={siteRoot + 'org/deviceadmin/devices-errors/'} />
|
2023-03-11 13:07:00 +08:00
|
|
|
<OrgWebSettings path={siteRoot + 'org/web-settings'} />
|
2020-04-27 14:46:41 +08:00
|
|
|
<OrgUsers path={siteRoot + 'org/useradmin'} />
|
2021-07-22 11:54:10 +08:00
|
|
|
<OrgUsersSearchUsers path={siteRoot + 'org/useradmin/search-users'} />
|
2020-04-27 14:46:41 +08:00
|
|
|
<OrgAdmins path={siteRoot + 'org/useradmin/admins/'} />
|
2019-08-01 15:32:57 +08:00
|
|
|
<OrgUserProfile path={siteRoot + 'org/useradmin/info/:email/'} />
|
|
|
|
<OrgUserRepos path={siteRoot + 'org/useradmin/info/:email/repos/'} />
|
|
|
|
<OrgUserSharedRepos path={siteRoot + 'org/useradmin/info/:email/shared-repos/'} />
|
2019-08-02 20:58:36 +08:00
|
|
|
<OrgGroups path={siteRoot + 'org/groupadmin'} />
|
2021-07-22 16:48:38 +08:00
|
|
|
<OrgGroupsSearchGroups path={siteRoot + 'org/groupadmin/search-groups'} />
|
2019-08-02 20:58:36 +08:00
|
|
|
<OrgGroupInfo path={siteRoot + 'org/groupadmin/:groupID/'} />
|
|
|
|
<OrgGroupRepos path={siteRoot + 'org/groupadmin/:groupID/repos/'} />
|
|
|
|
<OrgGroupMembers path={siteRoot + 'org/groupadmin/:groupID/members/'} />
|
2019-05-05 15:18:54 +08:00
|
|
|
<OrgLibraries path={siteRoot + 'org/repoadmin'}/>
|
|
|
|
<OrgLinks path={siteRoot + 'org/publinkadmin'}/>
|
|
|
|
<OrgDepartments path={siteRoot + 'org/departmentadmin'}>
|
|
|
|
<OrgDepartmentsList path='/'/>
|
|
|
|
<OrgDepartmentItem path='groups/:groupID'/>
|
2019-04-01 13:38:25 +08:00
|
|
|
</OrgDepartments>
|
2019-05-05 18:29:06 +08:00
|
|
|
<OrgLogs path={siteRoot + 'org/logadmin'} currentTab={currentTab} tabItemClick={this.tabItemClick}>
|
2019-08-06 14:59:49 +08:00
|
|
|
<OrgLogsFileAudit path='/' />
|
|
|
|
<OrgLogsFileUpdate path='file-update' />
|
|
|
|
<OrgLogsPermAudit path='perm-audit' />
|
2019-04-03 16:54:24 +08:00
|
|
|
</OrgLogs>
|
2022-12-26 09:56:51 +08:00
|
|
|
<OrgSAMLConfig path={siteRoot + 'org/samlconfig/'}/>
|
2019-02-27 19:44:22 +08:00
|
|
|
</Router>
|
2019-05-02 20:37:09 +08:00
|
|
|
</div>
|
2019-02-27 19:44:22 +08:00
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-12-29 12:21:47 +08:00
|
|
|
ReactDom.render(<Org />, document.getElementById('wrapper'));
|