async function loadHistory() { try { const resp = await fetch(`${API_BASE}/api/history`); if (!resp.ok) return; const reports = await resp.json(); const container = document.getElementById('history-list'); if (reports.length === 0) { container.innerHTML = '
Aucun rapport disponible
'; return; } let html = ''; reports.forEach(r => { const isoText = r.isotopes.length > 0 ? r.isotopes.join(', ') : 'background uniquement'; html += `Live time: ${r.live_time_hours.toFixed(1)}h | Total: ${r.total_counts} coups
Isotopes: ${isoText}
Background: ${r.background_subtracted ? 'soustrait' : 'non soustrait'}