feat(web): service page, manual update, jobs list and live job log (#7)

Also publishes the jobs topic on agent revoke and updates the agent
snippet to mount stacks read-write at the same path.
This commit is contained in:
2026-10-12 18:41:46 +02:00
parent 9d3a6f808c
commit 574f425267
11 changed files with 526 additions and 23 deletions
+13
View File
@@ -2,6 +2,7 @@ package web
import (
"strings"
"time"
"github.com/shcizo/package-updater/internal/imageref"
"github.com/shcizo/package-updater/internal/master/model"
@@ -49,3 +50,15 @@ type agentRow struct {
model.Agent
Online bool
}
// jobDuration is how long a job ran, or has been running; "" before it starts.
func jobDuration(j model.Job) string {
if j.StartedAt == nil {
return ""
}
end := time.Now()
if j.FinishedAt != nil {
end = *j.FinishedAt
}
return end.Sub(*j.StartedAt).Round(time.Second).String()
}