🐛 Fixing bugs in system info

This commit is contained in:
ajnart
2022-05-31 20:22:53 +02:00
parent 8da0b38662
commit 64b1679b03

View File

@@ -40,23 +40,22 @@ export default function SystemInfo(args: any) {
}, 1000); }, 1000);
}, [args]); }, [args]);
// Update data every time data changes // Update data every time data changes
const [cpuLoadHistory, cpuLoadHistoryHandlers] = const [cpuLoadHistory, cpuLoadHistoryHandlers] =
useListState<si.Systeminformation.CurrentLoadData>([]); useListState<si.Systeminformation.CurrentLoadData>([]);
// useEffect(() => { // useEffect(() => {
// }, [data]); // }, [data]);
const theme = useMantineTheme(); const theme = useMantineTheme();
const currentLoad = data?.load?.currentLoad ?? 0; const currentLoad = data?.load?.currentLoad ?? 0;
return ( return (
<Center> <Center>
<Group p="sm" direction="column" align="center"> <Group p="sm" direction="column" align="center">
<Title order={3}>Current CPU load</Title> <Title order={3}>Current CPU load</Title>
<ResponsiveLine {/* <ResponsiveLine
isInteractive isInteractive
enableSlices="x" enableSlices="x"
sliceTooltip={({ slice }) => { sliceTooltip={({ slice }) => {
@@ -108,7 +107,7 @@ export default function SystemInfo(args: any) {
// Green // Green
theme.colors.green[5], theme.colors.green[5],
]} ]}
/> /> */}
<RingProgress <RingProgress
size={120} size={120}
label={<Center>{`${(currentLoad * 100).toFixed(2)}%`}</Center>} label={<Center>{`${(currentLoad * 100).toFixed(2)}%`}</Center>}