diff --git a/Plugin/unraid/js/varaverk.js b/Plugin/unraid/js/varaverk.js index 1c5a3ea..ce08409 100644 --- a/Plugin/unraid/js/varaverk.js +++ b/Plugin/unraid/js/varaverk.js @@ -23,12 +23,21 @@ function _fmtBytes(b) { return (b / 1024).toFixed(0) + ' KB'; } -// Bytes → auto-scale TB / GB / MB +// Bytes → auto-scale TB / GB / MB, decimal. +// +// Its only caller is the arr disk bar, which is showing the same storage the Monitor and Watchdog +// tabs show. Those were moved to decimal so a disk reads the same number here as on Unraid's own +// Main page and as printed on the drive; leaving this one binary made /tv 86.9 TB on this tab and +// 95.6 TB on the next, which is worse than either convention chosen consistently. +// +// Capacity is decimal, memory stays binary — 128 GB of RAM genuinely is 125.8 GiB and every tool +// on the box agrees. See _vv_api_bytes_to_gib() in include/unraid_api.php for the same split on +// the PHP side. function _sz(b) { if (!b) return '—'; - if (b >= _TB) return (b / _TB).toFixed(1) + ' TB'; - if (b >= _GB) return (b / _GB).toFixed(1) + ' GB'; - return (b / _MB).toFixed(0) + ' MB'; + if (b >= 1e12) return (b / 1e12).toFixed(1) + ' TB'; + if (b >= 1e9) return (b / 1e9).toFixed(1) + ' GB'; + return (b / 1e6).toFixed(0) + ' MB'; } function _gb(b) { return !b ? '—' : (b / _GB).toFixed(1) + ' GB'; } diff --git a/Plugin/unraid/pages/arrs.php b/Plugin/unraid/pages/arrs.php index 0ae91aa..6e8fa30 100644 --- a/Plugin/unraid/pages/arrs.php +++ b/Plugin/unraid/pages/arrs.php @@ -26,6 +26,7 @@ // api/arrs.php polled every 60s → include/arrs.php // api/confform.php inline conf edits → include/confform.php require_once dirname(__DIR__) . '/include/confui.php'; +require_once dirname(__DIR__) . '/include/ai_chat.php'; ?>