From fadf3f206c8285083f74711a925d696add05c80d Mon Sep 17 00:00:00 2001 From: Arthur Lu Date: Wed, 11 Jan 2023 02:15:58 -0800 Subject: [PATCH] add red border on add disk device input focus --- scripts/config.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/scripts/config.js b/scripts/config.js index f8934e1..4c2122e 100644 --- a/scripts/config.js +++ b/scripts/config.js @@ -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");