Show progress for uploads and updates, and reload when they are done

An uploaded bundle gets a progress bar over the page; a running update an
overlay that follows its steps. A page that finished working, or that was sent
to the login page by a restart, is loaded whole.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AeFqV9dZrK6nipHkPfyM4F
This commit is contained in:
2026-11-18 10:03:53 +01:00
co-authored by Claude Sonnet 5.5
parent adb804570a
commit 55cf5f71c9
7 changed files with 139 additions and 5 deletions
+19
View File
@@ -244,3 +244,22 @@ func TestUpdateUploadAndInstall(t *testing.T) {
t.Fatalf("the page lacks the saved server:\n%s", page)
}
}
func TestUpdateProgress(t *testing.T) {
log := ""
last := 0
for _, step := range []struct{ line, what string }{
{"", "Starting"},
{"router-update: verifying /nix/store/x-release\n", "Verifying the signature"},
{"router-update: importing it\n", "Importing the release"},
{"router-update: installed 0.1.0, update 0.2.0\n", "Checking the version"},
{"router-update: building and activating 0.2.0\nbuilding the system\n", "Building and activating the new version"},
} {
log += step.line
pct, what := updateProgress(log)
if what != step.what || pct <= last {
t.Fatalf("after %q: %d%% %q (before: %d%%)", step.line, pct, what, last)
}
last = pct
}
}