Repository navigation
feat(vms): envoi direct d'une image depuis la création d'une VM - #50
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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).