populate diskImageSelect with options

Signed-off-by: Arthur Lu <learthurgo@gmail.com>
This commit is contained in:
Arthur Lu 2023-01-17 10:59:06 -08:00
parent a4b7d7fd3e
commit 0bfe716ecb

View File

@ -167,8 +167,9 @@ async function addDiskLine (fieldset, busPrefix, busName, device, diskDataParsed
let diskImageSelect = document.createElement("select"); let diskImageSelect = document.createElement("select");
let diskImageOptions = await request(`/nodes/${node}/storage/${storage}/content?content=iso`); let diskImageOptions = await request(`/nodes/${node}/storage/${storage}/content?content=iso`);
diskImageOptions.data.forEach((element) => { diskImageOptions.data.forEach((element) => {
diskImageSelect.add(new Option(element.replace(`${storage}:`), element)); diskImageSelect.add(new Option(element.volid.replace(`${storage}:`), element.volid));
}); });
diskImageSelect.value = diskDataParsed.filename;
field.append(diskImageSelect); field.append(diskImageSelect);
let blank = document.createElement("div"); let blank = document.createElement("div");