Add a notice registry and System Health tab (#24178)

* add a notice registry and System Health tab

Problems Frigate detects on its own (ffmpeg crash loops, stuck detectors, failed model downloads, recordings deleted before their retention period) only ever existed as log lines. This adds a `NoticeRegistry` in the main process backed by two tables, an `update_notice` IPC topic so producers in other processes can reach it through the dispatcher, an admin-only API and websocket topic, and a Health tab that lists them. Kinds declare their own mode, severity, and category in one place: state notices are resolved by their producer, event notices are dismissed by the user.

* treat a prerelease as behind its final release

* fix notices clearing early

* rename menu items and update docs

* don't resolve the update notice on a failed version lookup
This commit is contained in:
Josh Hawkins
2026-09-12 07:30:04 -06:00
committed by Nicolas Mowen
parent af60d2db48
commit f3a31e2fb4
55 changed files with 2346 additions and 117 deletions
+23 -6
View File
@@ -6,7 +6,12 @@ import { ToggleGroup, ToggleGroupItem } from "@/components/ui/toggle-group";
import { isDesktop, isMobile } from "react-device-detect";
import GeneralMetrics from "@/views/system/GeneralMetrics";
import StorageMetrics from "@/views/system/StorageMetrics";
import { LuActivity, LuHardDrive, LuSearchCode } from "react-icons/lu";
import {
LuActivity,
LuHardDrive,
LuHeartPulse,
LuSearchCode,
} from "react-icons/lu";
import { FaVideo } from "react-icons/fa";
import Logo from "@/components/Logo";
import useOptimisticState from "@/hooks/use-optimistic-state";
@@ -15,9 +20,16 @@ import { useHashState } from "@/hooks/use-overlay-state";
import { Toaster } from "@/components/ui/sonner";
import { FrigateConfig } from "@/types/frigateConfig";
import EnrichmentMetrics from "@/views/system/EnrichmentMetrics";
import HealthMetrics from "@/views/system/HealthMetrics";
import { useTranslation } from "react-i18next";
const allMetrics = ["general", "enrichments", "storage", "cameras"] as const;
const allMetrics = [
"health",
"general",
"enrichments",
"storage",
"cameras",
] as const;
type SystemMetric = (typeof allMetrics)[number];
function System() {
@@ -44,8 +56,9 @@ function System() {
// stats page
const [page, setPage] = useHashState<SystemMetric>();
// useHashState yields "" with no hash, which ?? would not catch
const [pageToggle, setPageToggle] = useOptimisticState(
page ?? "general",
page || "health",
setPage,
100,
);
@@ -56,9 +69,7 @@ function System() {
// Track which tabs have been visited so we can keep them mounted after first visit.
// Using a ref updated during render avoids extra render cycles from state/effects.
const visitedTabsRef = useRef(new Set<string>());
if (page) {
visitedTabsRef.current.add(page);
}
visitedTabsRef.current.add(pageToggle);
const visitedTabs = visitedTabsRef.current;
useEffect(() => {
@@ -98,6 +109,7 @@ function System() {
value={item}
aria-label={`Select ${item}`}
>
{item == "health" && <LuHeartPulse className="size-4" />}
{item == "general" && <LuActivity className="size-4" />}
{item == "enrichments" && <LuSearchCode className="size-4" />}
{item == "storage" && <LuHardDrive className="size-4" />}
@@ -126,6 +138,11 @@ function System() {
</div>
)}
</div>
{visitedTabs.has("health") && (
<div className={pageToggle == "health" ? "contents" : "hidden"}>
<HealthMetrics />
</div>
)}
{visitedTabs.has("general") && (
<div className={page == "general" ? "contents" : "hidden"}>
<GeneralMetrics