add unused disk to disk populate

Signed-off-by: Arthur Lu <learthurgo@gmail.com>
This commit is contained in:
Arthur Lu 2023-01-19 00:54:14 +00:00
parent be589fd586
commit 2557292a28

View File

@ -4,13 +4,16 @@ window.addEventListener("DOMContentLoaded", init);
let diskConfig = { let diskConfig = {
lxc: { lxc: {
prefixOrder: ["mp"], prefixOrder: ["rootfs", "mp", "unused"],
mp: {name: "MP", icon: "images/resources/drive.svg"} rootfs: {name: "ROOTFS", icon: "images/resources/drive.svg"},
mp: {name: "MP", icon: "images/resources/drive.svg"},
unused: {name: "UNUSED", icon: "images/resources/drive.svg"}
}, },
qemu: { qemu: {
prefixOrder: ["sata", "ide"], prefixOrder: ["ide", "sata", "unused"],
ide: {name: "IDE", icon: "images/resources/disk.svg"}, ide: {name: "IDE", icon: "images/resources/disk.svg"},
sata: {name: "SATA", icon: "images/resources/drive.svg"} sata: {name: "SATA", icon: "images/resources/drive.svg"},
unused: {name: "UNUSED", icon: "images/resources/drive.svg"}
} }
} }
@ -49,8 +52,9 @@ async function populateResources () {
if (type === "lxc") { if (type === "lxc") {
addResourceLine("resources", "images/resources/swap.svg", "Swap", {type: "number", value: config.data.swap, min: 0, step: 1}, "MiB"); // TODO add max from quota API addResourceLine("resources", "images/resources/swap.svg", "Swap", {type: "number", value: config.data.swap, min: 0, step: 1}, "MiB"); // TODO add max from quota API
/*
let rootfs = config.data.rootfs; let rootfs = config.data.rootfs;
addDiskLine("disks", "mp", "Root FS", null, rootfs); addDiskLine("disks", "mp", "Root FS", null, rootfs);*/
} }
for(let i = 0; i < diskConfig[type].prefixOrder.length; i++){ for(let i = 0; i < diskConfig[type].prefixOrder.length; i++){