/** * Services Page - Technical Indicator Services */ class ServicesPage { constructor() { this.services = []; this.currentCategory = 'all'; this.currentSymbol = 'BTC'; this.currentTimeframe = '1h'; } async init() { console.log('[Services] Initializing...'); this.bindEvents(); await this.loadServices(); this.checkUrlParams(); console.log('[Services] Ready'); } bindEvents() { // Refresh button document.getElementById('refresh-btn')?.addEventListener('click', () => { this.loadServices(); }); // Symbol input document.getElementById('symbol-input')?.addEventListener('change', (e) => { this.currentSymbol = e.target.value.toUpperCase() || 'BTC'; }); // Timeframe select document.getElementById('timeframe-select')?.addEventListener('change', (e) => { this.currentTimeframe = e.target.value || '1h'; }); // Analyze all button document.getElementById('analyze-all-btn')?.addEventListener('click', () => { this.analyzeAll(); }); // Category buttons document.querySelectorAll('.category-btn').forEach(btn => { btn.addEventListener('click', (e) => { document.querySelectorAll('.category-btn').forEach(b => b.classList.remove('active')); e.target.classList.add('active'); this.currentCategory = e.target.dataset.category; this.filterServices(); }); }); } checkUrlParams() { const params = new URLSearchParams(window.location.search); const service = params.get('service'); if (service) { // Auto-analyze the specific service setTimeout(() => { this.analyzeService(service); }, 500); } } async loadServices() { const grid = document.getElementById('services-grid'); if (!grid) return; grid.innerHTML = `
Loading indicator services...
No indicator services match the selected category.
${service.description}
Analyzing ${this.currentSymbol} with ${serviceId}...
${error.message}
Running comprehensive analysis on ${this.currentSymbol}...
${errorMessage}
${result.description || 'No description available'}
Recommendation: ${result.recommendation || 'No recommendation available'}
No data
'}