mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-07-29 07:09:03 +03:00
Add ability to hide cameras from review UI (#23387)
CI / AMD64 Build (push) Waiting to run
CI / ARM Build (push) Waiting to run
CI / Jetson Jetpack 6 (push) Waiting to run
CI / AMD64 Extra Build (push) Blocked by required conditions
CI / ARM Extra Build (push) Blocked by required conditions
CI / Synaptics Build (push) Blocked by required conditions
CI / Assemble and push default build (push) Blocked by required conditions
CI / AMD64 Build (push) Waiting to run
CI / ARM Build (push) Waiting to run
CI / Jetson Jetpack 6 (push) Waiting to run
CI / AMD64 Extra Build (push) Blocked by required conditions
CI / ARM Extra Build (push) Blocked by required conditions
CI / Synaptics Build (push) Blocked by required conditions
CI / Assemble and push default build (push) Blocked by required conditions
* Add field to control if cameras show in review * i18n * Add config to UI
This commit is contained in:
@@ -70,13 +70,15 @@ export default function Events() {
|
||||
undefined,
|
||||
);
|
||||
|
||||
const motionSearchCameras = useMemo(() => {
|
||||
const reviewCameras = useMemo(() => {
|
||||
if (!config?.cameras) {
|
||||
return [] as string[];
|
||||
}
|
||||
|
||||
return Object.keys(config.cameras).filter((cam) =>
|
||||
allowedCameras.includes(cam),
|
||||
return Object.keys(config.cameras).filter(
|
||||
(cam) =>
|
||||
allowedCameras.includes(cam) &&
|
||||
config.cameras[cam]?.ui?.review !== false,
|
||||
);
|
||||
}, [allowedCameras, config?.cameras]);
|
||||
|
||||
@@ -85,12 +87,12 @@ export default function Events() {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (motionSearchCameras.includes(motionSearchCamera)) {
|
||||
if (reviewCameras.includes(motionSearchCamera)) {
|
||||
return motionSearchCamera;
|
||||
}
|
||||
|
||||
return motionSearchCameras[0] ?? null;
|
||||
}, [motionSearchCamera, motionSearchCameras]);
|
||||
return reviewCameras[0] ?? null;
|
||||
}, [motionSearchCamera, reviewCameras]);
|
||||
|
||||
const motionSearchTimeRange = useMemo(() => {
|
||||
if (motionSearchDay) {
|
||||
@@ -357,6 +359,10 @@ export default function Events() {
|
||||
const motion: ReviewSegment[] = [];
|
||||
|
||||
reviews?.forEach((segment) => {
|
||||
if (config?.cameras[segment.camera]?.ui?.review === false) {
|
||||
return;
|
||||
}
|
||||
|
||||
all.push(segment);
|
||||
|
||||
switch (segment.severity) {
|
||||
@@ -378,7 +384,7 @@ export default function Events() {
|
||||
detection: detections,
|
||||
significant_motion: motion,
|
||||
};
|
||||
}, [reviews]);
|
||||
}, [reviews, config?.cameras]);
|
||||
|
||||
// update review items in place when a review segment ends
|
||||
const reviewUpdate = useFrigateReviews();
|
||||
@@ -635,7 +641,7 @@ export default function Events() {
|
||||
}
|
||||
|
||||
setStartTime(recording.startTime);
|
||||
const allCameras = reviewFilter?.cameras ?? allowedCameras;
|
||||
const allCameras = reviewFilter?.cameras ?? reviewCameras;
|
||||
|
||||
return {
|
||||
camera: recording.camera,
|
||||
@@ -680,7 +686,7 @@ export default function Events() {
|
||||
) : (
|
||||
<MotionSearchView
|
||||
config={config}
|
||||
cameras={motionSearchCameras}
|
||||
cameras={reviewCameras}
|
||||
selectedCamera={selectedMotionSearchCamera}
|
||||
onCameraSelect={handleMotionSearchCameraSelect}
|
||||
cameraLocked={true}
|
||||
|
||||
Reference in New Issue
Block a user