From f91dc37399946a927f5a1ad5d74a00e418984711 Mon Sep 17 00:00:00 2001 From: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com> Date: Sun, 24 Mar 2024 07:54:34 -0500 Subject: [PATCH] Add outline for alerts/detections in motion review (#10642) --- web/src/components/player/LivePlayer.tsx | 2 +- web/src/components/timeline/EventSegment.tsx | 56 ++++++++++---------- web/src/views/events/EventView.tsx | 26 +++++++-- 3 files changed, 51 insertions(+), 33 deletions(-) diff --git a/web/src/components/player/LivePlayer.tsx b/web/src/components/player/LivePlayer.tsx index a511bcb5d..8be3f71b9 100644 --- a/web/src/components/player/LivePlayer.tsx +++ b/web/src/components/player/LivePlayer.tsx @@ -142,7 +142,7 @@ export default function LivePlayer({
{ - element.classList.remove("outline-4", "shadow-[0_0_6px_1px]"); - element.classList.add("outline-0", "shadow-none"); + element.classList.remove("outline-3"); + element.classList.add("outline-0"); }, 3000); } @@ -226,36 +226,36 @@ export function EventSegment({ {severity.map((severityValue: number, index: number) => ( {severityValue === displaySeverityType && ( -
-
-
- -
- + + +
+
+
+
- - - - - - +
- +
-
-
+ + + + + + + )} ))} diff --git a/web/src/views/events/EventView.tsx b/web/src/views/events/EventView.tsx index 353760ff7..141766a29 100644 --- a/web/src/views/events/EventView.tsx +++ b/web/src/views/events/EventView.tsx @@ -519,7 +519,7 @@ function DetectionReview({ )}
{currentItems && @@ -534,7 +534,7 @@ function DetectionReview({ data-segment-start={ alignStartDateToTimeline(value.start_time) - segmentDuration } - className={`review-item outline outline-offset-1 rounded-lg shadow-none transition-all my-1 md:my-0 ${selected ? `outline-4 shadow-[0_0_6px_1px] outline-severity_${value.severity} shadow-severity_${value.severity}` : "outline-0 duration-500"}`} + className={`review-item outline outline-offset-1 rounded-lg shadow-none transition-all my-1 md:my-0 ${selected ? `outline-3 outline-severity_${value.severity} shadow-severity_${value.severity}` : "outline-0 duration-500"}`} >
{ + if (motionOnly) { + return null; + } + const matchingItem = reviewItems?.all.find( + (item) => + currentTime >= item.start_time && + currentTime <= item.end_time && + item.camera === cameraName, + ); + + return matchingItem ? matchingItem.severity : null; + }, + [reviewItems, currentTime, motionOnly], + ); + if (!relevantPreviews) { return ; } @@ -767,7 +784,7 @@ function MotionReview({
{reviewCameras.map((camera) => { let grow; @@ -779,10 +796,11 @@ function MotionReview({ } else { grow = "aspect-video"; } + const detectionType = getDetectionType(camera.name); return (