Loading html/cluster.html +21 −0 Original line number Diff line number Diff line Loading @@ -131,7 +131,10 @@ async function loadClusterStatus() { apiFetch('/api/cluster/stores') ]); if (!health || !stores) return; renderClusterData(health, stores); } function renderClusterData(health, stores) { const summary = document.getElementById('summary'); summary.innerHTML = ''; Loading Loading @@ -424,6 +427,24 @@ document.getElementById('btnVacuum').onclick = async () => { if (!getToken()) { location.href = '/login.html'; } else { loadClusterStatus(); } // Auto-refresh every 2s while an import is running let importPollTimer = null; loadClusterStatus = async function() { const [health, stores] = await Promise.all([ apiFetch('/api/cluster/status'), apiFetch('/api/cluster/stores') ]); if (!health || !stores) return; renderClusterData(health, stores); if (health.import_running && !importPollTimer) { importPollTimer = setInterval(() => loadClusterStatus(), 2000); } else if (!health.import_running && importPollTimer) { clearInterval(importPollTimer); importPollTimer = null; } }; </script> </body> </html> Loading
html/cluster.html +21 −0 Original line number Diff line number Diff line Loading @@ -131,7 +131,10 @@ async function loadClusterStatus() { apiFetch('/api/cluster/stores') ]); if (!health || !stores) return; renderClusterData(health, stores); } function renderClusterData(health, stores) { const summary = document.getElementById('summary'); summary.innerHTML = ''; Loading Loading @@ -424,6 +427,24 @@ document.getElementById('btnVacuum').onclick = async () => { if (!getToken()) { location.href = '/login.html'; } else { loadClusterStatus(); } // Auto-refresh every 2s while an import is running let importPollTimer = null; loadClusterStatus = async function() { const [health, stores] = await Promise.all([ apiFetch('/api/cluster/status'), apiFetch('/api/cluster/stores') ]); if (!health || !stores) return; renderClusterData(health, stores); if (health.import_running && !importPollTimer) { importPollTimer = setInterval(() => loadClusterStatus(), 2000); } else if (!health.import_running && importPollTimer) { clearInterval(importPollTimer); importPollTimer = null; } }; </script> </body> </html>