NVR with realtime local object detection for IP cameras
TypeScript aicameragoogle-coralhome-assistanthome-automationhomeautomationmqttnvrobject-detectionrealtimertsptensorflow
UI tweaks and bugfixes (#10882)
Josh Hawkinsf210c4b6f4f4
diff --git a/web/src/components/Statusbar.tsx b/web/src/components/Statusbar.tsxindex a210db508e..1100ba3aee 100644--- a/web/src/components/Statusbar.tsx+++ b/web/src/components/Statusbar.tsx@@ -32,7 +32,7 @@ export default function Statusbar() {const { potentialProblems } = useStats(stats);return (- <div className="absolute left-0 bottom-0 right-0 w-full h-8 flex justify-between items-center px-4 bg-primary z-10 text-secondary-foreground border-t border-secondary-highlight">+ <div className="absolute left-0 bottom-0 right-0 w-full h-8 flex justify-between items-center px-4 bg-primary z-10 dark:text-secondary-foreground border-t border-secondary-highlight"><div className="h-full flex items-center gap-2">{cpuPercent && (<div className="flex items-center text-sm gap-2">diff --git a/web/src/components/filter/ReviewFilterGroup.tsx b/web/src/components/filter/ReviewFilterGroup.tsxindex 91e390847d..5baece1f9b 100644--- a/web/src/components/filter/ReviewFilterGroup.tsx+++ b/web/src/components/filter/ReviewFilterGroup.tsx@@ -75,6 +75,9 @@ export default function ReviewFilterGroup({const cameras = filter?.cameras || Object.keys(config.cameras);cameras.forEach((camera) => {+ if (camera == "birdseye") {+ return;+ }const cameraConfig = config.cameras[camera];cameraConfig.objects.track.forEach((label) => {labels.add(label);@@ -219,24 +222,30 @@ function CamerasFilterButton({const trigger = (<Button- className="flex items-center gap-2 capitalize"+ className={`flex items-center gap-2 capitalize ${selectedCameras?.length ? "bg-selected hover:bg-selected" : ""}`}variant="secondary"size="sm">- <FaVideo className="text-secondary-foreground" />+ <FaVideo+ className={`${selectedCameras?.length ? "text-primary dark:text-primary-foreground" : "text-secondary-foreground"}`}+ /><div className="hidden md:block text-primary-foreground">{selectedCameras == undefined? "All Cameras"- : `${selectedCameras.length} Cameras`}+ : `${selectedCameras.includes("birdseye") ? selectedCameras.length - 1 : selectedCameras.length} Camera${selectedCameras.length !== 1 ? "s" : ""}`}</div></Button>);const content = (<>- <DropdownMenuLabel className="flex justify-center">- Filter Cameras- </DropdownMenuLabel>- <DropdownMenuSeparator />+ {isMobile && (+ <>+ <DropdownMenuLabel className="flex justify-center">+ Cameras+ </DropdownMenuLabel>+ <DropdownMenuSeparator />+ </>+ )}<div className="h-auto overflow-y-auto overflow-x-hidden"><FilterCheckBoxisChecked={currentCameras == undefined}@@ -382,13 +391,13 @@ function ShowReviewFilter({</div><Button- className="block md:hidden"+ className={`block md:hidden ${showReviewedSwitch == 0 ? "bg-selected hover:bg-selected" : "bg-secondary hover:bg-secondary/80"}`}size="sm"variant="secondary"onClick={() => setShowReviewedSwitch(showReviewedSwitch == 0 ? 1 : 0)}><FaCheckCircle- className={`${showReviewedSwitch == 1 ? "text-selected" : "text-muted-foreground"}`}+ className={`${showReviewedSwitch == 0 ? "fill-primary-foreground" : "text-muted-foreground"}`}/></Button></>@@ -664,10 +673,11 @@ function ShowMotionOnlyButton({<Buttonsize="sm"variant="secondary"+ className={`${motionOnlyButton ? "bg-selected hover:bg-selected" : "bg-secondary hover:bg-secondary/80"}`}onClick={() => setMotionOnlyButton(!motionOnlyButton)}><FaRunning- className={`${motionOnlyButton ? "text-selected" : "text-muted-foreground"}`}+ className={`${motionOnlyButton ? "fill-primary-foreground" : "text-muted-foreground"}`}/></Button></div>diff --git a/web/src/components/player/PreviewPlayer.tsx b/web/src/components/player/PreviewPlayer.tsxindex 0237fa7064..11ef78c1b1 100644--- a/web/src/components/player/PreviewPlayer.tsx+++ b/web/src/components/player/PreviewPlayer.tsx@@ -235,7 +235,7 @@ function PreviewVideoPlayer({return (<div- className={`relative rounded-2xl bg-black overflow-hidden ${onClick ? "cursor-pointer" : ""} ${className ?? ""}`}+ className={`relative rounded-2xl w-full flex justify-center bg-black overflow-hidden ${onClick ? "cursor-pointer" : ""} ${className ?? ""}`}onClick={onClick}><img@@ -464,7 +464,7 @@ function PreviewFramesPlayer({return (<div- className={`relative ${className ?? ""} ${onClick ? "cursor-pointer" : ""}`}+ className={`relative w-full flex justify-center ${className ?? ""} ${onClick ? "cursor-pointer" : ""}`}onClick={onClick}><imgdiff --git a/web/src/components/player/VideoControls.tsx b/web/src/components/player/VideoControls.tsxindex b4221c64b9..8c65ef3553 100644--- a/web/src/components/player/VideoControls.tsx+++ b/web/src/components/player/VideoControls.tsx@@ -142,7 +142,7 @@ export default function VideoControls({return (<div- className={`px-4 py-2 flex justify-between items-center gap-8 text-white z-50 bg-secondary-foreground/60 dark:bg-secondary/60 rounded-lg ${className ?? ""}`}+ className={`px-4 py-2 flex justify-between items-center gap-8 text-primary-foreground dark:text-white z-50 bg-secondary-foreground/60 dark:bg-secondary/60 rounded-lg ${className ?? ""}`}>{video && features.volume && (<div className="flex justify-normal items-center gap-2">@@ -170,9 +170,9 @@ export default function VideoControls({)}<div className="cursor-pointer" onClick={onTogglePlay}>{isPlaying ? (- <LuPause className="size-5 fill-white" />+ <LuPause className="size-5 fill-primary-foreground dark:fill-white" />) : (- <LuPlay className="size-5 fill-white" />+ <LuPlay className="size-5 fill-primary-foreground dark:fill-white" />)}</div>{features.seek && (diff --git a/web/src/views/events/EventView.tsx b/web/src/views/events/EventView.tsxindex 657d0c7457..def4aa972a 100644--- a/web/src/views/events/EventView.tsx+++ b/web/src/views/events/EventView.tsx@@ -853,7 +853,10 @@ function MotionReview({onClick={() =>onOpenRecording({camera: camera.name,- startTime: currentTime,+ startTime: Math.min(+ currentTime,+ Date.now() / 1000 - 30,+ ),severity: "significant_motion",})}diff --git a/web/src/views/events/RecordingView.tsx b/web/src/views/events/RecordingView.tsxindex a55c7a0999..8283701df3 100644--- a/web/src/views/events/RecordingView.tsx+++ b/web/src/views/events/RecordingView.tsx@@ -38,6 +38,7 @@ import MobileCameraDrawer from "@/components/overlay/MobileCameraDrawer";import MobileTimelineDrawer from "@/components/overlay/MobileTimelineDrawer";import MobileReviewSettingsDrawer from "@/components/overlay/MobileReviewSettingsDrawer";import Logo from "@/components/Logo";+import { Skeleton } from "@/components/ui/skeleton";const SEGMENT_DURATION = 30;@@ -503,26 +504,30 @@ function Timeline({<div className="absolute top-0 inset-x-0 z-20 w-full h-[30px] bg-gradient-to-b from-secondary to-transparent pointer-events-none"></div><div className="absolute bottom-0 inset-x-0 z-20 w-full h-[30px] bg-gradient-to-t from-secondary to-transparent pointer-events-none"></div>{timelineType == "timeline" ? (- <MotionReviewTimeline- segmentDuration={30}- timestampSpread={15}- timelineStart={timeRange.before}- timelineEnd={timeRange.after}- showHandlebar={exportRange == undefined}- showExportHandles={exportRange != undefined}- exportStartTime={exportRange?.after}- exportEndTime={exportRange?.before}- setExportStartTime={setExportStartTime}- setExportEndTime={setExportEndTime}- handlebarTime={currentTime}- setHandlebarTime={setCurrentTime}- onlyInitialHandlebarScroll={true}- events={mainCameraReviewItems}- motion_events={motionData ?? []}- severityType="significant_motion"- contentRef={contentRef}- onHandlebarDraggingChange={(scrubbing) => setScrubbing(scrubbing)}- />+ motionData ? (+ <MotionReviewTimeline+ segmentDuration={30}+ timestampSpread={15}+ timelineStart={timeRange.before}+ timelineEnd={timeRange.after}+ showHandlebar={exportRange == undefined}+ showExportHandles={exportRange != undefined}+ exportStartTime={exportRange?.after}+ exportEndTime={exportRange?.before}+ setExportStartTime={setExportStartTime}+ setExportEndTime={setExportEndTime}+ handlebarTime={currentTime}+ setHandlebarTime={setCurrentTime}+ onlyInitialHandlebarScroll={true}+ events={mainCameraReviewItems}+ motion_events={motionData ?? []}+ severityType="significant_motion"+ contentRef={contentRef}+ onHandlebarDraggingChange={(scrubbing) => setScrubbing(scrubbing)}+ />+ ) : (+ <Skeleton className="size-full" />+ )) : (<divclassName={`h-full grid grid-cols-1 gap-4 overflow-auto p-4 bg-secondary ${isDesktop ? "" : "sm:grid-cols-2"}`}diff --git a/web/themes/theme-default.css b/web/themes/theme-default.cssindex 66e64fab7a..38d02688a7 100644--- a/web/themes/theme-default.css+++ b/web/themes/theme-default.css@@ -27,8 +27,8 @@--secondary: hsl(0, 0%, 96%);--secondary: 0 0% 96%;- --secondary-foreground: hsl(0, 0%, 83%);- --secondary-foreground: 0 0% 83%;+ --secondary-foreground: hsl(0, 0%, 70%);+ --secondary-foreground: 0 0% 70%;--secondary-highlight: hsl(0, 0%, 94%);--secondary-highlight: 0 0% 94%;@@ -64,7 +64,7 @@--input: 0 0% 85%;--ring: hsla(0 0% 25% 0%);- --ring: 0 0% 25% 0%+ --ring: 0 0% 25% 0%;--selected: hsl(228, 89%, 63%);--selected: 228 89% 63%;@@ -155,7 +155,7 @@--input: 0 0% 25%;--ring: hsla(0 0% 25% 0%);- --ring: 0 0% 25% 0%+ --ring: 0 0% 25% 0%;--selected: hsl(228, 89%, 63%);--selected: 228 89% 63%;