Can enable autostart of VMs
This commit is contained in:
@ -12,6 +12,8 @@ import { AsyncWidget } from "../AsyncWidget";
|
||||
import React from "react";
|
||||
import { filesize } from "filesize";
|
||||
import { VMDisksList } from "../forms/VMDisksList";
|
||||
import { VMSelectIsoInput } from "../forms/VMSelectIsoInput";
|
||||
import { VMAutostartInput } from "../forms/VMAutostartInput";
|
||||
|
||||
interface DetailsProps {
|
||||
vm: VMInfo;
|
||||
@ -32,13 +34,13 @@ export function VMDetails(p: DetailsProps): React.ReactElement {
|
||||
loadKey={"1"}
|
||||
load={load}
|
||||
errMsg="Failed to load the list of ISO files"
|
||||
build={() => <VMDetailsInner iso={list!} {...p} />}
|
||||
build={() => <VMDetailsInner isoList={list!} {...p} />}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
function VMDetailsInner(
|
||||
p: DetailsProps & { iso: IsoFile[] }
|
||||
p: DetailsProps & { isoList: IsoFile[] }
|
||||
): React.ReactElement {
|
||||
return (
|
||||
<Grid container spacing={2}>
|
||||
@ -154,27 +156,20 @@ function VMDetailsInner(
|
||||
p.onChange?.();
|
||||
}}
|
||||
/>
|
||||
|
||||
{p.vm.uuid && <VMAutostartInput editable={p.editable} vm={p.vm} />}
|
||||
</EditSection>
|
||||
|
||||
{/* Storage section */}
|
||||
<EditSection title="Storage">
|
||||
<SelectInput
|
||||
label="ISO file"
|
||||
<VMSelectIsoInput
|
||||
editable={p.editable}
|
||||
isoList={p.isoList}
|
||||
value={p.vm.iso_file}
|
||||
onValueChange={(v) => {
|
||||
onChange={(v) => {
|
||||
p.vm.iso_file = v;
|
||||
p.onChange?.();
|
||||
}}
|
||||
options={[
|
||||
{ label: "None", value: undefined },
|
||||
...p.iso.map((i) => {
|
||||
return {
|
||||
label: `${i.filename} ${filesize(i.size)}`,
|
||||
value: i.filename,
|
||||
};
|
||||
}),
|
||||
]}
|
||||
/>
|
||||
<VMDisksList vm={p.vm} editable={p.editable} onChange={p.onChange} />
|
||||
</EditSection>
|
||||
|
Reference in New Issue
Block a user