Report disk capacity in decimal GB so it matches Unraid and the drive label
The API mixes units per field — memory in bytes, disk size in KiB, fsSize and fsUsed in kB — and one helper was guessing which from the magnitude of the number, which also read any memory total under 100 GB as KB.
This commit is contained in:
@@ -738,7 +738,9 @@ function vvTempColor(tempC, transport) {
|
||||
return tempC >= crit ? '#f44336' : tempC >= warn ? '#ff9800' : '#4caf50';
|
||||
}
|
||||
|
||||
function vvFmt(v) { return v >= 1024 ? (v / 1024).toFixed(1) + ' TB' : v + ' GB'; }
|
||||
// Capacity only — size_gb/used_gb are decimal GB, so TB is 1000 of them. vvFmtGb below is the
|
||||
// binary one and stays binary: it formats cumulative bytes read/written, not drive capacity.
|
||||
function vvFmt(v) { return v >= 1000 ? (v / 1000).toFixed(1) + ' TB' : v + ' GB'; }
|
||||
|
||||
function vvFmtRate(mbs) {
|
||||
if (mbs >= 1000) return (mbs / 1024).toFixed(1) + ' GB/s';
|
||||
|
||||
Reference in New Issue
Block a user