fix: stats.php RAM% calculation key typo (MemTotal: not MemTotal_kB)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-08 03:01:39 +00:00
parent c0c9865653
commit d49095f4e8
+2 -2
View File
@@ -23,8 +23,8 @@ match ($action) {
[$k, $v] = preg_split('/\s+/', trim($line), 2); [$k, $v] = preg_split('/\s+/', trim($line), 2);
$ram[$k] = (int) $v; $ram[$k] = (int) $v;
} }
$ramPct = $ram['MemTotal_kB'] ?? 0 $ramPct = isset($ram['MemTotal:'], $ram['MemAvailable:']) && $ram['MemTotal:'] > 0
? round(100 - ($ram['MemAvailable:'] / $ram['MemTotal:']) * 100, 1) ? round((1 - $ram['MemAvailable:'] / $ram['MemTotal:']) * 100, 1)
: 0; : 0;
$disk = []; $disk = [];