diff --git a/webui/app.js b/webui/app.js index 87ebaa9..ce30470 100644 --- a/webui/app.js +++ b/webui/app.js @@ -524,6 +524,7 @@ function renderContinuous(accountId, data) { panel.querySelector('.continuous-last-iteration').textContent = status.last_iteration_at ? `${relativeTime(status.last_iteration_at)} (${displayTime(status.last_iteration_at)})` : '-'; + panel.querySelector('.continuous-next-run').textContent = nextContinuousRunLabel(config, status); panel.querySelector('.continuous-last-error').textContent = status.last_error || '-'; // Logs @@ -596,6 +597,19 @@ function normalizeLogEntry(entry) { }; } +function nextContinuousRunLabel(config, status) { + if (!config.enabled) return '-'; + if (status.running) return 'running now'; + const baseValue = status.last_iteration_at || status.last_finished_at || status.last_started_at; + if (!baseValue) return 'pending'; + const baseDate = new Date(baseValue); + if (Number.isNaN(baseDate.getTime())) return 'pending'; + const intervalMs = Math.max(1, Number(config.interval_minutes || 1)) * 60 * 1000; + const nextDate = new Date(baseDate.getTime() + intervalMs); + if (nextDate.getTime() <= Date.now()) return 'due now'; + return displayTime(nextDate.toISOString()); +} + function renderSummary(accountId, data) { const panel = document.getElementById(`panel-${accountId}`); if (!panel) return; diff --git a/webui/index.html b/webui/index.html index 6b41ce6..e454a5e 100644 --- a/webui/index.html +++ b/webui/index.html @@ -259,6 +259,7 @@