mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-04-12 01:57:36 +03:00
Miscellaneous fixes (#22828)
Some checks failed
CI / AMD64 Build (push) Has been cancelled
CI / ARM Build (push) Has been cancelled
CI / Jetson Jetpack 6 (push) Has been cancelled
CI / AMD64 Extra Build (push) Has been cancelled
CI / ARM Extra Build (push) Has been cancelled
CI / Synaptics Build (push) Has been cancelled
CI / Assemble and push default build (push) Has been cancelled
Some checks failed
CI / AMD64 Build (push) Has been cancelled
CI / ARM Build (push) Has been cancelled
CI / Jetson Jetpack 6 (push) Has been cancelled
CI / AMD64 Extra Build (push) Has been cancelled
CI / ARM Extra Build (push) Has been cancelled
CI / Synaptics Build (push) Has been cancelled
CI / Assemble and push default build (push) Has been cancelled
* fix video playback stutter when GenAI dialog is open in detail stream Inline `onOpen` callback in DetailStream.tsx:522 creates a new function identity every render. GenAISummaryChip.tsx:98's useEffect depends on [open, onOpen], so it re-fires on every parent re-render while the dialog is open. Each fire calls onSeek -> setCurrentTime -> seekToTimestamp, creating a continuous re-render + seek loop * add /profiles to EXEMPT_PATHS for non-admin users * skip debug_replay/status poll for non-admin users * use subquery for timeline lookup to avoid SQLite variable limit
This commit is contained in:
parent
d113be5e19
commit
335229d0d4
@ -64,6 +64,7 @@ def require_admin_by_default():
|
|||||||
"/logout",
|
"/logout",
|
||||||
# Authenticated user endpoints (allow_any_authenticated)
|
# Authenticated user endpoints (allow_any_authenticated)
|
||||||
"/profile",
|
"/profile",
|
||||||
|
"/profiles",
|
||||||
# Public info endpoints (allow_public)
|
# Public info endpoints (allow_public)
|
||||||
"/",
|
"/",
|
||||||
"/version",
|
"/version",
|
||||||
|
|||||||
@ -62,11 +62,12 @@ def get_camera_regions_grid(
|
|||||||
.where((Event.false_positive == None) | (Event.false_positive == False))
|
.where((Event.false_positive == None) | (Event.false_positive == False))
|
||||||
.where(Event.start_time > last_update)
|
.where(Event.start_time > last_update)
|
||||||
)
|
)
|
||||||
valid_event_ids = [e["id"] for e in events.dicts()]
|
|
||||||
logger.debug(f"Found {len(valid_event_ids)} new events for {name}")
|
event_count = events.count()
|
||||||
|
logger.debug(f"Found {event_count} new events for {name}")
|
||||||
|
|
||||||
# no new events, return as is
|
# no new events, return as is
|
||||||
if not valid_event_ids:
|
if event_count == 0:
|
||||||
return grid
|
return grid
|
||||||
|
|
||||||
new_update = datetime.datetime.now().timestamp()
|
new_update = datetime.datetime.now().timestamp()
|
||||||
@ -78,7 +79,7 @@ def get_camera_regions_grid(
|
|||||||
Timeline.data,
|
Timeline.data,
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
.where(Timeline.source_id << valid_event_ids)
|
.where(Timeline.source_id << events)
|
||||||
.limit(10000)
|
.limit(10000)
|
||||||
.dicts()
|
.dicts()
|
||||||
)
|
)
|
||||||
|
|||||||
@ -6,7 +6,7 @@ import {
|
|||||||
ThreatLevel,
|
ThreatLevel,
|
||||||
THREAT_LEVEL_LABELS,
|
THREAT_LEVEL_LABELS,
|
||||||
} from "@/types/review";
|
} from "@/types/review";
|
||||||
import React, { useEffect, useMemo, useState } from "react";
|
import React, { useEffect, useMemo, useRef, useState } from "react";
|
||||||
import { isDesktop } from "react-device-detect";
|
import { isDesktop } from "react-device-detect";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { MdAutoAwesome } from "react-icons/md";
|
import { MdAutoAwesome } from "react-icons/md";
|
||||||
@ -95,11 +95,12 @@ export function GenAISummaryDialog({
|
|||||||
const Trigger = isDesktop ? DialogTrigger : DrawerTrigger;
|
const Trigger = isDesktop ? DialogTrigger : DrawerTrigger;
|
||||||
const Content = isDesktop ? DialogContent : DrawerContent;
|
const Content = isDesktop ? DialogContent : DrawerContent;
|
||||||
|
|
||||||
|
const onOpenRef = useRef(onOpen);
|
||||||
|
onOpenRef.current = onOpen;
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (onOpen) {
|
onOpenRef.current?.(open);
|
||||||
onOpen(open);
|
}, [open]);
|
||||||
}
|
|
||||||
}, [open, onOpen]);
|
|
||||||
|
|
||||||
if (!aiAnalysis) {
|
if (!aiAnalysis) {
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
@ -11,15 +11,20 @@ import useDeepMemo from "./use-deep-memo";
|
|||||||
import { capitalizeAll, capitalizeFirstLetter } from "@/utils/stringUtil";
|
import { capitalizeAll, capitalizeFirstLetter } from "@/utils/stringUtil";
|
||||||
import { isReplayCamera } from "@/utils/cameraUtil";
|
import { isReplayCamera } from "@/utils/cameraUtil";
|
||||||
import { useFrigateStats } from "@/api/ws";
|
import { useFrigateStats } from "@/api/ws";
|
||||||
|
import { useIsAdmin } from "./use-is-admin";
|
||||||
|
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
|
|
||||||
export default function useStats(stats: FrigateStats | undefined) {
|
export default function useStats(stats: FrigateStats | undefined) {
|
||||||
const { t } = useTranslation(["views/system"]);
|
const { t } = useTranslation(["views/system"]);
|
||||||
const { data: config } = useSWR<FrigateConfig>("config");
|
const { data: config } = useSWR<FrigateConfig>("config");
|
||||||
const { data: debugReplayStatus } = useSWR("debug_replay/status", {
|
const isAdmin = useIsAdmin();
|
||||||
revalidateOnFocus: false,
|
const { data: debugReplayStatus } = useSWR(
|
||||||
});
|
isAdmin ? "debug_replay/status" : null,
|
||||||
|
{
|
||||||
|
revalidateOnFocus: false,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
const memoizedStats = useDeepMemo(stats);
|
const memoizedStats = useDeepMemo(stats);
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user