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
+2 -2
View File
@@ -1,5 +1,5 @@
import { useFrigateStats } from "@/api/ws";
import { CameraLineGraph } from "@/components/graph/SystemGraph";
import { CameraLineGraph } from "@/components/graph/CameraGraph";
import { Skeleton } from "@/components/ui/skeleton";
import { FrigateConfig } from "@/types/frigateConfig";
import { FrigateStats } from "@/types/stats";
@@ -43,7 +43,7 @@ export default function CameraMetrics({
}
if (updatedStats.service.last_updated > lastUpdated) {
setStatsHistory([...statsHistory, updatedStats]);
setStatsHistory([...statsHistory.slice(1), updatedStats]);
setLastUpdated(Date.now() / 1000);
}
}, [initialStats, updatedStats, statsHistory, lastUpdated, setLastUpdated]);