mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-05-04 04:27:42 +03:00
Move time ago to card info and add face area
This commit is contained in:
parent
6337246064
commit
c2e28fbc69
@ -853,12 +853,19 @@ function FaceAttemptGroup({
|
|||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<div className="flex flex-row justify-between">
|
<div className="flex flex-row justify-between">
|
||||||
|
<div className="flex flex-col gap-1">
|
||||||
<div className="select-none smart-capitalize">
|
<div className="select-none smart-capitalize">
|
||||||
Person
|
Person
|
||||||
{event?.sub_label
|
{event?.sub_label
|
||||||
? `: ${event.sub_label} (${Math.round((event.data.sub_label_score || 0) * 100)}%)`
|
? `: ${event.sub_label} (${Math.round((event.data.sub_label_score || 0) * 100)}%)`
|
||||||
: ": " + t("details.unknown")}
|
: ": " + t("details.unknown")}
|
||||||
</div>
|
</div>
|
||||||
|
<TimeAgo
|
||||||
|
className="text-sm text-secondary-foreground"
|
||||||
|
time={group[0].timestamp * 1000}
|
||||||
|
dense
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
{event && (
|
{event && (
|
||||||
<Tooltip>
|
<Tooltip>
|
||||||
<TooltipTrigger>
|
<TooltipTrigger>
|
||||||
@ -950,6 +957,14 @@ function FaceAttempt({
|
|||||||
onClick(data, true);
|
onClick(data, true);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const imageArea = useMemo(() => {
|
||||||
|
if (!imgRef.current) {
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
|
||||||
|
return imgRef.current.naturalWidth * imgRef.current.naturalHeight;
|
||||||
|
}, [imgRef]);
|
||||||
|
|
||||||
// api calls
|
// api calls
|
||||||
|
|
||||||
const onTrainAttempt = useCallback(
|
const onTrainAttempt = useCallback(
|
||||||
@ -1021,13 +1036,11 @@ function FaceAttempt({
|
|||||||
onClick(data, e.metaKey || e.ctrlKey);
|
onClick(data, e.metaKey || e.ctrlKey);
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
{imageArea != undefined && (
|
||||||
<div className="absolute bottom-1 right-1 z-10 rounded-lg bg-black/50 px-2 py-1 text-xs text-white">
|
<div className="absolute bottom-1 right-1 z-10 rounded-lg bg-black/50 px-2 py-1 text-xs text-white">
|
||||||
<TimeAgo
|
{imageArea}px
|
||||||
className="text-white"
|
|
||||||
time={data.timestamp * 1000}
|
|
||||||
dense
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
<div className="select-none p-2">
|
<div className="select-none p-2">
|
||||||
<div className="flex w-full flex-row items-center justify-between gap-2">
|
<div className="flex w-full flex-row items-center justify-between gap-2">
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user