mirror of
https://github.com/myronblair/novacpx
synced 2026-06-30 17:50:41 -05:00
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:
@@ -23,8 +23,8 @@ match ($action) {
|
||||
[$k, $v] = preg_split('/\s+/', trim($line), 2);
|
||||
$ram[$k] = (int) $v;
|
||||
}
|
||||
$ramPct = $ram['MemTotal_kB'] ?? 0
|
||||
? round(100 - ($ram['MemAvailable:'] / $ram['MemTotal:']) * 100, 1)
|
||||
$ramPct = isset($ram['MemTotal:'], $ram['MemAvailable:']) && $ram['MemTotal:'] > 0
|
||||
? round((1 - $ram['MemAvailable:'] / $ram['MemTotal:']) * 100, 1)
|
||||
: 0;
|
||||
|
||||
$disk = [];
|
||||
|
||||
Reference in New Issue
Block a user