Object Lifecycle tweaks (#16648)

* Disable object path and add warning for autotracking cameras

* clean up
This commit is contained in:
Josh Hawkins 2025-02-17 17:03:51 -06:00 committed by GitHub
parent 11b1dbf0ff
commit 4f88a5f2ad
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -207,11 +207,15 @@ export default function ObjectLifecycle({
// final object path with timeline points included // final object path with timeline points included
const pathPoints = useMemo(() => { const pathPoints = useMemo(() => {
// don't display a path if we don't have any saved path points // don't display a path if we don't have any saved path points
if (savedPathPoints.length === 0) return []; if (
savedPathPoints.length === 0 ||
config?.cameras[event.camera]?.onvif.autotracking.enabled_in_config
)
return [];
return [...savedPathPoints, ...eventSequencePoints].sort( return [...savedPathPoints, ...eventSequencePoints].sort(
(a, b) => a.timestamp - b.timestamp, (a, b) => a.timestamp - b.timestamp,
); );
}, [savedPathPoints, eventSequencePoints]); }, [savedPathPoints, eventSequencePoints, config, event]);
const [timeIndex, setTimeIndex] = useState(0); const [timeIndex, setTimeIndex] = useState(0);
@ -503,6 +507,11 @@ export default function ObjectLifecycle({
{current + 1} of {eventSequence.length} {current + 1} of {eventSequence.length}
</div> </div>
</div> </div>
{config?.cameras[event.camera]?.onvif.autotracking.enabled_in_config && (
<div className="-mt-2 mb-2 text-sm text-danger">
Bounding box positions will be inaccurate for autotracking cameras.
</div>
)}
{showControls && ( {showControls && (
<AnnotationSettingsPane <AnnotationSettingsPane
event={event} event={event}