feat: Implement server and client metrics collection and monitoring

- Added a new PHP script for collecting server metrics every 30 seconds.
- Created a ServerMonitoring class to handle metrics collection for CPU, RAM, Disk, and Network.
- Introduced database tables for storing server and client metrics.
- Updated server view template to display real-time metrics using Chart.js.
- Added translations for monitoring UI elements.
- Created a new monitoring template for detailed server metrics visualization.
- Implemented client speed tracking and display in the monitoring UI.
This commit is contained in:
infosave2007
2025-11-08 15:35:17 +03:00
parent 932a893d69
commit 7c9136152b
11 changed files with 1545 additions and 26 deletions
+3 -7
View File
@@ -689,15 +689,11 @@ class VpnClient {
}
/**
* Format bytes to human-readable string
* Format bytes to human-readable string (always in MB)
*/
private function formatBytes(int $bytes): string {
if ($bytes === 0) return '0 B';
$units = ['B', 'KB', 'MB', 'GB', 'TB'];
$i = floor(log($bytes) / log(1024));
return round($bytes / pow(1024, $i), 2) . ' ' . $units[$i];
$mb = $bytes / 1048576; // 1024 * 1024
return number_format($mb, 2) . ' MB';
}
/**