mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-01-22 20:18:30 +03:00
improve display of area percentage
This commit is contained in:
parent
8a718421ac
commit
9f508fe990
@ -849,7 +849,11 @@ function LifecycleIconRow({
|
||||
() =>
|
||||
Array.isArray(item.data.attribute_box) &&
|
||||
item.data.attribute_box.length >= 4
|
||||
? (item.data.attribute_box[2] * item.data.attribute_box[3]).toFixed(4)
|
||||
? (
|
||||
item.data.attribute_box[2] *
|
||||
item.data.attribute_box[3] *
|
||||
100
|
||||
).toFixed(2)
|
||||
: undefined,
|
||||
[item.data.attribute_box],
|
||||
);
|
||||
@ -857,7 +861,7 @@ function LifecycleIconRow({
|
||||
const areaPct = useMemo(
|
||||
() =>
|
||||
Array.isArray(item.data.box) && item.data.box.length >= 4
|
||||
? (item.data.box[2] * item.data.box[3]).toFixed(4)
|
||||
? (item.data.box[2] * item.data.box[3] * 100).toFixed(2)
|
||||
: undefined,
|
||||
[item.data.box],
|
||||
);
|
||||
|
||||
@ -744,7 +744,7 @@ function LifecycleItem({
|
||||
const areaPct = useMemo(
|
||||
() =>
|
||||
Array.isArray(item?.data.box) && item?.data.box.length >= 4
|
||||
? (item?.data.box[2] * item?.data.box[3]).toFixed(4)
|
||||
? (item?.data.box[2] * item?.data.box[3] * 100).toFixed(2)
|
||||
: undefined,
|
||||
[item],
|
||||
);
|
||||
@ -766,7 +766,11 @@ function LifecycleItem({
|
||||
() =>
|
||||
Array.isArray(item?.data.attribute_box) &&
|
||||
item?.data.attribute_box.length >= 4
|
||||
? (item?.data.attribute_box[2] * item?.data.attribute_box[3]).toFixed(4)
|
||||
? (
|
||||
item?.data.attribute_box[2] *
|
||||
item?.data.attribute_box[3] *
|
||||
100
|
||||
).toFixed(2)
|
||||
: undefined,
|
||||
[item],
|
||||
);
|
||||
@ -845,7 +849,7 @@ function LifecycleItem({
|
||||
</span>
|
||||
{areaPx !== undefined && areaPct !== undefined ? (
|
||||
<span className="font-medium text-foreground">
|
||||
{areaPx} {t("information.pixels", { ns: "common" })}{" "}
|
||||
{t("information.pixels", { ns: "common", area: areaPx })}{" "}
|
||||
<span className="text-secondary-foreground">·</span>{" "}
|
||||
{areaPct}%
|
||||
</span>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user