mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-03-31 20:34:53 +03:00
fix red unsaved dot
This commit is contained in:
parent
b9149b6366
commit
5f262621c4
@ -464,6 +464,32 @@ const GLOBAL_SECTION_MAPPING: Record<string, SettingsType> = {
|
|||||||
timestamp_style: "globalTimestampStyle",
|
timestamp_style: "globalTimestampStyle",
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const ENRICHMENTS_SECTION_MAPPING: Record<string, SettingsType> = {
|
||||||
|
semantic_search: "integrationSemanticSearch",
|
||||||
|
genai: "integrationGenerativeAi",
|
||||||
|
face_recognition: "integrationFaceRecognition",
|
||||||
|
lpr: "integrationLpr",
|
||||||
|
classification: "integrationObjectClassification",
|
||||||
|
audio_transcription: "integrationAudioTranscription",
|
||||||
|
};
|
||||||
|
|
||||||
|
const SYSTEM_SECTION_MAPPING: Record<string, SettingsType> = {
|
||||||
|
database: "systemDatabase",
|
||||||
|
mqtt: "systemMqtt",
|
||||||
|
tls: "systemTls",
|
||||||
|
auth: "systemAuthentication",
|
||||||
|
networking: "systemNetworking",
|
||||||
|
proxy: "systemProxy",
|
||||||
|
ui: "systemUi",
|
||||||
|
logger: "systemLogging",
|
||||||
|
environment_vars: "systemEnvironmentVariables",
|
||||||
|
telemetry: "systemTelemetry",
|
||||||
|
birdseye: "systemBirdseye",
|
||||||
|
ffmpeg: "systemFfmpeg",
|
||||||
|
detectors: "systemDetectorHardware",
|
||||||
|
model: "systemDetectionModel",
|
||||||
|
};
|
||||||
|
|
||||||
const CAMERA_SECTION_KEYS = new Set<SettingsType>(
|
const CAMERA_SECTION_KEYS = new Set<SettingsType>(
|
||||||
Object.values(CAMERA_SECTION_MAPPING),
|
Object.values(CAMERA_SECTION_MAPPING),
|
||||||
);
|
);
|
||||||
@ -661,7 +687,11 @@ export default function Settings() {
|
|||||||
if (level === "camera") {
|
if (level === "camera") {
|
||||||
menuKey = CAMERA_SECTION_MAPPING[sectionKey] || sectionKey;
|
menuKey = CAMERA_SECTION_MAPPING[sectionKey] || sectionKey;
|
||||||
} else {
|
} else {
|
||||||
menuKey = GLOBAL_SECTION_MAPPING[sectionKey] || sectionKey;
|
menuKey =
|
||||||
|
GLOBAL_SECTION_MAPPING[sectionKey] ||
|
||||||
|
ENRICHMENTS_SECTION_MAPPING[sectionKey] ||
|
||||||
|
SYSTEM_SECTION_MAPPING[sectionKey] ||
|
||||||
|
sectionKey;
|
||||||
}
|
}
|
||||||
|
|
||||||
setSectionStatusByKey((prev) => ({
|
setSectionStatusByKey((prev) => ({
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import { useState } from "react";
|
import { useCallback, useState } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import type { SectionConfig } from "@/components/config-form/sections";
|
import type { SectionConfig } from "@/components/config-form/sections";
|
||||||
import { ConfigSectionTemplate } from "@/components/config-form/sections";
|
import { ConfigSectionTemplate } from "@/components/config-form/sections";
|
||||||
@ -47,6 +47,7 @@ export function SingleSectionPage({
|
|||||||
showOverrideIndicator = true,
|
showOverrideIndicator = true,
|
||||||
selectedCamera,
|
selectedCamera,
|
||||||
setUnsavedChanges,
|
setUnsavedChanges,
|
||||||
|
onSectionStatusChange,
|
||||||
pendingDataBySection,
|
pendingDataBySection,
|
||||||
onPendingDataChange,
|
onPendingDataChange,
|
||||||
}: SingleSectionPageProps) {
|
}: SingleSectionPageProps) {
|
||||||
@ -62,6 +63,14 @@ export function SingleSectionPage({
|
|||||||
isOverridden: false,
|
isOverridden: false,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const handleSectionStatusChange = useCallback(
|
||||||
|
(status: SectionStatus) => {
|
||||||
|
setSectionStatus(status);
|
||||||
|
onSectionStatusChange?.(sectionKey, level, status);
|
||||||
|
},
|
||||||
|
[level, onSectionStatusChange, sectionKey],
|
||||||
|
);
|
||||||
|
|
||||||
if (level === "camera" && !selectedCamera) {
|
if (level === "camera" && !selectedCamera) {
|
||||||
return (
|
return (
|
||||||
<div className="flex h-full items-center justify-center text-muted-foreground">
|
<div className="flex h-full items-center justify-center text-muted-foreground">
|
||||||
@ -122,7 +131,7 @@ export function SingleSectionPage({
|
|||||||
pendingDataBySection={pendingDataBySection}
|
pendingDataBySection={pendingDataBySection}
|
||||||
onPendingDataChange={onPendingDataChange}
|
onPendingDataChange={onPendingDataChange}
|
||||||
requiresRestart={requiresRestart}
|
requiresRestart={requiresRestart}
|
||||||
onStatusChange={setSectionStatus}
|
onStatusChange={handleSectionStatusChange}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user