NVR with realtime local object detection for IP cameras
TypeScript aicameragoogle-coralhome-assistanthome-automationhomeautomationmqttnvrobject-detectionrealtimertsptensorflow
Empty cameras view (#20434)
Nicolas Mowen78d487045b99
diff --git a/frigate/config/config.py b/frigate/config/config.pyindex 23f77aa9d8..7ce9c73b4c 100644--- a/frigate/config/config.py+++ b/frigate/config/config.py@@ -80,18 +80,7 @@ DEFAULT_CONFIG = """mqtt:enabled: False-cameras:- name_of_your_camera: # <------ Name the camera- enabled: True- ffmpeg:- inputs:- - path: rtsp://10.0.10.10:554/rtsp # <----- The stream you want to use for detection- roles:- - detect- detect:- enabled: False # <---- disable detection until you have a working camera feed- width: 1280- height: 720+cameras: {} # No cameras defined, UI wizard should be used"""DEFAULT_DETECTORS = {"cpu": {"type": "cpu"}}diff --git a/web/public/locales/en/views/live.json b/web/public/locales/en/views/live.jsonindex 356c896aef..92c4cfbd86 100644--- a/web/public/locales/en/views/live.json+++ b/web/public/locales/en/views/live.json@@ -168,5 +168,10 @@"label": "Edit Camera Group"},"exitEdit": "Exit Editing"+ },+ "noCameras": {+ "title": "No Cameras Set Up",+ "description": "Get started by connecting a camera.",+ "buttonText": "Add Camera"}}diff --git a/web/src/components/card/EmptyCard.tsx b/web/src/components/card/EmptyCard.tsxnew file mode 100644index 0000000000..671262994b--- /dev/null+++ b/web/src/components/card/EmptyCard.tsx@@ -0,0 +1,29 @@+import React from "react";+import { Button } from "../ui/button";+import Heading from "../ui/heading";++type EmptyCardProps = {+ icon: React.ReactNode;+ title: string;+ description: string;+ buttonText?: string;+};+export function EmptyCard({+ icon,+ title,+ description,+ buttonText,+}: EmptyCardProps) {+ return (+ <div className="flex flex-col items-center gap-2">+ {icon}+ <Heading as="h4">{title}</Heading>+ <div className="text-secondary-foreground">{description}</div>+ {buttonText?.length && (+ <Button size="sm" variant="select">+ {buttonText}+ </Button>+ )}+ </div>+ );+}diff --git a/web/src/views/live/LiveDashboardView.tsx b/web/src/views/live/LiveDashboardView.tsxindex 69f4c0d535..1df5daa67f 100644--- a/web/src/views/live/LiveDashboardView.tsx+++ b/web/src/views/live/LiveDashboardView.tsx@@ -44,6 +44,8 @@ import { useResizeObserver } from "@/hooks/resize-observer";import LiveContextMenu from "@/components/menu/LiveContextMenu";import { useStreamingSettings } from "@/context/streaming-settings-provider";import { useTranslation } from "react-i18next";+import { EmptyCard } from "@/components/card/EmptyCard";+import { BsFillCameraVideoOffFill } from "react-icons/bs";type LiveDashboardViewProps = {cameras: CameraConfig[];@@ -352,6 +354,10 @@ export default function LiveDashboardView({onSaveMuting(true);};+ if (cameras.length == 0) {+ return <NoCameraView />;+ }+return (<divclassName="scrollbar-container size-full select-none overflow-y-auto px-1 pt-2 md:p-2"@@ -608,3 +614,18 @@ export default function LiveDashboardView({</div>);}++function NoCameraView() {+ const { t } = useTranslation(["views/live"]);++ return (+ <div className="flex size-full items-center justify-center">+ <EmptyCard+ icon={<BsFillCameraVideoOffFill className="size-8" />}+ title={t("noCameras.title")}+ description={t("noCameras.description")}+ buttonText={t("noCameras.buttonText")}+ />+ </div>+ );+}