From 6598ae313360fb4075277adb461bd49b69cb9f40 Mon Sep 17 00:00:00 2001 From: Arthur Lu Date: Thu, 12 Jan 2023 15:17:35 -0800 Subject: [PATCH] disable bus when lxc, disable path when qemu --- config.html | 3 ++- scripts/config.js | 9 +++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/config.html b/config.html index 4b6b3c3..4f1adc7 100644 --- a/config.html +++ b/config.html @@ -23,11 +23,12 @@ Disks

-
+
+
diff --git a/scripts/config.js b/scripts/config.js index f7a7f85..1b211dd 100644 --- a/scripts/config.js +++ b/scripts/config.js @@ -145,6 +145,9 @@ async function populateAddDisk () { }); addDiskBus.value = diskConfig[type].prefixOrder[0]; handleDiskBusChange(diskConfig); + if (type === "lxc") { + addDiskBus.disabled = true; + } addDiskBus.addEventListener("change", handleDiskBusChange); let addDiskDevice = document.querySelector("#add-disk #device"); @@ -158,7 +161,13 @@ async function populateAddDisk () { addDiskStorage.add(new Option(element.storage)); } }); + let addDiskSize = document.querySelector("#add-disk #size"); + + let addDiskPath = document.querySelector("#add-disk #path"); + if (type === "qemu") { + addDiskPath.disabled = true; + } } function handleDiskBusChange () {