mirror of
https://github.com/unraid/webgui.git
synced 2026-01-07 10:10:05 -06:00
Merge pull request #2408 from SimonFair/Fix-Memory-reporting-error-1TiB
Fix: Memory reporting.
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user