mirror of
https://github.com/blakeblackshear/frigate.git
synced 2025-12-18 02:56:44 +03:00
fix: fix camera setting view zone friendly name display
This commit is contained in:
parent
36b2043518
commit
23aba70819
@ -23,7 +23,6 @@ import { StatusBarMessagesContext } from "@/context/statusbar-provider";
|
|||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
import { Link } from "react-router-dom";
|
import { Link } from "react-router-dom";
|
||||||
import { LuExternalLink } from "react-icons/lu";
|
import { LuExternalLink } from "react-icons/lu";
|
||||||
import { capitalizeFirstLetter } from "@/utils/stringUtil";
|
|
||||||
import { MdCircle } from "react-icons/md";
|
import { MdCircle } from "react-icons/md";
|
||||||
import { cn } from "@/lib/utils";
|
import { cn } from "@/lib/utils";
|
||||||
import { Trans, useTranslation } from "react-i18next";
|
import { Trans, useTranslation } from "react-i18next";
|
||||||
@ -88,7 +87,7 @@ export default function CameraSettingsView({
|
|||||||
// zones and labels
|
// zones and labels
|
||||||
|
|
||||||
const getZoneName = useCallback(
|
const getZoneName = useCallback(
|
||||||
(cameraId: string, zoneId: string) =>
|
(zoneId: string, cameraId?: string) =>
|
||||||
resolveZoneName(config, zoneId, cameraId),
|
resolveZoneName(config, zoneId, cameraId),
|
||||||
[config],
|
[config],
|
||||||
);
|
);
|
||||||
@ -98,7 +97,7 @@ export default function CameraSettingsView({
|
|||||||
return Object.entries(cameraConfig.zones).map(([name, zoneData]) => ({
|
return Object.entries(cameraConfig.zones).map(([name, zoneData]) => ({
|
||||||
camera: cameraConfig.name,
|
camera: cameraConfig.name,
|
||||||
name,
|
name,
|
||||||
friendly_name: getZoneName(cameraConfig.name, name),
|
friendly_name: getZoneName(name, cameraConfig.name),
|
||||||
objects: zoneData.objects,
|
objects: zoneData.objects,
|
||||||
color: zoneData.color,
|
color: zoneData.color,
|
||||||
}));
|
}));
|
||||||
@ -557,12 +556,7 @@ export default function CameraSettingsView({
|
|||||||
{
|
{
|
||||||
alertsLabels,
|
alertsLabels,
|
||||||
zone: watchedAlertsZones
|
zone: watchedAlertsZones
|
||||||
.map((zone) =>
|
.map((zone) => getZoneName(zone))
|
||||||
capitalizeFirstLetter(zone).replaceAll(
|
|
||||||
"_",
|
|
||||||
" ",
|
|
||||||
),
|
|
||||||
)
|
|
||||||
.join(", "),
|
.join(", "),
|
||||||
cameraName: selectCameraName,
|
cameraName: selectCameraName,
|
||||||
},
|
},
|
||||||
@ -676,12 +670,7 @@ export default function CameraSettingsView({
|
|||||||
values={{
|
values={{
|
||||||
detectionsLabels,
|
detectionsLabels,
|
||||||
zone: watchedDetectionsZones
|
zone: watchedDetectionsZones
|
||||||
.map((zone) =>
|
.map((zone) => getZoneName(zone))
|
||||||
capitalizeFirstLetter(zone).replaceAll(
|
|
||||||
"_",
|
|
||||||
" ",
|
|
||||||
),
|
|
||||||
)
|
|
||||||
.join(", "),
|
.join(", "),
|
||||||
cameraName: selectCameraName,
|
cameraName: selectCameraName,
|
||||||
}}
|
}}
|
||||||
@ -693,12 +682,7 @@ export default function CameraSettingsView({
|
|||||||
values={{
|
values={{
|
||||||
detectionsLabels,
|
detectionsLabels,
|
||||||
zone: watchedDetectionsZones
|
zone: watchedDetectionsZones
|
||||||
.map((zone) =>
|
.map((zone) => getZoneName(zone))
|
||||||
capitalizeFirstLetter(zone).replaceAll(
|
|
||||||
"_",
|
|
||||||
" ",
|
|
||||||
),
|
|
||||||
)
|
|
||||||
.join(", "),
|
.join(", "),
|
||||||
cameraName: selectCameraName,
|
cameraName: selectCameraName,
|
||||||
}}
|
}}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user