Skip to content

feat(vms): envoi direct d'une image depuis la création d'une VM - #50

Merged
inkly merged 4 commits into
mainfrom
feat/vm-image-upload
Oct 21, 2026
Merged

inkly merged 4 commits into
mainfrom
feat/vm-image-upload

Conversation

@inkly

@inkly inkly commented Oct 21, 2026

Copy link
Copy Markdown
Collaborator

Envoi direct d’une image ISO ou disque depuis la création d’une VM : zone de dépôt et bouton, progression (pourcentage, débit, temps restant), annulation, SHA-256 optionnel, image envoyée sélectionnée pour la VM, vérifications avant l’envoi (nom, extension, espace libre) et phrases claires pour chaque refus du serveur. Échap demande confirmation pendant un envoi. Essayé dans un vrai navigateur avec le serveur de substitution (150 Mo).

inkly added 4 commits October 21, 2026 13:39
uploadImage puts the raw file to /v2/virt_management/images/upload with
octet-stream, no timeout, a signal to abort it and the upload progress;
api.put now takes a config. The stub keeps uploaded images, lists them,
and answers every code of the contract by the file name (busy.iso -> 503).
A drop zone and a button take one ISO or disk image, show its name and
size, and send it with an optional SHA-256. What the service would refuse
before reading the body (a name already there, not enough free space with
1 GiB kept, another extension, a bad checksum) is checked first. The bar
shows percent, bytes, speed and time left, drawn twice a second; Cancel
aborts the request. Every code has a sentence in English and French, a
lost connection says the upload was refused or interrupted and asks for
the list again, and leaving the page while it runs warns and aborts.
The create dialog lists the image as soon as it is uploaded and selects
it. While an upload runs, Create is off, and Cancel or Escape asks before
closing and stopping it: the modal stack hands Escape to the component as
a cancelable vm-escape event first.
The name is checked as UploadName checks it (separators, control and
format characters, leading dot, trailing dot or space, Windows device
names, 250 bytes, image extensions) and conflicts only with the very file
the service would write: storage_path/iso/<NFC name>, case and all. The
host gives no filesystem total, so the free space check keeps its 1 GiB
floor as a best effort and the message no longer promises a figure.
Cancel works during the checks, and a cancel that comes after the answer
selects nothing and asks for the list again. too_long and conflict get
sentences of their own; the image hint points to the upload.
@inkly
inkly merged commit 5e2f468 into main Oct 21, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant