Update ashboard, dashboard (~2)
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user