From 1e035e878c82a703dd33da5156a1923a83898f16 Mon Sep 17 00:00:00 2001 From: Arthur Lu Date: Mon, 16 Jan 2023 16:14:33 -0800 Subject: [PATCH] change volume contents includes to be specific to bus type Signed-off-by: Arthur Lu --- scripts/config.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/scripts/config.js b/scripts/config.js index 7bf2a9d..0696bae 100644 --- a/scripts/config.js +++ b/scripts/config.js @@ -4,15 +4,13 @@ window.addEventListener("DOMContentLoaded", init); let diskConfig = { lxc: { - storageContent: "rootdir", prefixOrder: ["mp"], - mp: {name: "MP", limit: 255, used: {}, icon: "images/resources/drive.svg", resizable: true, hasPath: true, hasDiskImage: false} + mp: {name: "MP", limit: 255, used: {}, icon: "images/resources/drive.svg", storageContent: "rootdir",resizable: true, hasPath: true, hasDiskImage: false} }, qemu: { - storageContent: "images", prefixOrder: ["sata", "ide"], - ide: {name: "IDE", limit: 3, used: {}, icon: "images/resources/disk.svg", reziable: false, hasPath: false, hasDiskImage: true}, - sata: {name: "SATA", limit: 5, used: {}, icon: "images/resources/drive.svg", resizable: true, hasPath: false, hasDiskImage: false} + ide: {name: "IDE", limit: 3, used: {}, icon: "images/resources/disk.svg", storageContent: "iso", reziable: false, hasPath: false, hasDiskImage: true}, + sata: {name: "SATA", limit: 5, used: {}, icon: "images/resources/drive.svg", storageContent: "images", resizable: true, hasPath: false, hasDiskImage: false} } } @@ -131,7 +129,7 @@ function addDiskLine (fieldset, busPrefix, busName, device, storage, storageOpti let storageSelect = document.createElement("select"); storageOptions.data.forEach((element) => { - if (element.content.includes(diskConfig[type].storageContent)) { // check if the storage contains rootdir or images content + if (element.content.includes(diskConfig[type][busPrefix].storageContent)) { // check if the storage contains rootdir or images content storageSelect.add(new Option(element.storage)); } });