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!
|
||||
// const routerTab = useMatch(`settings/network/:path/*`)?.pathname || false;
|
||||
const matchedRoutes = matchRoutes( [
|
||||
{ path: '/settings/network/settings', element: <NetworkSettings />, dog: 'woof' },
|
||||
{ path: '/settings/network/scan', element: <WiFiNetworkScanner /> }
|
||||
], useLocation());
|
||||
const matchedRoutes = matchRoutes(
|
||||
[
|
||||
{
|
||||
path: '/settings/network/settings',
|
||||
element: <NetworkSettings />,
|
||||
dog: 'woof'
|
||||
},
|
||||
{ path: '/settings/network/scan', element: <WiFiNetworkScanner /> }
|
||||
],
|
||||
useLocation()
|
||||
);
|
||||
const routerTab = matchedRoutes?.[0].route.path || false;
|
||||
|
||||
const navigate = useNavigate();
|
||||
@@ -55,7 +62,10 @@ const Network = () => {
|
||||
}}
|
||||
>
|
||||
<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()} />
|
||||
</RouterTabs>
|
||||
<Routes>
|
||||
|
||||
@@ -1,10 +1,4 @@
|
||||
import {
|
||||
Navigate,
|
||||
Route,
|
||||
Routes,
|
||||
matchRoutes,
|
||||
useLocation
|
||||
} from 'react-router';
|
||||
import { Navigate, Route, Routes, matchRoutes, useLocation } from 'react-router';
|
||||
|
||||
import { Tab } from '@mui/material';
|
||||
|
||||
@@ -39,7 +33,10 @@ const Security = () => {
|
||||
<Routes>
|
||||
<Route path="users" element={<ManageUsers />} />
|
||||
<Route path="settings" element={<SecuritySettings />} />
|
||||
<Route path="*" element={<Navigate replace to="/settings/security/settings" />} />
|
||||
<Route
|
||||
path="*"
|
||||
element={<Navigate replace to="/settings/security/settings" />}
|
||||
/>
|
||||
</Routes>
|
||||
</>
|
||||
);
|
||||
|
||||
@@ -139,7 +139,9 @@ const SystemStatus = () => {
|
||||
case NTPSyncStatus.NTP_INACTIVE:
|
||||
return LL.INACTIVE(0);
|
||||
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:
|
||||
return LL.UNKNOWN();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user