// Overview Page Module class OverviewPage { constructor() { this.stats = null; this.charts = {}; this.init(); } async init() { // Load data await Promise.all([ this.loadStats(), this.loadCharts(), this.loadRecentRequests() ]); // Setup event listeners this.setupEventListeners(); // Subscribe to WebSocket updates this.setupWebSocketSubscriptions(); } async loadStats() { try { const data = await window.api.get('/usage/summary'); this.stats = data; 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 || !this.stats) return; container.innerHTML = `
${request.model}