Disks: Disable 'Size' field when selecting 'Make disk read-only' and 'Image'/'Snapshot' as a source

Aperta Adatta ai principianti
#3,391 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
72/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
typescript
Ambito
frontend

Direzione di ricerca

Inizia dal modulo disks-new a cui fa riferimento l’issue e segui i controlli Size, source e read-only. Rendi il campo Size non disponibile quando un disco read-only usa una sorgente Image o Snapshot, quindi verifica che questa combinazione non consenta più di inviare una dimensione non corrispondente.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

What happened

Currently, when creating a disk, the 'Size' field comes before the list of Sources. One of the options to choose from is that of an Image, followed by a checkbox to make the disk read only. However, if the source is an Image or a Snapshot, the size the user needs to type in must match the one from the source. If it does not, then they get an error. One way to cope with this could be to disable the Size field once the 'Make disk read-only' and source 'Image' or 'Snapshot' has been selected.

If the size could be retrieved after setting these, then the user wouldn't have to see this error at all.
Moreover, the error messages shows the size in bytes and Size field is in GiB (so a user can't just copy and paste the value printed in the error message).

Image
Browser console output
main.tsx:31 Oxide Web Console version https://github.com/oxidecomputer/console/commits/fc3d969eb0e692f2982964405944fcc221fb7bc4
/v1/disks?project=verdant-df:1  Failed to load resource: the server responded with a status of 400 ()
client.ts:165 More info about API 400 on /projects/verdant-df/disks-new

API URL:        https://oxide.sys.rack2.eng.oxide.computer/v1/disks?project=verdant-df
Request ID:     ac7c6b2a-53f3-4e5c-8bd5-8d3490ec0c0c
Error code:     InvalidRequest
Error message:  Read-only disk size 21474836480 must be equal to source image size 10737418240


(anonymous) @ client.ts:165
/v1/disks?project=verdant-df:1  Failed to load resource: the server responded with a status of 400 ()
client.ts:165 More info about API 400 on /projects/verdant-df/disks-new

API URL:        https://oxide.sys.rack2.eng.oxide.computer/v1/disks?project=verdant-df
Request ID:     9016a82a-21cc-4451-a447-db6e2931ae2b
Error code:     InvalidRequest
Error message:  Read-only disk size 21474836480 must be equal to source snapshot size 10737418240


(anonymous) @ client.ts:165
Console version

https://github.com/oxidecomputer/console/commits/fc3d969eb0e692f2982964405944fcc221fb7bc4

What system are you on?

racklette

System version

No response

Lingua principale
TypeScript
Stelle
228
Fork
22
Merge medio
19h 42m
PR unite (30g)
32

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di oxidecomputer/console

Tutte le issue di oxidecomputer/console

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.