- Add SQLite schema for proxy metrics and traffic logs - Implement ProxyMetricsRepo with historical aggregates - Add TrafficLogsRepo for DB-backed traffic log queries - Create proxy-advanced IPC handlers (metrics, traffic logs, circuit breaker, parity) - Add ProxyMetricsService with connection snapshots and cleanup - Add ProxyReplayService and ProxyIdeConfigService - Implement MonitorTab and ToolsTab for advanced proxy features - Add TrafficLogTable with sorting and filtering - Fix i18n keys for proxy metrics - Fix generateIdeConfig type mapping - Update proxy routes with advanced tab integration
32 lines
1.1 KiB
TypeScript
32 lines
1.1 KiB
TypeScript
/**
|
|
* Service registry for proxy-advanced IPC handlers to access
|
|
* NestJS service instances without DI coupling.
|
|
*
|
|
* Services auto-register on construction.
|
|
*/
|
|
import type { TokenManagerService } from '../../server/modules/proxy/token-manager.service';
|
|
import type { ProxyMetricsService } from '../../server/modules/proxy/proxy-metrics.service';
|
|
import type { ProxyReplayService } from '../../server/modules/proxy/proxy-replay.service';
|
|
import type { ProxyIdeConfigService } from '../../server/modules/proxy/proxy-ide-config.service';
|
|
|
|
interface ProxyAdvancedRegistry {
|
|
tokenManager: TokenManagerService | null;
|
|
proxyMetrics: ProxyMetricsService | null;
|
|
proxyReplay: ProxyReplayService | null;
|
|
proxyIdeConfig: ProxyIdeConfigService | null;
|
|
}
|
|
|
|
export const proxyAdvancedRegistry: ProxyAdvancedRegistry = {
|
|
tokenManager: null,
|
|
proxyMetrics: null,
|
|
proxyReplay: null,
|
|
proxyIdeConfig: null,
|
|
};
|
|
|
|
export function registerProxyAdvancedService<K extends keyof ProxyAdvancedRegistry>(
|
|
key: K,
|
|
instance: ProxyAdvancedRegistry[K],
|
|
): void {
|
|
proxyAdvancedRegistry[key] = instance;
|
|
}
|