mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 07:49:52 +03:00
upgrade alova to v3
This commit is contained in:
@@ -34,7 +34,7 @@ import {
|
||||
import * as SystemApi from 'api/system';
|
||||
|
||||
import { dialogStyle } from 'CustomTheme';
|
||||
import { useRequest } from 'alova';
|
||||
import { useRequest } from 'alova/client';
|
||||
import { busConnectionStatus } from 'app/main/types';
|
||||
import { FormLoader, SectionContent, useLayoutTitle } from 'components';
|
||||
import ListMenuItem from 'components/layout/ListMenuItem';
|
||||
@@ -67,9 +67,11 @@ const SystemStatus: FC = () => {
|
||||
|
||||
const {
|
||||
data: data,
|
||||
send: loadData,
|
||||
error
|
||||
} = useRequest(SystemApi.readSystemStatus, { force: true });
|
||||
loading,
|
||||
send: loadData
|
||||
} = useRequest(SystemApi.readSystemStatus, {
|
||||
initialData: []
|
||||
});
|
||||
|
||||
const theme = useTheme();
|
||||
|
||||
@@ -270,8 +272,12 @@ const SystemStatus: FC = () => {
|
||||
);
|
||||
|
||||
const content = () => {
|
||||
if (!data) {
|
||||
return <FormLoader onRetry={loadData} errorMessage={error?.message} />;
|
||||
// if (!data) {
|
||||
// return <FormLoader onRetry={loadData} errorMessage={error?.message} />;
|
||||
// }
|
||||
|
||||
if (loading) {
|
||||
return <>fddfdd</>;
|
||||
}
|
||||
|
||||
return (
|
||||
@@ -405,9 +411,7 @@ const SystemStatus: FC = () => {
|
||||
);
|
||||
};
|
||||
|
||||
return (
|
||||
<SectionContent>{restarting ? <RestartMonitor /> : content()}</SectionContent>
|
||||
);
|
||||
return <SectionContent>{content()}</SectionContent>;
|
||||
};
|
||||
|
||||
export default SystemStatus;
|
||||
|
||||
Reference in New Issue
Block a user