+
Cameras
diff --git a/web-new/src/types/frigateConfig.ts b/web-new/src/types/frigateConfig.ts
index 50539759c..8b5aa8ab2 100644
--- a/web-new/src/types/frigateConfig.ts
+++ b/web-new/src/types/frigateConfig.ts
@@ -1,11 +1,11 @@
export interface UiConfig {
- timezone: string;
- time_format: "browser" | "12hour" | "24hour";
- date_style: "full" | "long" | "medium" | "short";
- time_style: "full" | "long" | "medium" | "short";
- strftime_fmt: string;
- live_mode: string;
- use_experimental: boolean;
+ timezone?: string;
+ time_format?: 'browser' | '12hour' | '24hour';
+ date_style?: 'full' | 'long' | 'medium' | 'short';
+ time_style?: 'full' | 'long' | 'medium' | 'short';
+ strftime_fmt?: string;
+ live_mode?: string;
+ use_experimental?: boolean;
}
export interface CameraConfig {
diff --git a/web-new/src/types/record.ts b/web-new/src/types/record.ts
new file mode 100644
index 000000000..20a98d886
--- /dev/null
+++ b/web-new/src/types/record.ts
@@ -0,0 +1,11 @@
+type Recording = {
+ id: string,
+ camera: string,
+ start_time: number,
+ end_time: number,
+ path: string,
+ segment_size: number,
+ motion: number,
+ objects: number,
+ dBFS: number,
+}
\ No newline at end of file
diff --git a/web-new/src/utils/dateUtil.ts b/web-new/src/utils/dateUtil.ts
index 2ea940ec2..464c4a342 100644
--- a/web-new/src/utils/dateUtil.ts
+++ b/web-new/src/utils/dateUtil.ts
@@ -143,8 +143,8 @@ export const formatUnixTimestampToDateTime = (unixTimestamp: number, config: UiC
// fallback if the browser does not support dateStyle/timeStyle in Intl.DateTimeFormat
// This works even tough the timezone is undefined, it will use the runtime's default time zone
if (!containsTime) {
- const dateOptions = { ...formatMap[date_style]?.date, timeZone: options.timeZone, hour12: options.hour12 };
- const timeOptions = { ...formatMap[time_style]?.time, timeZone: options.timeZone, hour12: options.hour12 };
+ const dateOptions = { ...formatMap[date_style ?? ""]?.date, timeZone: options.timeZone, hour12: options.hour12 };
+ const timeOptions = { ...formatMap[time_style ?? ""]?.time, timeZone: options.timeZone, hour12: options.hour12 };
return `${date.toLocaleDateString(locale, dateOptions)} ${date.toLocaleTimeString(locale, timeOptions)}`;
}
diff --git a/web-new/src/utils/timelineUtil.tsx b/web-new/src/utils/timelineUtil.tsx
new file mode 100644
index 000000000..f85be6ad8
--- /dev/null
+++ b/web-new/src/utils/timelineUtil.tsx
@@ -0,0 +1,80 @@
+import { LuCircle, LuPlay, LuPlayCircle, LuTruck } from "react-icons/lu";
+import { IoMdExit } from "react-icons/io";
+import {
+ MdFaceUnlock,
+ MdOutlineLocationOn,
+ MdOutlinePictureInPictureAlt,
+} from "react-icons/md";
+
+export function getTimelineIcon(timelineItem: Timeline) {
+ switch (timelineItem.class_type) {
+ case "visible":
+ return ;
+ case "gone":
+ return ;
+ case "active":
+ return ;
+ case "stationary":
+ return ;
+ case "entered_zone":
+ return ;
+ case "attribute":
+ switch (timelineItem.data.attribute) {
+ case "face":
+ return ;
+ case "license_plate":
+ return ;
+ default:
+ return ;
+ }
+ case "sub_label":
+ switch (timelineItem.data.label) {
+ case "person":
+ return ;
+ case "car":
+ return ;
+ }
+ }
+}
+
+export function getTimelineItemDescription(timelineItem: Timeline) {
+ const label = (
+ (Array.isArray(timelineItem.data.sub_label)
+ ? timelineItem.data.sub_label[0]
+ : timelineItem.data.sub_label) || timelineItem.data.label
+ ).replaceAll("_", " ");
+
+ switch (timelineItem.class_type) {
+ case "visible":
+ return `${label} detected`;
+ case "entered_zone":
+ return `${label} entered ${timelineItem.data.zones
+ .join(" and ")
+ .replaceAll("_", " ")}`;
+ case "active":
+ return `${label} became active`;
+ case "stationary":
+ return `${label} became stationary`;
+ case "attribute": {
+ let title = "";
+ if (
+ timelineItem.data.attribute == "face" ||
+ timelineItem.data.attribute == "license_plate"
+ ) {
+ title = `${timelineItem.data.attribute.replaceAll(
+ "_",
+ " "
+ )} detected for ${label}`;
+ } else {
+ title = `${
+ timelineItem.data.sub_label
+ } recognized as ${timelineItem.data.attribute.replaceAll("_", " ")}`;
+ }
+ return title;
+ }
+ case "sub_label":
+ return `${timelineItem.data.label} recognized as ${timelineItem.data.sub_label}`;
+ case "gone":
+ return `${label} left`;
+ }
+}