From 619003616a35becde16dcb09ea0b0bcf5c61c332 Mon Sep 17 00:00:00 2001 From: Arthur Lu Date: Tue, 10 Jan 2023 17:16:05 -0800 Subject: [PATCH] fixes to limit and bus selection --- scripts/config.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/config.js b/scripts/config.js index 532ff92..9226fb6 100644 --- a/scripts/config.js +++ b/scripts/config.js @@ -66,17 +66,17 @@ async function populateForm (node, type, vmid) { } let addDiskBus = document.querySelector("#add-disk #bus"); - Object.keys(diskConfig[type]).forEach(element => { + diskConfig[type].prefixOrder.forEach(element => { addDiskBus.add(new Option(diskConfig[type][element].name, element)); }); - let def = Object.keys(diskConfig[type])[0]; + let def = diskConfig[type].prefixOrder[0]; addDiskBus.value = def; let addDiskDevice = document.querySelector("#add-disk #device"); addDiskDevice.max = diskConfig[type][def].limit; addDiskBus.addEventListener("change", () => { let value = document.querySelector("#add-disk #bus").value; - document.querySelector("#add-disk #device").max = diskConfig[type][value].limit + document.querySelector("#add-disk #device").max = diskConfig[type][value].limit }); let addDiskStorage = document.querySelector("#add-disk #storage");