Show statusbar with cpu and gpu stats (#9968)

* Show statusbar with cpu and gpu stats

* fix gif logic
This commit is contained in:
Nicolas Mowen
2024-02-21 19:27:02 -07:00
committed by GitHub
parent 33c77d03c7
commit 6626b8d758
8 changed files with 170 additions and 6 deletions

View File

@@ -11,6 +11,7 @@ import { produce, Draft } from "immer";
import useWebSocket, { ReadyState } from "react-use-websocket";
import { FrigateConfig } from "@/types/frigateConfig";
import { FrigateEvent, ToggleableSetting } from "@/types/ws";
import { FrigateStats } from "@/types/stats";
type ReducerState = {
[topic: string]: {
@@ -221,6 +222,13 @@ export function useFrigateEvents(): { payload: FrigateEvent } {
return { payload };
}
export function useFrigateStats(): { payload: FrigateStats } {
const {
value: { payload },
} = useWs("stats", "");
return { payload };
}
export function useMotionActivity(camera: string): { payload: string } {
const {
value: { payload },