Update ashboard, dashboard (~2)

This commit is contained in:
Echo
2026-02-15 23:28:42 +00:00
parent 22806c826b
commit 5ed4757e20
2 changed files with 19 additions and 22 deletions

View File

@@ -649,10 +649,6 @@
<i data-lucide="refresh-cw"></i>
Refresh
</button>
<button class="btn btn-secondary btn-warning" onclick="restartTaskboard()" title="Restart Taskboard">
<i data-lucide="rotate-cw"></i>
Restart TB
</button>
</div>
<!-- Services -->
@@ -1241,24 +1237,6 @@
}
}
// ── Taskboard Restart ─────────────────────────────────────
async function restartTaskboard() {
if (!confirm('Restart taskboard? Pagina va fi indisponibila ~5 secunde.')) return;
try {
await fetch('/echo/api/eco/restart-taskboard', { method: 'POST' });
} catch (e) { /* expected — server dies */ }
// Wait for restart, then reload
setTimeout(() => {
const check = setInterval(async () => {
try {
const r = await fetch('/echo/api/status');
if (r.ok) { clearInterval(check); location.reload(); }
} catch (e) { /* still restarting */ }
}, 1000);
}, 2000);
}
// ── Init ────────────────────────────────────────────────
loadStatus();

View File

@@ -1100,6 +1100,9 @@
<button class="btn btn-icon" onclick="gitCommit()" title="Git Commit">
<i data-lucide="git-commit"></i>
</button>
<button class="btn btn-icon" onclick="restartTaskboard()" title="Restart Taskboard">
<i data-lucide="rotate-cw"></i>
</button>
<button class="btn btn-icon" onclick="refreshStatus()" title="Refresh">
<i data-lucide="refresh-cw"></i>
</button>
@@ -1507,6 +1510,22 @@
updateStatusSummary();
}
async function restartTaskboard() {
if (!confirm('Restart taskboard? Pagina va fi indisponibilă ~5 secunde.')) return;
showToast('Se restartează taskboard...', 'info');
try {
await fetch('/echo/api/eco/restart-taskboard', { method: 'POST' });
} catch (e) { /* expected — server dies */ }
setTimeout(() => {
const check = setInterval(async () => {
try {
const r = await fetch('/echo/api/status');
if (r.ok) { clearInterval(check); location.reload(); }
} catch (e) { /* still restarting */ }
}, 1000);
}, 2000);
}
async function gitCommit() {
if (!confirm('Fac commit și push la toate modificările?')) return;
showToast('Se execută commit...', 'info');