Skip to content

NVR with realtime local object detection for IP cameras

UI Fixes (#13703)

Nicolas Mowen87ab4e7c9b6d
diff --git a/web/src/components/card/AnimatedEventCard.tsx b/web/src/components/card/AnimatedEventCard.tsx
index 1228ebd05e..8ee4acdcfb 100644
--- a/web/src/components/card/AnimatedEventCard.tsx
+++ b/web/src/components/card/AnimatedEventCard.tsx
@@ -91,13 +91,17 @@ export function AnimatedEventCard({
const [alertVideos] = usePersistence("alertVideos", true);
const aspectRatio = useMemo(() => {
- if (!config || !Object.keys(config.cameras).includes(event.camera)) {
+ if (
+ !config ||
+ !alertVideos ||
+ !Object.keys(config.cameras).includes(event.camera)
+ ) {
return 16 / 9;
}
const detect = config.cameras[event.camera].detect;
return detect.width / detect.height;
- }, [config, event]);
+ }, [alertVideos, config, event]);
return (
<Tooltip>
diff --git a/web/src/components/card/ReviewCard.tsx b/web/src/components/card/ReviewCard.tsx
index 359dd6536d..a28b897833 100644
--- a/web/src/components/card/ReviewCard.tsx
+++ b/web/src/components/card/ReviewCard.tsx
@@ -50,6 +50,7 @@ export default function ReviewCard({
const formattedDate = useFormattedTimestamp(
event.start_time,
config?.ui.time_format == "24hour" ? "%H:%M" : "%I:%M %p",
+ config?.ui.timezone,
);
const isSelected = useMemo(
() =>
diff --git a/web/src/components/card/SearchThumbnail.tsx b/web/src/components/card/SearchThumbnail.tsx
index 3f9a4a6a51..385d5ebd49 100644
--- a/web/src/components/card/SearchThumbnail.tsx
+++ b/web/src/components/card/SearchThumbnail.tsx
@@ -42,6 +42,7 @@ export default function SearchThumbnail({
const formattedDate = useFormattedTimestamp(
searchResult.start_time,
config?.ui.time_format == "24hour" ? "%b %-d, %H:%M" : "%b %-d, %I:%M %p",
+ config?.ui.timezone,
);
return (
diff --git a/web/src/components/overlay/detail/ReviewDetailDialog.tsx b/web/src/components/overlay/detail/ReviewDetailDialog.tsx
index 0bfae33bc4..87d84d5c98 100644
--- a/web/src/components/overlay/detail/ReviewDetailDialog.tsx
+++ b/web/src/components/overlay/detail/ReviewDetailDialog.tsx
@@ -73,6 +73,7 @@ export default function ReviewDetailDialog({
config?.ui.time_format == "24hour"
? "%b %-d %Y, %H:%M"
: "%b %-d %Y, %I:%M %p",
+ config?.ui.timezone,
);
// content
diff --git a/web/src/components/overlay/detail/SearchDetailDialog.tsx b/web/src/components/overlay/detail/SearchDetailDialog.tsx
index 02c099b29b..41dfbd3329 100644
--- a/web/src/components/overlay/detail/SearchDetailDialog.tsx
+++ b/web/src/components/overlay/detail/SearchDetailDialog.tsx
@@ -227,6 +227,7 @@ function ObjectDetailsTab({
config?.ui.time_format == "24hour"
? "%b %-d %Y, %H:%M"
: "%b %-d %Y, %I:%M %p",
+ config?.ui.timezone,
);
const score = useMemo(() => {
diff --git a/web/src/components/player/PreviewThumbnailPlayer.tsx b/web/src/components/player/PreviewThumbnailPlayer.tsx
index d20ad1ec75..69a6ac6dfc 100644
--- a/web/src/components/player/PreviewThumbnailPlayer.tsx
+++ b/web/src/components/player/PreviewThumbnailPlayer.tsx
@@ -168,6 +168,7 @@ export default function PreviewThumbnailPlayer({
const formattedDate = useFormattedTimestamp(
review.start_time,
config?.ui.time_format == "24hour" ? "%b %-d, %H:%M" : "%b %-d, %I:%M %p",
+ config?.ui?.timezone,
);
return (
diff --git a/web/src/hooks/use-date-utils.ts b/web/src/hooks/use-date-utils.ts
index c234cadd46..00f523920f 100644
--- a/web/src/hooks/use-date-utils.ts
+++ b/web/src/hooks/use-date-utils.ts
@@ -2,12 +2,17 @@ import { FrigateConfig } from "@/types/frigateConfig";
import { formatUnixTimestampToDateTime } from "@/utils/dateUtil";
import { useMemo } from "react";
-export function useFormattedTimestamp(timestamp: number, format: string) {
+export function useFormattedTimestamp(
+ timestamp: number,
+ format: string,
+ timezone?: string,
+) {
const formattedTimestamp = useMemo(() => {
return formatUnixTimestampToDateTime(timestamp, {
+ timezone,
strftime_fmt: format,
});
- }, [format, timestamp]);
+ }, [format, timestamp, timezone]);
return formattedTimestamp;
}