remove colons from forms

This commit is contained in:
Arthur Lu 2022-12-20 18:03:07 -08:00
parent 8341b88c76
commit c4d607570e
2 changed files with 6 additions and 6 deletions

View File

@ -14,9 +14,9 @@
<fieldset> <fieldset>
<legend>Proxmox VE Login</legend> <legend>Proxmox VE Login</legend>
<div class="labels-inputs"> <div class="labels-inputs">
<label for="username">Username:</label> <label for="username">Username</label>
<input type="text" id="username" name="username"> <input type="text" id="username" name="username">
<label for="username">Password:</label> <label for="username">Password</label>
<input type="password" id="password" name="password"> <input type="password" id="password" name="password">
</div> </div>
</fieldset> </fieldset>

View File

@ -24,17 +24,17 @@ async function populateForm (node, type, vmid) {
let config = await request(`/nodes/${node}/${type}/${vmid}/config`); let config = await request(`/nodes/${node}/${type}/${vmid}/config`);
console.log(config); console.log(config);
addFormLine("name", "name", "Name:", {type: "text", value: config.data.name}); 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", "cores", "Cores", {type: "number", value: config.data.cores, min: 1, max: 8192});
addFormLine("resources", "memory", "Memory:", {type: "number", value: config.data.memory, min: 16}); addFormLine("resources", "memory", "Memory", {type: "number", value: config.data.memory, min: 16});
let i = 0; let i = 0;
while(Object.hasOwn(config.data, `sata${i}`)){ while(Object.hasOwn(config.data, `sata${i}`)){
let sata = config.data[`sata${i}`]; let sata = config.data[`sata${i}`];
sata = `{"${sata.replaceAll(":", '":"').replaceAll("=", '":"').replaceAll(",", '","')}"}`; sata = `{"${sata.replaceAll(":", '":"').replaceAll("=", '":"').replaceAll(",", '","')}"}`;
sata = JSON.parse(sata); sata = JSON.parse(sata);
addFormLine("resources", `sata${i}`, `SATA ${i}:`, {type: "text", value: sata.size}); addFormLine("resources", `sata${i}`, `SATA ${i}`, {type: "text", value: sata.size});
i++; i++;
} }
} }