set step to 0.001

This commit is contained in:
Arthur Lu 2022-12-21 15:26:18 -08:00
parent 512c615351
commit a9c816f9c0

View File

@ -27,7 +27,7 @@ async function populateForm (node, type, vmid) {
let name = type === "qemu" ? "name" : "hostname";
addFormLine("name", "Name", {type: "text", value: config.data[name]});
addFormLine("resources", "Cores", {type: "number", value: config.data.cores, min: 1, max: 8192}, "Threads");
addFormLine("resources", "Memory", {type: "number", value: config.data.memory / 1024, min: 0}, "GiB");
addFormLine("resources", "Memory", {type: "number", value: config.data.memory / 1024, min: 0, step: 0.001}, "GiB");
if (type === "qemu") {
let i = 0;
@ -37,7 +37,7 @@ async function populateForm (node, type, vmid) {
sata = JSON.parse(sata);
let sizeNum = +(sata.size.replaceAll("G", "").replaceAll("M", ""));
let sizeUnit = sata.size.includes("G") ? "GiB" : "MiB";
addFormLine("resources", `SATA ${i}`, {type: "number", value: sizeUnit === "GiB" ? sizeNum.toFixed(3) : (sizeNum / 1024).toFixed(3), min: 0}, "GiB");
addFormLine("resources", `SATA ${i}`, {type: "number", value: sizeUnit === "GiB" ? sizeNum.toFixed(3) : (sizeNum / 1024).toFixed(3), min: 0, step: 0.001}, "GiB");
i++;
}
}
@ -47,7 +47,7 @@ async function populateForm (node, type, vmid) {
rootfs = JSON.parse(rootfs);
let sizeNum = +(rootfs.size.replaceAll("G", "").replaceAll("M", ""));
let sizeUnit = rootfs.size.includes("G") ? "GiB" : "MiB";
addFormLine("resources", "Root FS", {type: "number", value: sizeUnit === "GiB" ? sizeNum.toFixed(3) : (sizeNum / 1024).toFixed(3), min: 0}, "GiB");
addFormLine("resources", "Root FS", {type: "number", value: sizeUnit === "GiB" ? sizeNum.toFixed(3) : (sizeNum / 1024).toFixed(3), min: 0, step: 0.001}, "GiB");
}
}