diff --git a/public/index.html b/public/index.html index 3fdfc84..4c29449 100644 --- a/public/index.html +++ b/public/index.html @@ -1326,7 +1326,15 @@ scheduleDesc = `Cron: ${s.schedule_value}`; } - const nextRun = safeDate(s.next_run)?.toLocaleString() ?? 'Not scheduled'; + const nextRunDate = safeDate(s.next_run); + const nextRunIn = nextRunDate ? (() => { + const secs = Math.round((nextRunDate - Date.now()) / 1000); + if (secs <= 0) return 'now'; + if (secs < 60) return `${secs}s`; + if (secs < 3600) return `${Math.round(secs/60)}m`; + return `${Math.round(secs/3600)}h`; + })() : null; + const nextRun = nextRunDate ? `${nextRunDate.toLocaleString()}${nextRunIn ? ` (in ${nextRunIn})` : ''}` : 'Not scheduled'; const lastRun = safeDate(s.last_run)?.toLocaleString() ?? 'Never'; return ` @@ -2635,6 +2643,10 @@ } function showCreateWorkflow() { + document.getElementById('workflowName').value = ''; + document.getElementById('workflowDescription').value = ''; + document.getElementById('workflowDefinition').value = ''; + document.getElementById('workflowWebhookUrl').value = ''; document.getElementById('createWorkflowModal').classList.add('show'); } @@ -3038,10 +3050,8 @@ // Close any open modal on ESC key document.addEventListener('keydown', (e) => { if (e.key === 'Escape') { - document.querySelectorAll('.modal').forEach(modal => { - if (modal.style.display && modal.style.display !== 'none') { - modal.style.display = 'none'; - } + document.querySelectorAll('.modal.show').forEach(modal => { + modal.classList.remove('show'); }); } });