Correct units
This commit is contained in:
parent
d2cb64c7a3
commit
2fdd8df9f9
@ -1,7 +1,8 @@
|
|||||||
import classNames from "classnames";
|
import classNames from "classnames";
|
||||||
import prettyBytes from "pretty-bytes";
|
import { useTranslation } from "next-i18next";
|
||||||
|
|
||||||
export default function Pool({ name, free, allocated, healthy }) {
|
export default function Pool({ name, free, allocated, healthy }) {
|
||||||
|
const { t } = useTranslation();
|
||||||
const usedPercent = Math.round((allocated / (free + allocated)) * 100);
|
const usedPercent = Math.round((allocated / (free + allocated)) * 100);
|
||||||
const statusColor = healthy ? "bg-green-500" : "bg-yellow-500";
|
const statusColor = healthy ? "bg-green-500" : "bg-yellow-500";
|
||||||
|
|
||||||
@ -21,7 +22,17 @@ export default function Pool({ name, free, allocated, healthy }) {
|
|||||||
</div>
|
</div>
|
||||||
<div className="self-center text-xs flex justify-end mr-1.5 pl-1 z-10 text-ellipsis overflow-hidden whitespace-nowrap">
|
<div className="self-center text-xs flex justify-end mr-1.5 pl-1 z-10 text-ellipsis overflow-hidden whitespace-nowrap">
|
||||||
<span>
|
<span>
|
||||||
{prettyBytes(allocated)} / {prettyBytes(free + allocated)}
|
{t("common.bytes", {
|
||||||
|
value: allocated,
|
||||||
|
maximumFractionDigits: 1,
|
||||||
|
binary: true,
|
||||||
|
})}{" "}
|
||||||
|
/{" "}
|
||||||
|
{t("common.bytes", {
|
||||||
|
value: free + allocated,
|
||||||
|
maximumFractionDigits: 1,
|
||||||
|
binary: true,
|
||||||
|
})}
|
||||||
</span>
|
</span>
|
||||||
<span className="pl-2">({usedPercent}%)</span>
|
<span className="pl-2">({usedPercent}%)</span>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user