feat: implement automatic metrics collection and monitoring system

This commit is contained in:
infosave2007
2025-11-10 15:19:36 +03:00
parent bccd21b0a5
commit 2de1b58fa4
7 changed files with 114 additions and 13 deletions
+10 -1
View File
@@ -597,7 +597,16 @@ Router::get('/clients/{id}/download', function ($params) {
}
$config = $client->getConfig();
$filename = preg_replace('/[^a-zA-Z0-9_-]/', '_', $clientData['name']) . '.conf';
// Check if name contains non-Latin characters
$hasNonLatin = preg_match('/[^a-zA-Z0-9_-]/', $clientData['name']);
if ($hasNonLatin) {
// Use user_(client_id)_s(server_id).conf format for non-Latin names
$filename = 'user_' . $clientData['id'] . '_s' . $clientData['server_id'] . '.conf';
} else {
// Use client name for Latin characters
$filename = $clientData['name'] . '.conf';
}
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename="' . $filename . '"');