add uptime percentage to Hardware Monitors

This commit is contained in:
Alex Holliday committed 2024-11-30 16:50:31 +08:00
1 parent e5a1cd1294
commit 79d8d61944
1 file changed
+6 -2
+6 -2
View File
@@ -125,6 +125,8 @@ function Infrastructure() {
const { determineState } = useUtils(); const { determineState } = useUtils();
const { monitors, total: totalMonitors } = monitorState; const { monitors, total: totalMonitors } = monitorState;
console.log(monitors);
const monitorsAsRows = monitors.map((monitor) => { const monitorsAsRows = monitors.map((monitor) => {
const processor = const processor =
((monitor.checks[0]?.cpu?.usage_frequency ?? 0) / 1000).toFixed(2) + " GHz"; ((monitor.checks[0]?.cpu?.usage_frequency ?? 0) / 1000).toFixed(2) + " GHz";
@@ -224,7 +226,8 @@ function Infrastructure() {
</TableRow> </TableRow>
</TableHead> </TableHead>
<TableBody> <TableBody>
{monitorsAsRows.map((row) => ( {monitorsAsRows.map((row) => {
return (
<TableRow <TableRow
key={row.id} key={row.id}
onClick={() => openDetails(row.id)} onClick={() => openDetails(row.id)}
@@ -295,7 +298,8 @@ function Infrastructure() {
</IconButton> </IconButton>
</TableCell> </TableCell>
</TableRow> </TableRow>
))} );
})}
</TableBody> </TableBody>
</Table> </Table>
</TableContainer> </TableContainer>