mirror of
https://github.com/blakeblackshear/frigate.git
synced 2025-12-16 18:16:44 +03:00
Compare commits
2 Commits
b5e8c360c0
...
ae90da2613
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ae90da2613 | ||
|
|
0b58d58f66 |
@ -134,10 +134,20 @@ 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(() => {
|
||||||
() => cameras.find((cam) => cam.name == selectedCameraName),
|
if (!config || !selectedCameraName || selectedCameraName === "birdseye") {
|
||||||
[cameras, selectedCameraName],
|
return undefined;
|
||||||
);
|
}
|
||||||
|
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}>
|
||||||
@ -146,6 +156,7 @@ function Live() {
|
|||||||
supportsFullscreen={supportsFullScreen}
|
supportsFullscreen={supportsFullScreen}
|
||||||
fullscreen={fullscreen}
|
fullscreen={fullscreen}
|
||||||
toggleFullscreen={toggleFullscreen}
|
toggleFullscreen={toggleFullscreen}
|
||||||
|
onSelectCamera={setSelectedCameraName}
|
||||||
/>
|
/>
|
||||||
) : selectedCamera ? (
|
) : selectedCamera ? (
|
||||||
<LiveCameraView
|
<LiveCameraView
|
||||||
|
|||||||
@ -28,12 +28,14 @@ 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");
|
||||||
@ -181,13 +183,13 @@ export default function LiveBirdseyeView({
|
|||||||
canvasY >= parsedCoords.y &&
|
canvasY >= parsedCoords.y &&
|
||||||
canvasY < parsedCoords.y + parsedCoords.height
|
canvasY < parsedCoords.y + parsedCoords.height
|
||||||
) {
|
) {
|
||||||
navigate(`/#${cameraName}`);
|
onSelectCamera?.(cameraName);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
[playerRef, config, birdseyeLayout, navigate],
|
[playerRef, config, birdseyeLayout, onSelectCamera],
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!config) {
|
if (!config) {
|
||||||
|
|||||||
@ -252,6 +252,10 @@ 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