From 05b5c376e9f4eae187f01533b2bce99710f2b80a Mon Sep 17 00:00:00 2001 From: Broque Thomas <26755000+Nezreka@users.noreply.github.com> Date: Sat, 7 Mar 2026 11:49:15 -0800 Subject: [PATCH] update automation status ever 1s --- webui/static/script.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/webui/static/script.js b/webui/static/script.js index f073c010..b1c11942 100644 --- a/webui/static/script.js +++ b/webui/static/script.js @@ -43432,7 +43432,7 @@ function renderAutomationCard(a) { const metaParts = []; if (a.last_run) metaParts.push('Last: ' + _autoTimeAgo(a.last_run)); const _timerTriggers = ['schedule', 'daily_time', 'weekly_time']; - if (a.next_run && a.enabled && _timerTriggers.includes(a.trigger_type)) metaParts.push('Next: ' + _autoTimeUntil(a.next_run)); + if (a.next_run && a.enabled && _timerTriggers.includes(a.trigger_type)) metaParts.push('Next: ' + _autoTimeUntil(a.next_run) + ''); if (!_timerTriggers.includes(a.trigger_type) && a.enabled) metaParts.push('Listening'); if (a.run_count) metaParts.push('Runs: ' + a.run_count + ''); if (a.last_error) metaParts.push('Error: ' + _esc(a.last_error)); @@ -43534,6 +43534,13 @@ function _autoTimeUntil(ts) { return 'in ' + Math.round(d/86400) + 'd'; } +// --- Live countdown for "Next: in Xs" --- +setInterval(() => { + document.querySelectorAll('.auto-next-run[data-next]').forEach(el => { + el.textContent = 'Next: ' + _autoTimeUntil(el.dataset.next); + }); +}, 1000); + // --- CRUD --- async function deleteAutomation(id, name) {