fix parameters

This commit is contained in:
Arthur Lu 2023-01-11 02:52:52 -08:00
parent 8b2fb8c1ba
commit d5d495f566

View File

@ -73,10 +73,10 @@ async function populateForm (node, type, vmid) {
addDiskBus.value = def; addDiskBus.value = def;
handleDiskBusChange(diskConfig); handleDiskBusChange(diskConfig);
addDiskBus.addEventListener("change", handleDiskBusChange({diskConfig, type})); addDiskBus.addEventListener("change", handleDiskBusChange({c: diskConfig, t: type}));
addDiskDevice.addEventListener("input", handleDiskDeviceChange({diskConfig, type})); addDiskDevice.addEventListener("input", handleDiskDeviceChange({c: diskConfig, t: type}));
addDiskDevice.addEventListener("focus", handleDiskDeviceChange({diskConfig, type})); addDiskDevice.addEventListener("focus", handleDiskDeviceChange({c: diskConfig, t: type}));
let addDiskStorage = document.querySelector("#add-disk #storage"); let addDiskStorage = document.querySelector("#add-disk #storage");
let addDiskSize = document.querySelector("#add-disk #size"); let addDiskSize = document.querySelector("#add-disk #size");
@ -101,8 +101,8 @@ function getNextAvaliable(entry){
} }
function handleDiskBusChange (data) { function handleDiskBusChange (data) {
let diskConfig = data.diskConfig; let diskConfig = data.c;
let type = data.type; let type = data.t;
let bus = document.querySelector("#add-disk #bus").value; let bus = document.querySelector("#add-disk #bus").value;
let entry = diskConfig[type][bus]; let entry = diskConfig[type][bus];
let limit = entry.limit; let limit = entry.limit;