Update dashboard cameras dynamically (#9100)

* Automatically update camera image when detecting objects and show activity indicators

* Update ws typing

* Cleanup type
This commit is contained in:
Nicolas Mowen
2023-12-29 07:08:00 -06:00
committed by Blake Blackshear
parent d430b99562
commit 928dbd8335
4 changed files with 191 additions and 17 deletions

34
web/src/types/ws.ts Normal file
View File

@@ -0,0 +1,34 @@
type FrigateObjectState = {
id: string;
camera: string;
frame_time: number;
snapshot_time: number;
label: string;
sub_label: string | null;
top_score: number;
false_positive: boolean;
start_time: number;
end_time: number | null;
score: number;
box: [number, number, number, number];
area: number;
ratio: number;
region: [number, number, number, number];
current_zones: string[];
entered_zones: string[];
thumbnail: string | null;
has_snapshot: boolean;
has_clip: boolean;
stationary: boolean;
motionless_count: number;
position_changes: number;
attributes: {
[key: string]: number;
};
};
export interface FrigateEvent {
type: "new" | "update" | "end";
before: FrigateObjectState;
after: FrigateObjectState;
}