// Overview Page Module class OverviewPage { constructor() { this.stats = null; this.charts = {}; this.init(); } async init() { // Load data await this.loadStats(); await this.loadCharts(); await this.loadRecentRequests(); // Setup event listeners this.setupEventListeners(); // Subscribe to WebSocket updates this.setupWebSocketSubscriptions(); } async loadStats() { try { // In a real app, this would fetch from /api/usage/summary // For now, use mock data this.stats = { totalRequests: 12458, totalTokens: 1254300, totalCost: 125.43, activeClients: 8, errorRate: 2.3, avgResponseTime: 450, todayRequests: 342, todayCost: 12.45 }; this.renderStats(); } catch (error) { console.error('Error loading stats:', error); this.showError('Failed to load statistics'); } } renderStats() { const container = document.getElementById('overview-stats'); if (!container) return; container.innerHTML = `