Disk sizes for the glances and resources widgets are reporting the incorrect disk sizes. The sizes are reported in bytes and need the binary: flag set to true so that the values are divided by 1024 and not 1000. The memory widgets were already doing this but the disk widgets missed this option.

This commit is contained in:
brikim 2024-02-20 19:48:39 -06:00
parent 8fb6d608c3
commit ffc8b618c6
2 changed files with 4 additions and 4 deletions

View File

@ -132,9 +132,9 @@ export default function Widget({ options }) {
<Resource
key={`disk_${disk.mnt_point ?? disk.device_name}`}
icon={FiHardDrive}
value={t("common.bytes", { value: disk.free })}
value={t("common.bytes", { value: disk.free, binary: true })}
label={t("glances.free")}
expandedValue={t("common.bytes", { value: disk.size })}
expandedValue={t("common.bytes", { value: disk.size, binary: true })}
expandedLabel={t("glances.total")}
percentage={disk.percent}
expanded={options.expanded}

View File

@ -36,9 +36,9 @@ export default function Disk({ options, expanded, refresh = 1500 }) {
return (
<Resource
icon={FiHardDrive}
value={t("common.bytes", { value: data.drive.available })}
value={t("common.bytes", { value: data.drive.available, binary: true })}
label={t("resources.free")}
expandedValue={t("common.bytes", { value: data.drive.size })}
expandedValue={t("common.bytes", { value: data.drive.size, binary: true })}
expandedLabel={t("resources.total")}
percentage={percent}
expanded={expanded}