mirror of
https://github.com/blakeblackshear/frigate.git
synced 2025-09-28 17:53:51 +02:00
Make all object path points clickable (#17367)
This commit is contained in:
parent
e80caabee6
commit
2c3ea5b74e
@ -285,9 +285,16 @@ export default function ObjectLifecycle({
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (eventSequence && eventSequence.length > 0) {
|
if (eventSequence && eventSequence.length > 0) {
|
||||||
setTimeIndex(eventSequence?.[current].timestamp);
|
if (current == -1) {
|
||||||
handleSetBox(eventSequence?.[current].data.box ?? []);
|
// normal path point
|
||||||
setLifecycleZones(eventSequence?.[current].data.zones);
|
setBoxStyle(null);
|
||||||
|
setLifecycleZones([]);
|
||||||
|
} else {
|
||||||
|
// lifecycle point
|
||||||
|
setTimeIndex(eventSequence?.[current].timestamp);
|
||||||
|
handleSetBox(eventSequence?.[current].data.box ?? []);
|
||||||
|
setLifecycleZones(eventSequence?.[current].data.zones);
|
||||||
|
}
|
||||||
setSelectedZone("");
|
setSelectedZone("");
|
||||||
}
|
}
|
||||||
}, [current, imgLoaded, handleSetBox, eventSequence]);
|
}, [current, imgLoaded, handleSetBox, eventSequence]);
|
||||||
@ -322,6 +329,10 @@ export default function ObjectLifecycle({
|
|||||||
mainApi.scrollTo(sequenceIndex);
|
mainApi.scrollTo(sequenceIndex);
|
||||||
thumbnailApi.scrollTo(sequenceIndex);
|
thumbnailApi.scrollTo(sequenceIndex);
|
||||||
setCurrent(sequenceIndex);
|
setCurrent(sequenceIndex);
|
||||||
|
} else {
|
||||||
|
// click on a normal path point, not a lifecycle point
|
||||||
|
setCurrent(-1);
|
||||||
|
setTimeIndex(pathPoints[index].timestamp);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
[mainApi, thumbnailApi, eventSequence, pathPoints],
|
[mainApi, thumbnailApi, eventSequence, pathPoints],
|
||||||
|
@ -95,10 +95,8 @@ export function ObjectPath({
|
|||||||
fill={getPointColor(color, pos.lifecycle_item?.class_type)}
|
fill={getPointColor(color, pos.lifecycle_item?.class_type)}
|
||||||
stroke="white"
|
stroke="white"
|
||||||
strokeWidth={width / 2}
|
strokeWidth={width / 2}
|
||||||
onClick={() =>
|
onClick={() => onPointClick && onPointClick(index)}
|
||||||
pos.lifecycle_item && onPointClick && onPointClick(index)
|
style={{ cursor: "pointer" }}
|
||||||
}
|
|
||||||
style={{ cursor: pos.lifecycle_item ? "pointer" : "default" }}
|
|
||||||
/>
|
/>
|
||||||
</TooltipTrigger>
|
</TooltipTrigger>
|
||||||
<TooltipPortal>
|
<TooltipPortal>
|
||||||
|
Loading…
Reference in New Issue
Block a user