mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-05-04 23:14:12 +02:00
Miscellaneous Fixes (#21193)
* Fix saving zone friendly name when it wasn't set * Fix UTF-8 handling for Onvif * Don't remove none directory for classes * Lookup all event IDs for review item immediately * Cleanup typing * Only fetch events when review group is open * Cleanup * disable debug paths switch for autotracking cameras * fix clickable birdseye --------- Co-authored-by: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com>
This commit is contained in:
@@ -441,7 +441,7 @@ export default function ZoneEditPane({
|
||||
}
|
||||
|
||||
let friendlyNameQuery = "";
|
||||
if (friendly_name) {
|
||||
if (friendly_name && friendly_name !== zoneName) {
|
||||
friendlyNameQuery = `&cameras.${polygon?.camera}.zones.${zoneName}.friendly_name=${encodeURIComponent(friendly_name)}`;
|
||||
}
|
||||
|
||||
|
||||
@@ -316,7 +316,7 @@ function ReviewGroup({
|
||||
date_style: "medium",
|
||||
});
|
||||
|
||||
const shouldFetchEvents = review?.data?.detections?.length > 0;
|
||||
const shouldFetchEvents = open && review?.data?.detections?.length > 0;
|
||||
|
||||
const { data: fetchedEvents, isValidating } = useSWR<Event[]>(
|
||||
shouldFetchEvents
|
||||
|
||||
@@ -134,10 +134,20 @@ function Live() {
|
||||
.sort((aConf, bConf) => aConf.ui.order - bConf.ui.order);
|
||||
}, [config, cameraGroup, allowedCameras]);
|
||||
|
||||
const selectedCamera = useMemo(
|
||||
() => cameras.find((cam) => cam.name == selectedCameraName),
|
||||
[cameras, selectedCameraName],
|
||||
);
|
||||
const selectedCamera = useMemo(() => {
|
||||
if (!config || !selectedCameraName || selectedCameraName === "birdseye") {
|
||||
return undefined;
|
||||
}
|
||||
const camera = config.cameras[selectedCameraName];
|
||||
if (
|
||||
camera &&
|
||||
allowedCameras.includes(selectedCameraName) &&
|
||||
camera.enabled_in_config
|
||||
) {
|
||||
return camera;
|
||||
}
|
||||
return undefined;
|
||||
}, [config, selectedCameraName, allowedCameras]);
|
||||
|
||||
return (
|
||||
<div className="size-full" ref={mainRef}>
|
||||
@@ -146,6 +156,7 @@ function Live() {
|
||||
supportsFullscreen={supportsFullScreen}
|
||||
fullscreen={fullscreen}
|
||||
toggleFullscreen={toggleFullscreen}
|
||||
onSelectCamera={setSelectedCameraName}
|
||||
/>
|
||||
) : selectedCamera ? (
|
||||
<LiveCameraView
|
||||
|
||||
@@ -28,12 +28,14 @@ type LiveBirdseyeViewProps = {
|
||||
supportsFullscreen: boolean;
|
||||
fullscreen: boolean;
|
||||
toggleFullscreen: () => void;
|
||||
onSelectCamera?: (cameraName: string) => void;
|
||||
};
|
||||
|
||||
export default function LiveBirdseyeView({
|
||||
supportsFullscreen,
|
||||
fullscreen,
|
||||
toggleFullscreen,
|
||||
onSelectCamera,
|
||||
}: LiveBirdseyeViewProps) {
|
||||
const { t } = useTranslation(["views/live"]);
|
||||
const { data: config } = useSWR<FrigateConfig>("config");
|
||||
@@ -181,13 +183,13 @@ export default function LiveBirdseyeView({
|
||||
canvasY >= parsedCoords.y &&
|
||||
canvasY < parsedCoords.y + parsedCoords.height
|
||||
) {
|
||||
navigate(`/#${cameraName}`);
|
||||
onSelectCamera?.(cameraName);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
[playerRef, config, birdseyeLayout, navigate],
|
||||
[playerRef, config, birdseyeLayout, onSelectCamera],
|
||||
);
|
||||
|
||||
if (!config) {
|
||||
|
||||
@@ -252,6 +252,10 @@ export default function ObjectSettingsView({
|
||||
className="ml-1"
|
||||
id={param}
|
||||
checked={options && options[param]}
|
||||
disabled={
|
||||
param === "paths" &&
|
||||
cameraConfig?.onvif?.autotracking?.enabled_in_config
|
||||
}
|
||||
onCheckedChange={(isChecked) => {
|
||||
handleSetOption(param, isChecked);
|
||||
}}
|
||||
|
||||
Reference in New Issue
Block a user