diff --git a/config.html b/config.html index 2c64deb..df3b574 100644 --- a/config.html +++ b/config.html @@ -12,9 +12,12 @@
- Change Configuration -
-
+ Name +
+
+
+ Resources +
diff --git a/scripts/config.js b/scripts/config.js index f02e5d4..77eb049 100644 --- a/scripts/config.js +++ b/scripts/config.js @@ -24,21 +24,23 @@ async function populateForm (node, type, vmid) { let config = await request(`/nodes/${node}/${type}/${vmid}/config`); console.log(config); - addFormLine("cores", "Cores", {type: "number", value: config.data.cores, min: 1, max: 8192}); - addFormLine("memory", "Memory", {type: "number", value: config.data.memory, min: 16}); + addFormLine("name", "name", "Name:", {type: "text", value: config.data.name}); + + addFormLine("resources", "cores", "Cores:", {type: "number", value: config.data.cores, min: 1, max: 8192}); + addFormLine("resources", "memory", "Memory:", {type: "number", value: config.data.memory, min: 16}); let i = 0; while(Object.hasOwn(config.data, `sata${i}`)){ let sata = config.data[`sata${i}`]; sata = `{"${sata.replaceAll(":", '":"').replaceAll("=", '":"').replaceAll(",", '","')}"}`; sata = JSON.parse(sata); - addFormLine(`sata${i}`, `SATA ${i}`, {type: "text", value: sata.size}); + addFormLine("resources", `sata${i}`, `SATA ${i}`, {type: "text", value: sata.size}); i++; } } -function addFormLine (id, labelName, inputAttr) { - let form = document.querySelector("#user-configurable"); +function addFormLine (fieldset, id, labelName, inputAttr) { + let form = document.querySelector(`#${fieldset}`); let label = document.createElement("label"); label.for = id;