mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-07 11:45:24 +03:00
Adjust to new data format
This commit is contained in:
parent
318fd70cff
commit
f900a01277
@ -10,12 +10,10 @@ import { formatUnixTimestampToDateTime } from "@/utils/dateUtil";
|
|||||||
export function Review() {
|
export function Review() {
|
||||||
const { data: config } = useSWR<FrigateConfig>("config");
|
const { data: config } = useSWR<FrigateConfig>("config");
|
||||||
const timezone = useMemo(() => config?.ui?.timezone || Intl.DateTimeFormat().resolvedOptions().timeZone, [config]);
|
const timezone = useMemo(() => config?.ui?.timezone || Intl.DateTimeFormat().resolvedOptions().timeZone, [config]);
|
||||||
const start = useMemo(() => new Date().getTime() / 1000, []);
|
|
||||||
const { data: hourlyTimeline } = useSWR<HourlyTimeline>(['timeline/hourly', { timezone }]);
|
const { data: hourlyTimeline } = useSWR<HourlyTimeline>(['timeline/hourly', { timezone }]);
|
||||||
const { data: allPreviews } = useSWR<Preview[]>(`preview/all/start/${Object.keys(hourlyTimeline || [0])[0]}/end/${start}`, { revalidateOnFocus: false });
|
const { data: allPreviews } = useSWR<Preview[]>(`preview/all/start/${hourlyTimeline?.start}/end/${hourlyTimeline?.end}`, { revalidateOnFocus: false });
|
||||||
|
|
||||||
// detail levels can be normal, extra, full
|
const [detailLevel, setDetailLevel] = useState<'normal' | 'extra' | 'full'>('normal');
|
||||||
const [detailLevel, setDetailLevel] = useState('normal');
|
|
||||||
|
|
||||||
const timelineCards: CardsData | never[] = useMemo(() => {
|
const timelineCards: CardsData | never[] = useMemo(() => {
|
||||||
if (!hourlyTimeline) {
|
if (!hourlyTimeline) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user