Improve efficiency of log and metrics pages (#11622)

* Rework stats pages

* Handle limited data case

* Handle page and arrow keys

* Adjust sizing
This commit is contained in:
Nicolas Mowen
2024-05-29 12:05:39 -06:00
committed by GitHub
parent f1c0422d5e
commit 9245c5cb56
9 changed files with 523 additions and 423 deletions

View File

@@ -12,8 +12,8 @@ import {
} from "@/types/graph";
import { Button } from "@/components/ui/button";
import VainfoDialog from "@/components/overlay/VainfoDialog";
import { ThresholdBarGraph } from "@/components/graph/SystemGraph";
import { Skeleton } from "@/components/ui/skeleton";
import { ThresholdBarGraph } from "@/components/graph/SystemGraph";
type GeneralMetricsProps = {
lastUpdated: number;
@@ -57,7 +57,7 @@ export default function GeneralMetrics({
}
if (updatedStats.service.last_updated > lastUpdated) {
setStatsHistory([...statsHistory, updatedStats]);
setStatsHistory([...statsHistory.slice(1), updatedStats]);
setLastUpdated(Date.now() / 1000);
}
}, [initialStats, updatedStats, statsHistory, lastUpdated, setLastUpdated]);