显示客户端链接的ip:port

This commit is contained in:
YHH
2025-10-16 17:33:43 +08:00
parent 43bdd7e43b
commit 3cda3c2238
8 changed files with 156 additions and 19 deletions

View File

@@ -64,6 +64,7 @@ export class ProfilerService {
private currentData: ProfilerData | null = null;
private checkServerInterval: NodeJS.Timeout | null = null;
private reconnectTimeout: NodeJS.Timeout | null = null;
private clientIdMap: Map<string, string> = new Map(); // 客户端地址 -> 客户端ID映射
constructor() {
const settings = SettingsService.getInstance();
@@ -370,11 +371,14 @@ export class ProfilerService {
}
}
const clientId = data.clientId || data.client_id || 'unknown';
window.dispatchEvent(new CustomEvent('profiler:remote-log', {
detail: {
level,
message,
timestamp: data.timestamp ? new Date(data.timestamp) : new Date()
timestamp: data.timestamp ? new Date(data.timestamp) : new Date(),
clientId
}
}));
}