diff --git a/virtweb_frontend/src/widgets/forms/VMSelectIsoInput.tsx b/virtweb_frontend/src/widgets/forms/VMSelectIsoInput.tsx index e33553a..7386e63 100644 --- a/virtweb_frontend/src/widgets/forms/VMSelectIsoInput.tsx +++ b/virtweb_frontend/src/widgets/forms/VMSelectIsoInput.tsx @@ -23,27 +23,6 @@ export function VMSelectIsoInput(p: { return ( <> - { - if (v) { - p.attachedISOs.push(v); - p.onChange(p.attachedISOs); - } - }} - options={[ - { label: "None", value: undefined }, - ...p.isoList.map((i) => { - return { - label: `${i.filename} ${filesize(i.size)}`, - value: i.filename, - }; - }), - ]} - /> - {p.attachedISOs.map((isoName, num) => { const iso = p.isoList.find((d) => d.filename === isoName); return ( @@ -78,6 +57,27 @@ export function VMSelectIsoInput(p: { ); })} + + { + if (v) { + p.attachedISOs.push(v); + p.onChange(p.attachedISOs); + } + }} + options={[ + { label: "None", value: undefined }, + ...p.isoList.map((i) => { + return { + label: `${i.filename} ${filesize(i.size)}`, + value: i.filename, + }; + }), + ]} + /> ); } diff --git a/virtweb_frontend/src/widgets/vms/VMDetails.tsx b/virtweb_frontend/src/widgets/vms/VMDetails.tsx index 3c6dd20..10b7449 100644 --- a/virtweb_frontend/src/widgets/vms/VMDetails.tsx +++ b/virtweb_frontend/src/widgets/vms/VMDetails.tsx @@ -258,22 +258,31 @@ function VMDetailsTabGeneral(p: DetailsInnerProps): React.ReactElement { ); } +/** + * Storage section + */ function VMDetailsTabStorage(p: DetailsInnerProps): React.ReactElement { return ( - {/* Storage section */} - - { - p.vm.iso_files = v; - p.onChange?.(); - }} - /> - - + {p.editable && p.vm.disks.length > 0 && ( + + + + )} + + {(p.editable || p.vm.iso_files.length > 0) && ( + + { + p.vm.iso_files = v; + p.onChange?.(); + }} + /> + + )} ); }