diff --git a/web/public/locales/en/views/settings.json b/web/public/locales/en/views/settings.json index 06d9279f7..1ff14f63c 100644 --- a/web/public/locales/en/views/settings.json +++ b/web/public/locales/en/views/settings.json @@ -1606,5 +1606,16 @@ "onvif": { "profileAuto": "Auto", "profileLoading": "Loading profiles..." + }, + "configMessages": { + "review": { + "recordDisabled": "Recording is disabled, review items will not be generated." + }, + "audio": { + "noAudioRole": "No streams have the audio role defined. You must enable the audio role for audio detection to function." + }, + "detect": { + "fpsGreaterThanFive": "Setting the detect FPS higher than 5 is not recommended." + } } } diff --git a/web/src/components/config-form/section-configs/audio.ts b/web/src/components/config-form/section-configs/audio.ts index a112fa0db..31f19e93d 100644 --- a/web/src/components/config-form/section-configs/audio.ts +++ b/web/src/components/config-form/section-configs/audio.ts @@ -3,6 +3,21 @@ import type { SectionConfigOverrides } from "./types"; const audio: SectionConfigOverrides = { base: { sectionDocs: "/configuration/audio_detectors", + messages: [ + { + key: "no-audio-role", + messageKey: "configMessages.audio.noAudioRole", + severity: "warning", + condition: (ctx) => { + if (ctx.level === "camera" && ctx.fullCameraConfig) { + return !ctx.fullCameraConfig.ffmpeg?.inputs?.some((input) => + input.roles?.includes("audio"), + ); + } + return false; + }, + }, + ], restartRequired: [], fieldOrder: [ "enabled", diff --git a/web/src/components/config-form/section-configs/detect.ts b/web/src/components/config-form/section-configs/detect.ts index 778620f1c..ef14d13fd 100644 --- a/web/src/components/config-form/section-configs/detect.ts +++ b/web/src/components/config-form/section-configs/detect.ts @@ -3,6 +3,21 @@ import type { SectionConfigOverrides } from "./types"; const detect: SectionConfigOverrides = { base: { sectionDocs: "/configuration/camera_specific", + fieldMessages: [ + { + key: "fps-greater-than-five", + field: "fps", + messageKey: "configMessages.detect.fpsGreaterThanFive", + severity: "info", + position: "after", + condition: (ctx) => { + if (ctx.level !== "camera" || !ctx.fullCameraConfig) return false; + const detectFps = ctx.formData?.fps as number | undefined; + const streamFps = ctx.fullCameraConfig.detect?.fps; + return detectFps != null && streamFps != null && detectFps > 5; + }, + }, + ], fieldOrder: [ "enabled", "width", diff --git a/web/src/components/config-form/section-configs/review.ts b/web/src/components/config-form/section-configs/review.ts index e9e3169d7..6805e8cc3 100644 --- a/web/src/components/config-form/section-configs/review.ts +++ b/web/src/components/config-form/section-configs/review.ts @@ -3,6 +3,19 @@ import type { SectionConfigOverrides } from "./types"; const review: SectionConfigOverrides = { base: { sectionDocs: "/configuration/review", + messages: [ + { + key: "record-disabled", + messageKey: "configMessages.review.recordDisabled", + severity: "warning", + condition: (ctx) => { + if (ctx.level === "camera" && ctx.fullCameraConfig) { + return ctx.fullCameraConfig.record.enabled === false; + } + return ctx.fullConfig.record?.enabled === false; + }, + }, + ], fieldDocs: { "alerts.labels": "/configuration/review/#alerts-and-detections", "detections.labels": "/configuration/review/#alerts-and-detections",