mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-04-05 22:57:40 +03:00
Merge pull request #69 from ibs0d/revert-68-claude/fix-zoom-statistics-WFvOm
Revert "fix: revert CameraMotionDot, restore built-in LivePlayer motion dot"
This commit is contained in:
commit
18321ac16f
@ -29,6 +29,8 @@ import {
|
|||||||
} from "@/types/live";
|
} from "@/types/live";
|
||||||
import ActivityIndicator from "@/components/indicators/activity-indicator";
|
import ActivityIndicator from "@/components/indicators/activity-indicator";
|
||||||
import { PlayerStats } from "@/components/player/PlayerStats";
|
import { PlayerStats } from "@/components/player/PlayerStats";
|
||||||
|
import { MdCircle } from "react-icons/md";
|
||||||
|
import { useCameraActivity } from "@/hooks/use-camera-activity";
|
||||||
import { Skeleton } from "@/components/ui/skeleton";
|
import { Skeleton } from "@/components/ui/skeleton";
|
||||||
|
|
||||||
import { isEqual } from "lodash";
|
import { isEqual } from "lodash";
|
||||||
@ -877,6 +879,7 @@ export default function DraggableGridLayout({
|
|||||||
[camera.name]: loading,
|
[camera.name]: loading,
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
|
showMotionDot={false}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
!isEditMode && onSelectCamera(camera.name);
|
!isEditMode && onSelectCamera(camera.name);
|
||||||
}}
|
}}
|
||||||
@ -908,7 +911,10 @@ export default function DraggableGridLayout({
|
|||||||
minimal={true}
|
minimal={true}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
<CameraMotionDot
|
||||||
|
camera={camera}
|
||||||
|
autoLive={autoLive ?? globalAutoLive}
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
{isEditMode && showCircles && <CornerCircles />}
|
{isEditMode && showCircles && <CornerCircles />}
|
||||||
</GridLiveContextMenu>
|
</GridLiveContextMenu>
|
||||||
@ -1075,6 +1081,24 @@ const BirdseyeLivePlayerGridItem = React.forwardRef<
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// Separate component so it can call useCameraActivity as a hook (no hooks in loops).
|
||||||
|
// Direct WS subscription guarantees the dot reacts to motion changes in real-time
|
||||||
|
// without relying on an intermediate callback → parent-state chain.
|
||||||
|
function CameraMotionDot({
|
||||||
|
camera,
|
||||||
|
autoLive,
|
||||||
|
}: {
|
||||||
|
camera: CameraConfig;
|
||||||
|
autoLive?: boolean;
|
||||||
|
}) {
|
||||||
|
const { activeMotion, offline } = useCameraActivity(camera);
|
||||||
|
if (autoLive === false || offline || !activeMotion) return null;
|
||||||
|
return (
|
||||||
|
<div className="absolute right-2 top-2 z-40">
|
||||||
|
<MdCircle className="mr-2 size-2 animate-pulse text-danger shadow-danger drop-shadow-md" />
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
type GridLiveContextMenuProps = {
|
type GridLiveContextMenuProps = {
|
||||||
className?: string;
|
className?: string;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user