Ready to build sysinfo route screen

This commit is contained in:
2023-09-08 09:45:41 +02:00
parent bd5ea1fb23
commit f14e8a8e58
7 changed files with 236 additions and 4 deletions

View File

@ -0,0 +1,26 @@
import React from "react";
import { ServerApi, ServerSystemInfo } from "../api/ServerApi";
import { AsyncWidget } from "../widgets/AsyncWidget";
export function SysInfoRoute(): React.ReactElement {
const [info, setInfo] = React.useState<ServerSystemInfo>();
const load = async () => {
setInfo(await ServerApi.SystemInfo());
};
return (
<AsyncWidget
load={load}
loadKey={1}
build={() => <SysInfoRouteInner info={info!} />}
errMsg="Failed to load system info"
/>
);
}
export function SysInfoRouteInner(p: {
info: ServerSystemInfo;
}): React.ReactElement {
return <>todo</>;
}