From 2e7ab3235a08ab2f29f1bb968ef936045e1225fd Mon Sep 17 00:00:00 2001 From: librelad Date: Thu, 28 May 2026 01:50:49 +0100 Subject: [PATCH] ux(backup): next-run hint in the Backup status card header MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Backup status card sat with just a heading + tooltip on the right; the Locations card on the same row already had a hint pill ("Active destinations"). Mirror that pattern: show the next scheduled backup time pushed to the right of the heading, so the user can see at a glance when the daily run will fire without digging into Configuration. Derived purely client-side from CFG_BACKUP_CRONTAB_APP (read off the already-loaded window.systemConfigs map) — no backend surface needed: - nextCronFireTime(expr) parses a 5-field crontab (minute hour dom month dow) supporting *, N, lists (N,M,O), ranges (N-M), and steps (* /N, N-M/S). Walks one minute at a time from now+1, honours the POSIX OR rule for DOM+DOW, caps at 366 days so an unmatchable expression doesn't loop forever, returns null on bad syntax so the UI falls back gracefully. - formatRelativeFuture(when) — formatRelative's future-tense sibling: "in 6h", "tomorrow", "in 3d". - formatScheduleClock(when) — "at 05:00" today, "Mon 05:00" otherwise. Hint slot rendered in #backup-next-run. Three states: - parseable + computable "Next backup tomorrow · at 05:00" + title with absolute time + schedule - unparseable schedule "Schedule: " with title hint - empty CFG_BACKUP_CRONTAB_APP "No schedule set" with title hint Smoke-tested the cron parser against "0 5 * * *", "*/15 * * * *", "30 23 * * 0", "0 0 1 * *", "", "garbage", and "0 5 * *" (4 fields). Signed-off-by: librelad --- .../frontend/html/backup-content.html | 1 + .../js/components/backup/backup-page.js | 138 ++++++++++++++++++ 2 files changed, 139 insertions(+) diff --git a/containers/libreportal/frontend/html/backup-content.html b/containers/libreportal/frontend/html/backup-content.html index 6945117..d1679a0 100644 --- a/containers/libreportal/frontend/html/backup-content.html +++ b/containers/libreportal/frontend/html/backup-content.html @@ -84,6 +84,7 @@

Backup status ℹ️

+