From 5d42dbe63744ee07e67f83d7247430c5290ffe48 Mon Sep 17 00:00:00 2001 From: Arthur Lu Date: Fri, 10 Feb 2023 22:17:23 +0000 Subject: [PATCH] fix lxc handling in disk attach Signed-off-by: Arthur Lu --- scripts/config.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/scripts/config.js b/scripts/config.js index b278961..b16ac19 100644 --- a/scripts/config.js +++ b/scripts/config.js @@ -203,7 +203,7 @@ async function handleDiskAttach () { let label = document.createElement("label"); label.for = "device"; - label.innerText = "SATA" + label.innerText = type === "qemu" ? "SATA" : "MP"; dialog.append(label); let input = document.createElement("input"); @@ -218,7 +218,12 @@ async function handleDiskAttach () { dialog.callback = async (result, form) => { if (result === "confirm") { let action = {}; - action[`sata${input.value}`] = diskImage; + let bus = type === "qemu" ? "sata" : "mp"; + let details = diskImage; + if (type === "lxc") { + details += `,mp=/mp${input.value}/`; + } + action[`${bus}${input.value}`] = details; let body = { node: node, type: type,