feat: implement automatic metrics collection and monitoring system
This commit is contained in:
+10
-1
@@ -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 . '"');
|
||||
|
||||
Reference in New Issue
Block a user