mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-08-02 09:02:15 +03:00
Miscellaneous Fixes (0.17 beta) (#21575)
CI / AMD64 Build (push) Waiting to run
CI / ARM Build (push) Waiting to run
CI / Jetson Jetpack 6 (push) Waiting to run
CI / AMD64 Extra Build (push) Blocked by required conditions
CI / ARM Extra Build (push) Blocked by required conditions
CI / Synaptics Build (push) Blocked by required conditions
CI / Assemble and push default build (push) Blocked by required conditions
CI / AMD64 Build (push) Waiting to run
CI / ARM Build (push) Waiting to run
CI / Jetson Jetpack 6 (push) Waiting to run
CI / AMD64 Extra Build (push) Blocked by required conditions
CI / ARM Extra Build (push) Blocked by required conditions
CI / Synaptics Build (push) Blocked by required conditions
CI / Assemble and push default build (push) Blocked by required conditions
* icon improvements add type to getIconForLabel provide default icon for audio events * Add preferred language to review docs * prevent react Suspense crash during auth redirect add redirect-check guards to stop rendering lazy routes while navigation is pending (fixes some users seeing React error #426 when auth expires) * Uppsercase model name --------- Co-authored-by: Nicolas Mowen <nickmowen213@gmail.com>
This commit is contained in:
co-authored by
Nicolas Mowen
parent
f3543cfee2
commit
c08fa15724
@@ -14,6 +14,7 @@ import { FrigateConfig } from "@/types/frigateConfig";
|
||||
import useSWR from "swr";
|
||||
import ActivityIndicator from "../indicators/activity-indicator";
|
||||
import { Event } from "@/types/event";
|
||||
import { EventType } from "@/types/search";
|
||||
import { getIconForLabel } from "@/utils/iconUtil";
|
||||
import { REVIEW_PADDING, ReviewSegment } from "@/types/review";
|
||||
import { LuChevronDown, LuCircle, LuChevronRight } from "react-icons/lu";
|
||||
@@ -346,22 +347,29 @@ function ReviewGroup({
|
||||
: null,
|
||||
);
|
||||
|
||||
const rawIconLabels: string[] = [
|
||||
const rawIconLabels: Array<{ label: string; type: EventType }> = [
|
||||
...(fetchedEvents
|
||||
? fetchedEvents.map((e) =>
|
||||
e.sub_label ? e.label + "-verified" : e.label,
|
||||
)
|
||||
: (review.data?.objects ?? [])),
|
||||
...(review.data?.audio ?? []),
|
||||
? fetchedEvents.map((e) => ({
|
||||
label: e.sub_label ? e.label + "-verified" : e.label,
|
||||
type: e.data.type,
|
||||
}))
|
||||
: (review.data?.objects ?? []).map((obj) => ({
|
||||
label: obj,
|
||||
type: "object" as EventType,
|
||||
}))),
|
||||
...(review.data?.audio ?? []).map((audio) => ({
|
||||
label: audio,
|
||||
type: "audio" as EventType,
|
||||
})),
|
||||
];
|
||||
|
||||
// limit to 5 icons
|
||||
const seen = new Set<string>();
|
||||
const iconLabels: string[] = [];
|
||||
for (const lbl of rawIconLabels) {
|
||||
if (!seen.has(lbl)) {
|
||||
seen.add(lbl);
|
||||
iconLabels.push(lbl);
|
||||
const iconLabels: Array<{ label: string; type: EventType }> = [];
|
||||
for (const item of rawIconLabels) {
|
||||
if (!seen.has(item.label)) {
|
||||
seen.add(item.label);
|
||||
iconLabels.push(item);
|
||||
if (iconLabels.length >= 5) break;
|
||||
}
|
||||
}
|
||||
@@ -418,12 +426,12 @@ function ReviewGroup({
|
||||
<div className="flex flex-row gap-3">
|
||||
<div className="text-sm font-medium">{displayTime}</div>
|
||||
<div className="relative flex items-center gap-2 text-white">
|
||||
{iconLabels.slice(0, 5).map((lbl, idx) => (
|
||||
{iconLabels.slice(0, 5).map(({ label: lbl, type }, idx) => (
|
||||
<div
|
||||
key={`${lbl}-${idx}`}
|
||||
className="rounded-full bg-muted-foreground p-1"
|
||||
>
|
||||
{getIconForLabel(lbl, "size-3 text-white")}
|
||||
{getIconForLabel(lbl, type, "size-3 text-white")}
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
@@ -516,7 +524,11 @@ function ReviewGroup({
|
||||
>
|
||||
<div className="ml-1.5 flex items-center gap-2 text-sm font-medium">
|
||||
<div className="rounded-full bg-muted-foreground p-1">
|
||||
{getIconForLabel(audioLabel, "size-3 text-white")}
|
||||
{getIconForLabel(
|
||||
audioLabel,
|
||||
"audio",
|
||||
"size-3 text-white",
|
||||
)}
|
||||
</div>
|
||||
<span>{getTranslatedLabel(audioLabel, "audio")}</span>
|
||||
</div>
|
||||
@@ -618,6 +630,7 @@ function EventList({
|
||||
>
|
||||
{getIconForLabel(
|
||||
event.sub_label ? event.label + "-verified" : event.label,
|
||||
event.data.type,
|
||||
"size-3 text-white",
|
||||
)}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user