diff options
author | Alejandro Sirgo Rica <asirgo@soleta.eu> | 2024-09-26 10:34:28 +0200 |
---|---|---|
committer | Alejandro Sirgo Rica <asirgo@soleta.eu> | 2024-09-26 13:21:02 +0200 |
commit | c1d9018e2174a3144c6babba86b4959dd77448d2 (patch) | |
tree | cb85898b3f1d67e7ff870781d3b94aae18784fd9 /ogcp/templates/cache_inspector.html | |
parent | 77a60b717af0db3deed845745c39a3fd1e52e6e2 (diff) |
templates: show real sizes in cache inspector
Use real free and available cache in cache_inspector.html
Diffstat (limited to 'ogcp/templates/cache_inspector.html')
-rw-r--r-- | ogcp/templates/cache_inspector.html | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/ogcp/templates/cache_inspector.html b/ogcp/templates/cache_inspector.html index 42dd983..8e64cd4 100644 --- a/ogcp/templates/cache_inspector.html +++ b/ogcp/templates/cache_inspector.html @@ -100,9 +100,9 @@ } function updateChart(ip) { - var totalCache = toGiB(storageData[ip].total, 3); + var totalCache = toGiB(storageData[ip].used + storageData[ip].free, 3); var usedCache = toGiB(storageData[ip].used, 3); - var freeCache = toGiB(storageData[ip].total - storageData[ip].used, 3) + var freeCache = toGiB(storageData[ip].free, 3); cacheChart.data.datasets[0].data = [ usedCache, @@ -134,9 +134,7 @@ $('.badge-pill').each(function(index) { for (var ip in storageData) { if ($(this).html().includes(ip)) { - var totalCache = storageData[ip].total; - var usedCache = storageData[ip].used; - var freeCache = toGiB(totalCache - usedCache, 1) + var freeCache = toGiB(storageData[ip].free, 1) $(this).html($(this).html() + '<br>free: ' + freeCache + ' GiB'); break; } |