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:
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user