From f88f2cc1f2e0e8075a7bd9dda79670f945ef3fee Mon Sep 17 00:00:00 2001 From: Steve Cliff Date: Mon, 15 Jun 2026 21:22:42 +0100 Subject: [PATCH] =?UTF-8?q?feat(ui):=20asleep=20state,=2024=C3=977=20chip,?= =?UTF-8?q?=20presence=20toggle=20for=20host=20mode?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/styles/input.css | 1 + web/templates/partials/host_chrome.html | 35 +++++++++++++++++++++++-- web/templates/partials/host_row.html | 14 +++++++--- 3 files changed, 45 insertions(+), 5 deletions(-) diff --git a/web/styles/input.css b/web/styles/input.css index dd1a861..5e1835b 100644 --- a/web/styles/input.css +++ b/web/styles/input.css @@ -70,6 +70,7 @@ .dot-online { background: var(--ok); box-shadow: 0 0 0 3px color-mix(in oklch, var(--ok), transparent 80%); } .dot-degraded { background: var(--warn); box-shadow: 0 0 0 3px color-mix(in oklch, var(--warn), transparent 80%); } .dot-offline { background: var(--off); } + .dot-asleep { background: var(--ink-fade); opacity: 0.6; } .dot-failed { background: var(--bad); box-shadow: 0 0 0 3px color-mix(in oklch, var(--bad), transparent 80%); } .pulse { animation: rm-pulse 2.4s ease-in-out infinite; } @keyframes rm-pulse { diff --git a/web/templates/partials/host_chrome.html b/web/templates/partials/host_chrome.html index 78a85bd..6bc165e 100644 --- a/web/templates/partials/host_chrome.html +++ b/web/templates/partials/host_chrome.html @@ -34,7 +34,11 @@ {{else if eq $host.Status "degraded"}} {{else if eq $host.Status "offline"}} - + {{if $host.AlwaysOn}} + + {{else}} + + {{end}} {{else}} {{end}} @@ -45,6 +49,11 @@ style="padding: 2px 8px; border: 1px dashed var(--line); border-radius: 3px; cursor: pointer;" onclick="document.getElementById('tags-edit-{{$host.ID}}').classList.toggle('hidden')" title="Edit tags">{{if $host.Tags}}edit tags{{else}}add tags{{end}} + {{if $host.AlwaysOn}}24×7{{end}} + {{if gt $page.ScheduleVersion 0}} @@ -80,6 +89,24 @@
Comma-separated. Lowercased automatically.
+ {{/* Presence-mode editor — hidden by default; toggled by the + "presence" button. Checkbox present => always-on (24×7); + unchecked => intermittent (laptop): no offline alerts, shows + "asleep", auto-catches-up a missed backup on reconnect. */}} +
{{$host.OS}}/{{$host.Arch}} · @@ -88,7 +115,11 @@ restic {{if $host.ResticVersion}}{{$host.ResticVersion}}{{else}}—{{end}} · {{if eq $host.Status "offline"}} - last seen {{relTime $host.LastSeenAt}} + {{if $host.AlwaysOn}} + last seen {{relTime $host.LastSeenAt}} + {{else}} + asleep · last seen {{relTime $host.LastSeenAt}} · will catch up on return + {{end}} {{else}} online · last heartbeat {{relTime $host.LastSeenAt}} {{end}} diff --git a/web/templates/partials/host_row.html b/web/templates/partials/host_row.html index d005676..92ba417 100644 --- a/web/templates/partials/host_row.html +++ b/web/templates/partials/host_row.html @@ -8,7 +8,11 @@ {{- else if eq $h.Status "degraded" -}} {{- else if eq $h.Status "offline" -}} - + {{- if $h.AlwaysOn -}} + + {{- else -}} + + {{- end -}} {{- else -}} {{- end -}} @@ -26,7 +30,11 @@ {{- else if eq (deref $h.LastBackupStatus) "cancelled" -}} cancelled · {{relTime $h.LastBackupAt}} {{- else if eq $h.Status "offline" -}} - last seen {{relTime $h.LastSeenAt}} + {{- if $h.AlwaysOn -}} + last seen {{relTime $h.LastSeenAt}} + {{- else -}} + asleep · {{relTime $h.LastSeenAt}} · will catch up on return + {{- end -}} {{- else -}} never run {{- end -}} @@ -53,7 +61,7 @@
{{- if eq $h.Status "offline" -}} - offline + {{if $h.AlwaysOn}}offline{{else}}asleep{{end}} {{- else if $h.CurrentJobID -}} View job → {{- else if .RunAllScheduleID -}}