mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-07 11:45:24 +03:00
use default snapshot config for in progress
This commit is contained in:
parent
009ab01aba
commit
e185d88878
@ -123,12 +123,21 @@ export default function Events({ path, ...props }) {
|
|||||||
[searchParams]
|
[searchParams]
|
||||||
);
|
);
|
||||||
|
|
||||||
const { data: ongoingEvents, mutate: refreshOngoingEvents } = useSWR(['events', { in_progress: 1, include_thumbnails: 0 }]);
|
const { data: ongoingEvents, mutate: refreshOngoingEvents } = useSWR([
|
||||||
const { data: eventPages, mutate: refreshEvents, size, setSize, isValidating } = useSWRInfinite(getKey, eventsFetcher);
|
'events',
|
||||||
|
{ in_progress: 1, include_thumbnails: 0 },
|
||||||
|
]);
|
||||||
|
const {
|
||||||
|
data: eventPages,
|
||||||
|
mutate: refreshEvents,
|
||||||
|
size,
|
||||||
|
setSize,
|
||||||
|
isValidating,
|
||||||
|
} = useSWRInfinite(getKey, eventsFetcher);
|
||||||
const mutate = () => {
|
const mutate = () => {
|
||||||
refreshEvents();
|
refreshEvents();
|
||||||
refreshOngoingEvents();
|
refreshOngoingEvents();
|
||||||
}
|
};
|
||||||
|
|
||||||
const { data: allLabels } = useSWR(['labels']);
|
const { data: allLabels } = useSWR(['labels']);
|
||||||
const { data: allSubLabels } = useSWR(['sub_labels', { split_joined: 1 }]);
|
const { data: allSubLabels } = useSWR(['sub_labels', { split_joined: 1 }]);
|
||||||
@ -283,15 +292,12 @@ export default function Events({ path, ...props }) {
|
|||||||
[path, searchParams, setSearchParams]
|
[path, searchParams, setSearchParams]
|
||||||
);
|
);
|
||||||
|
|
||||||
const onClickFilterSubmitted = useCallback(
|
const onClickFilterSubmitted = useCallback(() => {
|
||||||
() => {
|
if (++searchParams.is_submitted > 1) {
|
||||||
if( ++searchParams.is_submitted > 1 ) {
|
|
||||||
searchParams.is_submitted = -1;
|
searchParams.is_submitted = -1;
|
||||||
}
|
}
|
||||||
onFilter('is_submitted', searchParams.is_submitted);
|
onFilter('is_submitted', searchParams.is_submitted);
|
||||||
},
|
}, [searchParams, onFilter]);
|
||||||
[searchParams, onFilter]
|
|
||||||
);
|
|
||||||
|
|
||||||
const isDone = (eventPages?.[eventPages.length - 1]?.length ?? 0) < API_LIMIT;
|
const isDone = (eventPages?.[eventPages.length - 1]?.length ?? 0) < API_LIMIT;
|
||||||
|
|
||||||
@ -918,7 +924,7 @@ function Event({
|
|||||||
className="flex-grow-0"
|
className="flex-grow-0"
|
||||||
src={
|
src={
|
||||||
event.has_snapshot
|
event.has_snapshot
|
||||||
? `${apiHost}api/events/${event.id}/snapshot.jpg`
|
? `${apiHost}api/events/${event.id}/snapshot.jpg?bbox=1`
|
||||||
: `${apiHost}api/events/${event.id}/thumbnail.jpg`
|
: `${apiHost}api/events/${event.id}/thumbnail.jpg`
|
||||||
}
|
}
|
||||||
alt={`${event.label} at ${((event?.data?.top_score || event.top_score) * 100).toFixed(
|
alt={`${event.label} at ${((event?.data?.top_score || event.top_score) * 100).toFixed(
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user