Ready to build sysinfo route screen
This commit is contained in:
26
virtweb_frontend/src/routes/SysInfoRoute.tsx
Normal file
26
virtweb_frontend/src/routes/SysInfoRoute.tsx
Normal 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</>;
|
||||
}
|
Reference in New Issue
Block a user