mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 15:59:52 +03:00
fix NTP icons, add AP
This commit is contained in:
@@ -1,11 +1,12 @@
|
||||
import { Tab } from '@mui/material';
|
||||
import { useContext, type FC } from 'react';
|
||||
import { Navigate, Routes, Route } from 'react-router-dom';
|
||||
import SystemLog from './SystemLog';
|
||||
import SystemStatus from './SystemStatus';
|
||||
import type { FC } from 'react';
|
||||
|
||||
import { useRouterTab, RouterTabs, useLayoutTitle } from 'components';
|
||||
import { useRouterTab, RouterTabs, useLayoutTitle, RequireAdmin } from 'components';
|
||||
|
||||
import { AuthenticatedContext } from 'contexts/authentication';
|
||||
import { useI18nContext } from 'i18n/i18n-react';
|
||||
import SystemActivity from 'project/SystemActivity';
|
||||
|
||||
@@ -15,18 +16,26 @@ const System: FC = () => {
|
||||
useLayoutTitle(LL.SYSTEM(0));
|
||||
|
||||
const { routerTab } = useRouterTab();
|
||||
const { me } = useContext(AuthenticatedContext);
|
||||
|
||||
return (
|
||||
<>
|
||||
<RouterTabs value={routerTab}>
|
||||
<Tab value="status" label={LL.STATUS_OF('')} />
|
||||
<Tab value="activity" label={LL.ACTIVITY()} />
|
||||
<Tab value="log" label={LL.LOG_OF('')} />
|
||||
<Tab disabled={!me.admin} value="log" label={me.admin ? LL.LOG_OF('') : ''} />
|
||||
</RouterTabs>
|
||||
<Routes>
|
||||
<Route path="status" element={<SystemStatus />} />
|
||||
<Route path="activity" element={<SystemActivity />} />
|
||||
<Route path="log" element={<SystemLog />} />
|
||||
<Route
|
||||
path="log"
|
||||
element={
|
||||
<RequireAdmin>
|
||||
<SystemLog />
|
||||
</RequireAdmin>
|
||||
}
|
||||
/>
|
||||
<Route path="*" element={<Navigate replace to="status" />} />
|
||||
</Routes>
|
||||
</>
|
||||
|
||||
Reference in New Issue
Block a user