mirror of
https://github.com/blakeblackshear/frigate.git
synced 2025-12-17 02:26:43 +03:00
Compare commits
No commits in common. "ae90da261346f4c0c11c2385a58400789283256f" and "b5e8c360c0904e838746e8e8348cc21a18a2a2e6" have entirely different histories.
ae90da2613
...
b5e8c360c0
@ -134,20 +134,10 @@ function Live() {
|
|||||||
.sort((aConf, bConf) => aConf.ui.order - bConf.ui.order);
|
.sort((aConf, bConf) => aConf.ui.order - bConf.ui.order);
|
||||||
}, [config, cameraGroup, allowedCameras]);
|
}, [config, cameraGroup, allowedCameras]);
|
||||||
|
|
||||||
const selectedCamera = useMemo(() => {
|
const selectedCamera = useMemo(
|
||||||
if (!config || !selectedCameraName || selectedCameraName === "birdseye") {
|
() => cameras.find((cam) => cam.name == selectedCameraName),
|
||||||
return undefined;
|
[cameras, selectedCameraName],
|
||||||
}
|
);
|
||||||
const camera = config.cameras[selectedCameraName];
|
|
||||||
if (
|
|
||||||
camera &&
|
|
||||||
allowedCameras.includes(selectedCameraName) &&
|
|
||||||
camera.enabled_in_config
|
|
||||||
) {
|
|
||||||
return camera;
|
|
||||||
}
|
|
||||||
return undefined;
|
|
||||||
}, [config, selectedCameraName, allowedCameras]);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="size-full" ref={mainRef}>
|
<div className="size-full" ref={mainRef}>
|
||||||
@ -156,7 +146,6 @@ function Live() {
|
|||||||
supportsFullscreen={supportsFullScreen}
|
supportsFullscreen={supportsFullScreen}
|
||||||
fullscreen={fullscreen}
|
fullscreen={fullscreen}
|
||||||
toggleFullscreen={toggleFullscreen}
|
toggleFullscreen={toggleFullscreen}
|
||||||
onSelectCamera={setSelectedCameraName}
|
|
||||||
/>
|
/>
|
||||||
) : selectedCamera ? (
|
) : selectedCamera ? (
|
||||||
<LiveCameraView
|
<LiveCameraView
|
||||||
|
|||||||
@ -28,14 +28,12 @@ type LiveBirdseyeViewProps = {
|
|||||||
supportsFullscreen: boolean;
|
supportsFullscreen: boolean;
|
||||||
fullscreen: boolean;
|
fullscreen: boolean;
|
||||||
toggleFullscreen: () => void;
|
toggleFullscreen: () => void;
|
||||||
onSelectCamera?: (cameraName: string) => void;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export default function LiveBirdseyeView({
|
export default function LiveBirdseyeView({
|
||||||
supportsFullscreen,
|
supportsFullscreen,
|
||||||
fullscreen,
|
fullscreen,
|
||||||
toggleFullscreen,
|
toggleFullscreen,
|
||||||
onSelectCamera,
|
|
||||||
}: LiveBirdseyeViewProps) {
|
}: LiveBirdseyeViewProps) {
|
||||||
const { t } = useTranslation(["views/live"]);
|
const { t } = useTranslation(["views/live"]);
|
||||||
const { data: config } = useSWR<FrigateConfig>("config");
|
const { data: config } = useSWR<FrigateConfig>("config");
|
||||||
@ -183,13 +181,13 @@ export default function LiveBirdseyeView({
|
|||||||
canvasY >= parsedCoords.y &&
|
canvasY >= parsedCoords.y &&
|
||||||
canvasY < parsedCoords.y + parsedCoords.height
|
canvasY < parsedCoords.y + parsedCoords.height
|
||||||
) {
|
) {
|
||||||
onSelectCamera?.(cameraName);
|
navigate(`/#${cameraName}`);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
[playerRef, config, birdseyeLayout, onSelectCamera],
|
[playerRef, config, birdseyeLayout, navigate],
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!config) {
|
if (!config) {
|
||||||
|
|||||||
@ -252,10 +252,6 @@ export default function ObjectSettingsView({
|
|||||||
className="ml-1"
|
className="ml-1"
|
||||||
id={param}
|
id={param}
|
||||||
checked={options && options[param]}
|
checked={options && options[param]}
|
||||||
disabled={
|
|
||||||
param === "paths" &&
|
|
||||||
cameraConfig?.onvif?.autotracking?.enabled_in_config
|
|
||||||
}
|
|
||||||
onCheckedChange={(isChecked) => {
|
onCheckedChange={(isChecked) => {
|
||||||
handleSetOption(param, isChecked);
|
handleSetOption(param, isChecked);
|
||||||
}}
|
}}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user