fix lxc handling in disk attach

Signed-off-by: Arthur Lu <learthurgo@gmail.com>
This commit is contained in:
Arthur Lu 2023-02-10 22:17:23 +00:00
parent 4496c5f27c
commit 5d42dbe637

View File

@ -203,7 +203,7 @@ async function handleDiskAttach () {
let label = document.createElement("label"); let label = document.createElement("label");
label.for = "device"; label.for = "device";
label.innerText = "SATA" label.innerText = type === "qemu" ? "SATA" : "MP";
dialog.append(label); dialog.append(label);
let input = document.createElement("input"); let input = document.createElement("input");
@ -218,7 +218,12 @@ async function handleDiskAttach () {
dialog.callback = async (result, form) => { dialog.callback = async (result, form) => {
if (result === "confirm") { if (result === "confirm") {
let action = {}; 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 = { let body = {
node: node, node: node,
type: type, type: type,