Fix total disk storage (#1040)

This commit is contained in:
Charles 2025-03-01 07:30:29 -05:00 committed by GitHub
parent d8e8240756
commit d79d461e7c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -89,8 +89,10 @@ class ServerOverview extends StatsOverviewWidget
return 'Unavailable'; return 'Unavailable';
} }
$totalBytes = $this->server->disk * (config('panel.use_binary_prefix') ? 1024 * 1024 : 1000 * 1000);
$used = convert_bytes_to_readable($disk); $used = convert_bytes_to_readable($disk);
$total = convert_bytes_to_readable($this->server->disk); $total = convert_bytes_to_readable($totalBytes);
return $used . ($this->server->disk > 0 ? ' / ' . $total : ' / ∞'); return $used . ($this->server->disk > 0 ? ' / ' . $total : ' / ∞');
} }