async function api(url, options = {}) { const response = await fetch(url, options); return await response.json(); } async function loadStatus() { const data = await api('/api/system/status'); document.getElementById('systemStatus').innerHTML = `
Project${data.project}
Version${data.version}
OpenAI${data.openai_configured ? 'Configured' : 'Not configured'}
Model${data.openai_model}
`; } async function analyzeProject() { const repo_url = document.getElementById('repoUrl').value; document.getElementById('projectResult').innerText = 'Analyzing repository...'; const data = await api('/api/projects/analyze', { method: 'POST', headers: {'Content-Type': 'application/json'}, body: JSON.stringify({ repo_url }) }); document.getElementById('projectResult').innerText = JSON.stringify(data, null, 2); } async function adbDevices() { const data = await api('/api/android/devices', { method: 'POST' }); document.getElementById('adbResult').innerText = data.stdout || data.stderr; } loadStatus();