Refacto storage tab
This commit is contained in:
parent
767d2015df
commit
a8046ebff8
@ -23,27 +23,6 @@ export function VMSelectIsoInput(p: {
|
||||
|
||||
return (
|
||||
<>
|
||||
<SelectInput
|
||||
label="Attach an ISO file"
|
||||
editable={p.editable}
|
||||
value={undefined}
|
||||
onValueChange={(v) => {
|
||||
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: {
|
||||
</ListItem>
|
||||
);
|
||||
})}
|
||||
|
||||
<SelectInput
|
||||
label="Attach an ISO file"
|
||||
editable={p.editable}
|
||||
value={undefined}
|
||||
onValueChange={(v) => {
|
||||
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,
|
||||
};
|
||||
}),
|
||||
]}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
@ -258,11 +258,20 @@ function VMDetailsTabGeneral(p: DetailsInnerProps): React.ReactElement {
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Storage section
|
||||
*/
|
||||
function VMDetailsTabStorage(p: DetailsInnerProps): React.ReactElement {
|
||||
return (
|
||||
<Grid container spacing={2}>
|
||||
{/* Storage section */}
|
||||
<EditSection title="Storage">
|
||||
{p.editable && p.vm.disks.length > 0 && (
|
||||
<EditSection title="Disks storage">
|
||||
<VMDisksList {...p} />
|
||||
</EditSection>
|
||||
)}
|
||||
|
||||
{(p.editable || p.vm.iso_files.length > 0) && (
|
||||
<EditSection title="ISO storage">
|
||||
<VMSelectIsoInput
|
||||
editable={p.editable}
|
||||
isoList={p.isoList}
|
||||
@ -272,8 +281,8 @@ function VMDetailsTabStorage(p: DetailsInnerProps): React.ReactElement {
|
||||
p.onChange?.();
|
||||
}}
|
||||
/>
|
||||
<VMDisksList {...p} />
|
||||
</EditSection>
|
||||
)}
|
||||
</Grid>
|
||||
);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user