mirror of
https://github.com/blakeblackshear/frigate.git
synced 2025-12-06 13:34:13 +03:00
Merge 949c426df1 into 24766ce427
This commit is contained in:
commit
dd37bc1f36
@ -498,7 +498,7 @@ export default function SearchDetailDialog({
|
|||||||
|
|
||||||
const views = [...SEARCH_TABS];
|
const views = [...SEARCH_TABS];
|
||||||
|
|
||||||
if (search.data.type != "object" || !search.has_clip) {
|
if (!search.has_clip) {
|
||||||
const index = views.indexOf("tracking_details");
|
const index = views.indexOf("tracking_details");
|
||||||
views.splice(index, 1);
|
views.splice(index, 1);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -900,96 +900,99 @@ function LifecycleIconRow({
|
|||||||
<div className="text-md flex items-start break-words text-left">
|
<div className="text-md flex items-start break-words text-left">
|
||||||
{getLifecycleItemDescription(item)}
|
{getLifecycleItemDescription(item)}
|
||||||
</div>
|
</div>
|
||||||
<div className="my-2 ml-2 flex flex-col flex-wrap items-start gap-1.5 text-xs text-secondary-foreground">
|
{/* Only show Score/Ratio/Area for object events, not for audio (heard) or manual API (external) events */}
|
||||||
<div className="flex items-center gap-1.5">
|
{item.class_type !== "heard" && item.class_type !== "external" && (
|
||||||
<span className="text-primary-variant">
|
<div className="my-2 ml-2 flex flex-col flex-wrap items-start gap-1.5 text-xs text-secondary-foreground">
|
||||||
{t("trackingDetails.lifecycleItemDesc.header.score")}
|
<div className="flex items-center gap-1.5">
|
||||||
</span>
|
<span className="text-primary-variant">
|
||||||
<span className="font-medium text-primary">{score}</span>
|
{t("trackingDetails.lifecycleItemDesc.header.score")}
|
||||||
</div>
|
|
||||||
<div className="flex items-center gap-1.5">
|
|
||||||
<span className="text-primary-variant">
|
|
||||||
{t("trackingDetails.lifecycleItemDesc.header.ratio")}
|
|
||||||
</span>
|
|
||||||
<span className="font-medium text-primary">{ratio}</span>
|
|
||||||
</div>
|
|
||||||
<div className="flex items-center gap-1.5">
|
|
||||||
<span className="text-primary-variant">
|
|
||||||
{t("trackingDetails.lifecycleItemDesc.header.area")}{" "}
|
|
||||||
{attributeAreaPx !== undefined &&
|
|
||||||
attributeAreaPct !== undefined && (
|
|
||||||
<span className="text-primary-variant">
|
|
||||||
({getTranslatedLabel(item.data.label)})
|
|
||||||
</span>
|
|
||||||
)}
|
|
||||||
</span>
|
|
||||||
{areaPx !== undefined && areaPct !== undefined ? (
|
|
||||||
<span className="font-medium text-primary">
|
|
||||||
{t("information.pixels", { ns: "common", area: areaPx })} ·{" "}
|
|
||||||
{areaPct}%
|
|
||||||
</span>
|
</span>
|
||||||
) : (
|
<span className="font-medium text-primary">{score}</span>
|
||||||
<span>N/A</span>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
{attributeAreaPx !== undefined &&
|
|
||||||
attributeAreaPct !== undefined && (
|
|
||||||
<div className="flex items-center gap-1.5">
|
|
||||||
<span className="text-primary-variant">
|
|
||||||
{t("trackingDetails.lifecycleItemDesc.header.area")} (
|
|
||||||
{getTranslatedLabel(item.data.attribute)})
|
|
||||||
</span>
|
|
||||||
<span className="font-medium text-primary">
|
|
||||||
{t("information.pixels", {
|
|
||||||
ns: "common",
|
|
||||||
area: attributeAreaPx,
|
|
||||||
})}{" "}
|
|
||||||
· {attributeAreaPct}%
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
|
|
||||||
{item.data?.zones && item.data.zones.length > 0 && (
|
|
||||||
<div className="mt-1 flex flex-wrap items-center gap-2">
|
|
||||||
{item.data.zones.map((zone, zidx) => {
|
|
||||||
const color = getZoneColor(zone)?.join(",") ?? "0,0,0";
|
|
||||||
return (
|
|
||||||
<Badge
|
|
||||||
key={`${zone}-${zidx}`}
|
|
||||||
variant="outline"
|
|
||||||
className="inline-flex cursor-pointer items-center gap-2"
|
|
||||||
onClick={(e: React.MouseEvent) => {
|
|
||||||
e.stopPropagation();
|
|
||||||
setSelectedZone(zone);
|
|
||||||
}}
|
|
||||||
style={{
|
|
||||||
borderColor: `rgba(${color}, 0.6)`,
|
|
||||||
background: `rgba(${color}, 0.08)`,
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<span
|
|
||||||
className="size-1 rounded-full"
|
|
||||||
style={{
|
|
||||||
display: "inline-block",
|
|
||||||
width: 10,
|
|
||||||
height: 10,
|
|
||||||
backgroundColor: `rgb(${color})`,
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
<span
|
|
||||||
className={cn(
|
|
||||||
item.data?.zones_friendly_names?.[zidx] === zone &&
|
|
||||||
"smart-capitalize",
|
|
||||||
)}
|
|
||||||
>
|
|
||||||
{item.data?.zones_friendly_names?.[zidx]}
|
|
||||||
</span>
|
|
||||||
</Badge>
|
|
||||||
);
|
|
||||||
})}
|
|
||||||
</div>
|
</div>
|
||||||
)}
|
<div className="flex items-center gap-1.5">
|
||||||
</div>
|
<span className="text-primary-variant">
|
||||||
|
{t("trackingDetails.lifecycleItemDesc.header.ratio")}
|
||||||
|
</span>
|
||||||
|
<span className="font-medium text-primary">{ratio}</span>
|
||||||
|
</div>
|
||||||
|
<div className="flex items-center gap-1.5">
|
||||||
|
<span className="text-primary-variant">
|
||||||
|
{t("trackingDetails.lifecycleItemDesc.header.area")}{" "}
|
||||||
|
{attributeAreaPx !== undefined &&
|
||||||
|
attributeAreaPct !== undefined && (
|
||||||
|
<span className="text-primary-variant">
|
||||||
|
({getTranslatedLabel(item.data.label)})
|
||||||
|
</span>
|
||||||
|
)}
|
||||||
|
</span>
|
||||||
|
{areaPx !== undefined && areaPct !== undefined ? (
|
||||||
|
<span className="font-medium text-primary">
|
||||||
|
{t("information.pixels", { ns: "common", area: areaPx })}{" "}
|
||||||
|
· {areaPct}%
|
||||||
|
</span>
|
||||||
|
) : (
|
||||||
|
<span>N/A</span>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
{attributeAreaPx !== undefined &&
|
||||||
|
attributeAreaPct !== undefined && (
|
||||||
|
<div className="flex items-center gap-1.5">
|
||||||
|
<span className="text-primary-variant">
|
||||||
|
{t("trackingDetails.lifecycleItemDesc.header.area")} (
|
||||||
|
{getTranslatedLabel(item.data.attribute)})
|
||||||
|
</span>
|
||||||
|
<span className="font-medium text-primary">
|
||||||
|
{t("information.pixels", {
|
||||||
|
ns: "common",
|
||||||
|
area: attributeAreaPx,
|
||||||
|
})}{" "}
|
||||||
|
· {attributeAreaPct}%
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{item.data?.zones && item.data.zones.length > 0 && (
|
||||||
|
<div className="mt-1 flex flex-wrap items-center gap-2">
|
||||||
|
{item.data.zones.map((zone, zidx) => {
|
||||||
|
const color = getZoneColor(zone)?.join(",") ?? "0,0,0";
|
||||||
|
return (
|
||||||
|
<Badge
|
||||||
|
key={`${zone}-${zidx}`}
|
||||||
|
variant="outline"
|
||||||
|
className="inline-flex cursor-pointer items-center gap-2"
|
||||||
|
onClick={(e: React.MouseEvent) => {
|
||||||
|
e.stopPropagation();
|
||||||
|
setSelectedZone(zone);
|
||||||
|
}}
|
||||||
|
style={{
|
||||||
|
borderColor: `rgba(${color}, 0.6)`,
|
||||||
|
background: `rgba(${color}, 0.08)`,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<span
|
||||||
|
className="size-1 rounded-full"
|
||||||
|
style={{
|
||||||
|
display: "inline-block",
|
||||||
|
width: 10,
|
||||||
|
height: 10,
|
||||||
|
backgroundColor: `rgb(${color})`,
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
<span
|
||||||
|
className={cn(
|
||||||
|
item.data?.zones_friendly_names?.[zidx] === zone &&
|
||||||
|
"smart-capitalize",
|
||||||
|
)}
|
||||||
|
>
|
||||||
|
{item.data?.zones_friendly_names?.[zidx]}
|
||||||
|
</span>
|
||||||
|
</Badge>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="ml-3 flex-shrink-0 px-1 text-right text-xs text-primary-variant">
|
<div className="ml-3 flex-shrink-0 px-1 text-right text-xs text-primary-variant">
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user