mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-03-31 12:24:55 +03:00
update restart required fields for global sections
This commit is contained in:
parent
4ba33184a3
commit
4560961166
@ -25,14 +25,7 @@ const audio: SectionConfigOverrides = {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
global: {
|
global: {
|
||||||
restartRequired: [
|
restartRequired: ["num_threads"],
|
||||||
"enabled",
|
|
||||||
"listen",
|
|
||||||
"filters",
|
|
||||||
"min_volume",
|
|
||||||
"max_not_heard",
|
|
||||||
"num_threads",
|
|
||||||
],
|
|
||||||
},
|
},
|
||||||
camera: {
|
camera: {
|
||||||
restartRequired: ["num_threads"],
|
restartRequired: ["num_threads"],
|
||||||
|
|||||||
@ -30,16 +30,7 @@ const detect: SectionConfigOverrides = {
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
global: {
|
global: {
|
||||||
restartRequired: [
|
restartRequired: ["width", "height", "min_initialized", "max_disappeared"],
|
||||||
"enabled",
|
|
||||||
"width",
|
|
||||||
"height",
|
|
||||||
"fps",
|
|
||||||
"min_initialized",
|
|
||||||
"max_disappeared",
|
|
||||||
"annotation_offset",
|
|
||||||
"stationary",
|
|
||||||
],
|
|
||||||
},
|
},
|
||||||
camera: {
|
camera: {
|
||||||
restartRequired: ["width", "height", "min_initialized", "max_disappeared"],
|
restartRequired: ["width", "height", "min_initialized", "max_disappeared"],
|
||||||
|
|||||||
@ -29,17 +29,7 @@ const motion: SectionConfigOverrides = {
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
global: {
|
global: {
|
||||||
restartRequired: [
|
restartRequired: ["frame_height"],
|
||||||
"enabled",
|
|
||||||
"threshold",
|
|
||||||
"lightning_threshold",
|
|
||||||
"improve_contrast",
|
|
||||||
"contour_area",
|
|
||||||
"delta_alpha",
|
|
||||||
"frame_alpha",
|
|
||||||
"frame_height",
|
|
||||||
"mqtt_off_delay",
|
|
||||||
],
|
|
||||||
},
|
},
|
||||||
camera: {
|
camera: {
|
||||||
restartRequired: ["frame_height"],
|
restartRequired: ["frame_height"],
|
||||||
|
|||||||
@ -83,7 +83,7 @@ const objects: SectionConfigOverrides = {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
global: {
|
global: {
|
||||||
restartRequired: ["track", "alert", "detect", "filters", "genai"],
|
restartRequired: [],
|
||||||
hiddenFields: [
|
hiddenFields: [
|
||||||
"enabled_in_config",
|
"enabled_in_config",
|
||||||
"mask",
|
"mask",
|
||||||
|
|||||||
@ -29,16 +29,7 @@ const record: SectionConfigOverrides = {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
global: {
|
global: {
|
||||||
restartRequired: [
|
restartRequired: [],
|
||||||
"enabled",
|
|
||||||
"expire_interval",
|
|
||||||
"continuous",
|
|
||||||
"motion",
|
|
||||||
"alerts",
|
|
||||||
"detections",
|
|
||||||
"preview",
|
|
||||||
"export",
|
|
||||||
],
|
|
||||||
},
|
},
|
||||||
camera: {
|
camera: {
|
||||||
restartRequired: [],
|
restartRequired: [],
|
||||||
|
|||||||
@ -44,7 +44,7 @@ const review: SectionConfigOverrides = {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
global: {
|
global: {
|
||||||
restartRequired: ["alerts", "detections", "genai"],
|
restartRequired: [],
|
||||||
},
|
},
|
||||||
camera: {
|
camera: {
|
||||||
restartRequired: [],
|
restartRequired: [],
|
||||||
|
|||||||
@ -27,14 +27,7 @@ const snapshots: SectionConfigOverrides = {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
global: {
|
global: {
|
||||||
restartRequired: [
|
restartRequired: [],
|
||||||
"enabled",
|
|
||||||
"bounding_box",
|
|
||||||
"crop",
|
|
||||||
"quality",
|
|
||||||
"timestamp",
|
|
||||||
"retain",
|
|
||||||
],
|
|
||||||
hiddenFields: ["enabled_in_config", "required_zones"],
|
hiddenFields: ["enabled_in_config", "required_zones"],
|
||||||
},
|
},
|
||||||
camera: {
|
camera: {
|
||||||
|
|||||||
@ -56,6 +56,7 @@ import ActivityIndicator from "@/components/indicators/activity-indicator";
|
|||||||
import { StatusBarMessagesContext } from "@/context/statusbar-provider";
|
import { StatusBarMessagesContext } from "@/context/statusbar-provider";
|
||||||
import {
|
import {
|
||||||
cameraUpdateTopicMap,
|
cameraUpdateTopicMap,
|
||||||
|
globalCameraDefaultSections,
|
||||||
buildOverrides,
|
buildOverrides,
|
||||||
buildConfigDataForPath,
|
buildConfigDataForPath,
|
||||||
sanitizeSectionData as sharedSanitizeSectionData,
|
sanitizeSectionData as sharedSanitizeSectionData,
|
||||||
@ -234,7 +235,10 @@ export function ConfigSection({
|
|||||||
? cameraUpdateTopicMap[sectionPath]
|
? cameraUpdateTopicMap[sectionPath]
|
||||||
? `config/cameras/${cameraName}/${cameraUpdateTopicMap[sectionPath]}`
|
? `config/cameras/${cameraName}/${cameraUpdateTopicMap[sectionPath]}`
|
||||||
: undefined
|
: undefined
|
||||||
: `config/${sectionPath}`;
|
: globalCameraDefaultSections.has(sectionPath) &&
|
||||||
|
cameraUpdateTopicMap[sectionPath]
|
||||||
|
? `config/cameras/*/${cameraUpdateTopicMap[sectionPath]}`
|
||||||
|
: `config/${sectionPath}`;
|
||||||
// Default: show title for camera level (since it might be collapsible), hide for global
|
// Default: show title for camera level (since it might be collapsible), hide for global
|
||||||
const shouldShowTitle = showTitle ?? effectiveLevel === "camera";
|
const shouldShowTitle = showTitle ?? effectiveLevel === "camera";
|
||||||
|
|
||||||
|
|||||||
@ -54,6 +54,19 @@ export const cameraUpdateTopicMap: Record<string, string> = {
|
|||||||
ui: "ui",
|
ui: "ui",
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Sections where global config serves as the default for per-camera config.
|
||||||
|
// Global updates to these sections are fanned out to all cameras via wildcard.
|
||||||
|
export const globalCameraDefaultSections = new Set([
|
||||||
|
"detect",
|
||||||
|
"objects",
|
||||||
|
"motion",
|
||||||
|
"record",
|
||||||
|
"snapshots",
|
||||||
|
"review",
|
||||||
|
"audio",
|
||||||
|
"notifications",
|
||||||
|
]);
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
// buildOverrides — pure recursive diff of current vs stored config & defaults
|
// buildOverrides — pure recursive diff of current vs stored config & defaults
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
@ -476,6 +489,9 @@ export function prepareSectionSavePayload(opts: {
|
|||||||
if (level === "camera" && cameraName) {
|
if (level === "camera" && cameraName) {
|
||||||
const topic = cameraUpdateTopicMap[sectionPath];
|
const topic = cameraUpdateTopicMap[sectionPath];
|
||||||
updateTopic = topic ? `config/cameras/${cameraName}/${topic}` : undefined;
|
updateTopic = topic ? `config/cameras/${cameraName}/${topic}` : undefined;
|
||||||
|
} else if (globalCameraDefaultSections.has(sectionPath)) {
|
||||||
|
const topic = cameraUpdateTopicMap[sectionPath];
|
||||||
|
updateTopic = topic ? `config/cameras/*/${topic}` : `config/${sectionPath}`;
|
||||||
} else {
|
} else {
|
||||||
updateTopic = `config/${sectionPath}`;
|
updateTopic = `config/${sectionPath}`;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user