formatting

This commit is contained in:
proddy
2024-12-31 13:05:59 +01:00
parent a4db3ef5c4
commit 83724e3d44
3 changed files with 23 additions and 14 deletions

View File

@@ -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>

View File

@@ -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>
</>
);

View File

@@ -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();
}