add red border on add disk device input focus

This commit is contained in:
Arthur Lu 2023-01-11 02:15:58 -08:00
parent 801bd1e105
commit 847f2d4d64

View File

@ -114,6 +114,18 @@ async function populateForm (node, type, vmid) {
}
});
addDiskDevice.addEventListener("hover", () => {
let value = document.querySelector("#add-disk #device").value;
let bus = document.querySelector("#add-disk #bus").value;
let entry = diskConfig[type][bus];
if(value in entry.used){
addDiskDevice.style.border = "solid red 1px";
}
else {
addDiskDevice.style.border = "solid white 1px";
}
});
let addDiskStorage = document.querySelector("#add-disk #storage");
let addDiskSize = document.querySelector("#add-disk #size");