show ntp time in status, use useInterval everywhere instead of alova's AutoRequest

This commit is contained in:
proddy
2024-12-21 16:30:05 +01:00
parent 6d22f6aebf
commit b0c29b57c7
17 changed files with 80 additions and 63 deletions

View File

@@ -17,9 +17,10 @@ import {
import * as SystemApi from 'api/system';
import { useAutoRequest } from 'alova/client';
import { useRequest } from 'alova/client';
import { FormLoader, SectionContent, useLayoutTitle } from 'components';
import { useI18nContext } from 'i18n/i18n-react';
import { useInterval } from 'utils';
import BBQKeesIcon from './bbqkees.svg';
@@ -32,11 +33,11 @@ const HardwareStatus = () => {
useLayoutTitle(LL.HARDWARE());
const {
data,
send: loadData,
error
} = useAutoRequest(SystemApi.readSystemStatus, { pollingTime: 3000 });
const { data, send: loadData, error } = useRequest(SystemApi.readSystemStatus);
useInterval(() => {
void loadData();
});
const content = () => {
if (!data) {