diff --git a/web/skins/classic/includes/functions.php b/web/skins/classic/includes/functions.php index b346f9460..1b01a73e8 100644 --- a/web/skins/classic/includes/functions.php +++ b/web/skins/classic/includes/functions.php @@ -463,7 +463,7 @@ function getRamHTML() { if ( !canView('System') ) return $result; $contents = file_get_contents('/proc/meminfo'); preg_match_all('/(\w+):\s+(\d+)\s/', $contents, $matches); - $meminfo = array_combine($matches[1], $matches[2]); + $meminfo = array_combine($matches[1], array_map(function($v){return 1024*$v;}, $matches[2])); $mem_used = $meminfo['MemTotal'] - $meminfo['MemFree'] - $meminfo['Buffers'] - $meminfo['Cached']; $mem_used_percent = (int)(100*$mem_used/$meminfo['MemTotal']); $used_class = ''; @@ -481,9 +481,9 @@ function getRamHTML() { $swap_class = 'text-warning'; } - $result .= ' '.PHP_EOL; return $result;