mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-09 04:35:25 +03:00
ensure birdseye is actually enabled in config
This commit is contained in:
parent
c7ce957c2d
commit
57326324cd
@ -146,6 +146,8 @@ function NewGroupDialog({ open, setOpen, currentGroups }: NewGroupDialogProps) {
|
|||||||
const { data: config, mutate: updateConfig } =
|
const { data: config, mutate: updateConfig } =
|
||||||
useSWR<FrigateConfig>("config");
|
useSWR<FrigateConfig>("config");
|
||||||
|
|
||||||
|
const birdseyeConfig = useMemo(() => config?.birdseye, [config]);
|
||||||
|
|
||||||
// add fields
|
// add fields
|
||||||
|
|
||||||
const [editState, setEditState] = useState<"none" | "add" | "edit">("none");
|
const [editState, setEditState] = useState<"none" | "add" | "edit">("none");
|
||||||
@ -298,26 +300,27 @@ function NewGroupDialog({ open, setOpen, currentGroups }: NewGroupDialogProps) {
|
|||||||
</div>
|
</div>
|
||||||
</DropdownMenuTrigger>
|
</DropdownMenuTrigger>
|
||||||
<DropdownMenuContent>
|
<DropdownMenuContent>
|
||||||
{[...Object.keys(config?.cameras ?? {}), "birdseye"].map(
|
{[
|
||||||
(camera) => (
|
...Object.keys(config?.cameras ?? {}),
|
||||||
<FilterCheckBox
|
...(birdseyeConfig?.enabled ? ["birdseye"] : []),
|
||||||
key={camera}
|
].map((camera) => (
|
||||||
isChecked={cameras.includes(camera)}
|
<FilterCheckBox
|
||||||
label={camera.replaceAll("_", " ")}
|
key={camera}
|
||||||
onCheckedChange={(checked) => {
|
isChecked={cameras.includes(camera)}
|
||||||
if (checked) {
|
label={camera.replaceAll("_", " ")}
|
||||||
setCameras([...cameras, camera]);
|
onCheckedChange={(checked) => {
|
||||||
} else {
|
if (checked) {
|
||||||
const index = cameras.indexOf(camera);
|
setCameras([...cameras, camera]);
|
||||||
setCameras([
|
} else {
|
||||||
...cameras.slice(0, index),
|
const index = cameras.indexOf(camera);
|
||||||
...cameras.slice(index + 1),
|
setCameras([
|
||||||
]);
|
...cameras.slice(0, index),
|
||||||
}
|
...cameras.slice(index + 1),
|
||||||
}}
|
]);
|
||||||
/>
|
}
|
||||||
),
|
}}
|
||||||
)}
|
/>
|
||||||
|
))}
|
||||||
</DropdownMenuContent>
|
</DropdownMenuContent>
|
||||||
</DropdownMenu>
|
</DropdownMenu>
|
||||||
{error && <div className="text-danger">{error}</div>}
|
{error && <div className="text-danger">{error}</div>}
|
||||||
|
|||||||
@ -130,7 +130,7 @@ export default function LiveDashboardView({
|
|||||||
<div
|
<div
|
||||||
className={`my-4 grid ${layout == "grid" ? "grid-cols-2 xl:grid-cols-3 3xl:grid-cols-4" : ""} gap-2 md:gap-4 *:rounded-2xl *:bg-black`}
|
className={`my-4 grid ${layout == "grid" ? "grid-cols-2 xl:grid-cols-3 3xl:grid-cols-4" : ""} gap-2 md:gap-4 *:rounded-2xl *:bg-black`}
|
||||||
>
|
>
|
||||||
{includeBirdseye && birdseyeConfig && (
|
{includeBirdseye && birdseyeConfig?.enabled && (
|
||||||
<BirdseyeLivePlayer
|
<BirdseyeLivePlayer
|
||||||
birdseyeConfig={birdseyeConfig}
|
birdseyeConfig={birdseyeConfig}
|
||||||
liveMode={birdseyeConfig.restream ? "mse" : "jsmpeg"}
|
liveMode={birdseyeConfig.restream ? "mse" : "jsmpeg"}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user