add storage target option adding
This commit is contained in:
parent
8345dd61f2
commit
6984f20998
@ -4,10 +4,12 @@ window.addEventListener("DOMContentLoaded", init);
|
|||||||
|
|
||||||
let diskConfig = {
|
let diskConfig = {
|
||||||
lxc: {
|
lxc: {
|
||||||
|
storageContent: "rootdir",
|
||||||
prefixOrder: ["mp"],
|
prefixOrder: ["mp"],
|
||||||
mp: {name: "MP", limit: 255, used: {}}
|
mp: {name: "MP", limit: 255, used: {}}
|
||||||
},
|
},
|
||||||
qemu: {
|
qemu: {
|
||||||
|
storageContent: "images",
|
||||||
prefixOrder: ["sata", "ide"],
|
prefixOrder: ["sata", "ide"],
|
||||||
ide: {name: "IDE", limit: 3, used: {}},
|
ide: {name: "IDE", limit: 3, used: {}},
|
||||||
sata: {name: "SATA", limit: 5, used: {}}
|
sata: {name: "SATA", limit: 5, used: {}}
|
||||||
@ -150,10 +152,13 @@ async function populateAddDisk () {
|
|||||||
addDiskDevice.addEventListener("input", handleDiskDeviceChange);
|
addDiskDevice.addEventListener("input", handleDiskDeviceChange);
|
||||||
addDiskDevice.addEventListener("focus", handleDiskDeviceChange);
|
addDiskDevice.addEventListener("focus", handleDiskDeviceChange);
|
||||||
|
|
||||||
let storage = await request(`/nodes/${node}/storage`);
|
|
||||||
console.log(storage)
|
|
||||||
|
|
||||||
let addDiskStorage = document.querySelector("#add-disk #storage");
|
let addDiskStorage = document.querySelector("#add-disk #storage");
|
||||||
|
let storage = await request(`/nodes/${node}/storage`);
|
||||||
|
storage.data.forEach((element) => {
|
||||||
|
if (element.content.includes(diskConfig[type].storageContent)) { // check if the storage contains rootdir or images content
|
||||||
|
addDiskStorage.add(new Option(element.storage));
|
||||||
|
}
|
||||||
|
});
|
||||||
let addDiskSize = document.querySelector("#add-disk #size");
|
let addDiskSize = document.querySelector("#add-disk #size");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user