Add upload progress bar with SSE extraction status
build-and-push / test (push) Successful in 40s
build-and-push / build-and-push (push) Successful in 1m8s

ISO uploads now show a progress bar during file transfer (via XHR
upload.onprogress) and real-time extraction status (via SSE events
through the existing Hub). Falls back to plain form POST if JS is
disabled.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-10 19:16:19 -04:00
parent 4774600040
commit 443a3db9e1
6 changed files with 200 additions and 22 deletions
+6 -5
View File
@@ -18,10 +18,11 @@ type Service struct {
}
type UploadParams struct {
Name string
Kind string
Version string
ISO io.Reader
Name string
Kind string
Version string
ISO io.Reader
OnProgress ProgressFunc
}
var slugRegex = regexp.MustCompile(`^[a-z0-9][a-z0-9.-]*$`)
@@ -46,7 +47,7 @@ func (s *Service) Upload(ctx context.Context, p UploadParams) (*model.Image, err
return nil, fmt.Errorf("create image dir: %w", err)
}
result, err := ExtractFromISO(p.ISO, destDir)
result, err := ExtractFromISOWithProgress(p.ISO, destDir, p.OnProgress)
if err != nil {
os.RemoveAll(destDir)
return nil, fmt.Errorf("extract ISO: %w", err)