use min of 1
This commit is contained in:
parent
c18388c634
commit
06a54aa8a8
@ -27,7 +27,7 @@ async function populateForm (node, type, vmid) {
|
|||||||
let name = type === "qemu" ? "name" : "hostname";
|
let name = type === "qemu" ? "name" : "hostname";
|
||||||
addFormLine("name", "Name", {type: "text", value: config.data[name]});
|
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", "Cores", {type: "number", value: config.data.cores, min: 1, max: 8192}, "Threads");
|
||||||
addFormLine("resources", "Memory", {type: "number", value: config.data.memory / 1024, min: 1}, "GiB");
|
addFormLine("resources", "Memory", {type: "number", value: config.data.memory / 1024, min: 0}, "GiB");
|
||||||
|
|
||||||
if (type === "qemu") {
|
if (type === "qemu") {
|
||||||
let i = 0;
|
let i = 0;
|
||||||
@ -37,7 +37,7 @@ async function populateForm (node, type, vmid) {
|
|||||||
sata = JSON.parse(sata);
|
sata = JSON.parse(sata);
|
||||||
let sizeNum = +(sata.size.replaceAll("G", "").replaceAll("M", ""));
|
let sizeNum = +(sata.size.replaceAll("G", "").replaceAll("M", ""));
|
||||||
let sizeUnit = sata.size.includes("G") ? "GiB" : "MiB";
|
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: 1}, "GiB");
|
addFormLine("resources", `SATA ${i}`, {type: "number", value: sizeUnit === "GiB" ? sizeNum.toFixed(3) : (sizeNum / 1024).toFixed(3), min: 0}, "GiB");
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -47,7 +47,7 @@ async function populateForm (node, type, vmid) {
|
|||||||
rootfs = JSON.parse(rootfs);
|
rootfs = JSON.parse(rootfs);
|
||||||
let sizeNum = +(rootfs.size.replaceAll("G", "").replaceAll("M", ""));
|
let sizeNum = +(rootfs.size.replaceAll("G", "").replaceAll("M", ""));
|
||||||
let sizeUnit = rootfs.size.includes("G") ? "GiB" : "MiB";
|
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: 1}, "GiB");
|
addFormLine("resources", "Root FS", {type: "number", value: sizeUnit === "GiB" ? sizeNum.toFixed(3) : (sizeNum / 1024).toFixed(3), min: 0}, "GiB");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user