From b19a8ecc3c6f62394180cc83f4c33b0cc946cbc3 Mon Sep 17 00:00:00 2001 From: SimonFair <39065407+SimonFair@users.noreply.github.com> Date: Sun, 28 Sep 2025 16:56:28 +0100 Subject: [PATCH] Fix Memory reporting. --- emhttp/plugins/dynamix/DashStats.page | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/emhttp/plugins/dynamix/DashStats.page b/emhttp/plugins/dynamix/DashStats.page index b685ad91f..5522666ae 100755 --- a/emhttp/plugins/dynamix/DashStats.page +++ b/emhttp/plugins/dynamix/DashStats.page @@ -169,11 +169,16 @@ foreach ($memory_array as $device) { if ($base>=1) $memory_maximum += $size*pow(1024,$base); if (!$ecc && isset($device['Error Correction Type']) && $device['Error Correction Type']!='None') $ecc = "{$device['Error Correction Type']} "; } +if ($memory_installed >= 1048576) { + $memory_installed = round($memory_installed/1048576); + $memory_maximum = round($memory_maximum/1048576); + $unit = 'TiB'; +} else { if ($memory_installed >= 1024) { $memory_installed = round($memory_installed/1024); $memory_maximum = round($memory_maximum/1024); - $unit = 'GiB'; -} else $unit = 'MiB'; + $unit = 'GiB';} +else $unit = 'MiB'; } // get system resources size exec("df --output=size /boot /var/log /var/lib/docker 2>/dev/null|awk '(NR>1){print $1*1024}'",$df);