mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 07:49:52 +03:00
formatting
This commit is contained in:
@@ -24,10 +24,17 @@ const Network = () => {
|
|||||||
|
|
||||||
// this also works!
|
// this also works!
|
||||||
// const routerTab = useMatch(`settings/network/:path/*`)?.pathname || false;
|
// const routerTab = useMatch(`settings/network/:path/*`)?.pathname || false;
|
||||||
const matchedRoutes = matchRoutes( [
|
const matchedRoutes = matchRoutes(
|
||||||
{ path: '/settings/network/settings', element: <NetworkSettings />, dog: 'woof' },
|
[
|
||||||
{ path: '/settings/network/scan', element: <WiFiNetworkScanner /> }
|
{
|
||||||
], useLocation());
|
path: '/settings/network/settings',
|
||||||
|
element: <NetworkSettings />,
|
||||||
|
dog: 'woof'
|
||||||
|
},
|
||||||
|
{ path: '/settings/network/scan', element: <WiFiNetworkScanner /> }
|
||||||
|
],
|
||||||
|
useLocation()
|
||||||
|
);
|
||||||
const routerTab = matchedRoutes?.[0].route.path || false;
|
const routerTab = matchedRoutes?.[0].route.path || false;
|
||||||
|
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
@@ -55,7 +62,10 @@ const Network = () => {
|
|||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<RouterTabs value={routerTab}>
|
<RouterTabs value={routerTab}>
|
||||||
<Tab value="/settings/network/settings" label={LL.SETTINGS_OF(LL.NETWORK(1))} />
|
<Tab
|
||||||
|
value="/settings/network/settings"
|
||||||
|
label={LL.SETTINGS_OF(LL.NETWORK(1))}
|
||||||
|
/>
|
||||||
<Tab value="/settings/network/scan" label={LL.NETWORK_SCAN()} />
|
<Tab value="/settings/network/scan" label={LL.NETWORK_SCAN()} />
|
||||||
</RouterTabs>
|
</RouterTabs>
|
||||||
<Routes>
|
<Routes>
|
||||||
|
|||||||
@@ -1,10 +1,4 @@
|
|||||||
import {
|
import { Navigate, Route, Routes, matchRoutes, useLocation } from 'react-router';
|
||||||
Navigate,
|
|
||||||
Route,
|
|
||||||
Routes,
|
|
||||||
matchRoutes,
|
|
||||||
useLocation
|
|
||||||
} from 'react-router';
|
|
||||||
|
|
||||||
import { Tab } from '@mui/material';
|
import { Tab } from '@mui/material';
|
||||||
|
|
||||||
@@ -39,7 +33,10 @@ const Security = () => {
|
|||||||
<Routes>
|
<Routes>
|
||||||
<Route path="users" element={<ManageUsers />} />
|
<Route path="users" element={<ManageUsers />} />
|
||||||
<Route path="settings" element={<SecuritySettings />} />
|
<Route path="settings" element={<SecuritySettings />} />
|
||||||
<Route path="*" element={<Navigate replace to="/settings/security/settings" />} />
|
<Route
|
||||||
|
path="*"
|
||||||
|
element={<Navigate replace to="/settings/security/settings" />}
|
||||||
|
/>
|
||||||
</Routes>
|
</Routes>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -139,7 +139,9 @@ const SystemStatus = () => {
|
|||||||
case NTPSyncStatus.NTP_INACTIVE:
|
case NTPSyncStatus.NTP_INACTIVE:
|
||||||
return LL.INACTIVE(0);
|
return LL.INACTIVE(0);
|
||||||
case NTPSyncStatus.NTP_ACTIVE:
|
case NTPSyncStatus.NTP_ACTIVE:
|
||||||
return LL.ACTIVE() + (data.ntp_time !== undefined) ? ' (' + formatDateTime(data.ntp_time) + ')' : '';
|
return LL.ACTIVE() + (data.ntp_time !== undefined)
|
||||||
|
? ' (' + formatDateTime(data.ntp_time) + ')'
|
||||||
|
: '';
|
||||||
default:
|
default:
|
||||||
return LL.UNKNOWN();
|
return LL.UNKNOWN();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user