fix pci device pcie form get

This commit is contained in:
Arthur Lu 2023-06-23 03:34:44 +00:00
parent 2eb874580b
commit 426e27812f
2 changed files with 15 additions and 10 deletions

View File

@ -42,15 +42,20 @@ function buildResourceTable(resources, tableid) {
let tbody = table.querySelector("tbody");
Object.keys(resources.resources).forEach((element) => {
if (resources.resources[element].display) {
let row = tbody.insertRow();
let key = row.insertCell();
key.innerText = `${element}`;
let used = row.insertCell();
used.innerText = `${parseNumber(resources.used[element], resources.resources[element])}`;
let val = row.insertCell();
val.innerText = `${parseNumber(resources.avail[element], resources.resources[element])}`;
let total = row.insertCell();
total.innerText = `${parseNumber(resources.max[element], resources.resources[element])}`;
if (resources.resources[element].type === "list") {
}
else {
let row = tbody.insertRow();
let key = row.insertCell();
key.innerText = `${element}`;
let used = row.insertCell();
used.innerText = `${parseNumber(resources.used[element], resources.resources[element])}`;
let val = row.insertCell();
val.innerText = `${parseNumber(resources.avail[element], resources.resources[element])}`;
let total = row.insertCell();
total.innerText = `${parseNumber(resources.max[element], resources.resources[element])}`;
}
}
});
}

View File

@ -714,7 +714,7 @@ async function handleDeviceConfig() {
vmid: vmid,
hostpci: deviceID,
device: form.get("device"),
pcie: form.get("pcie")
pcie: form.get("pcie") ? 1 : 0
}
let result = await requestAPI("/instance/pci/modify", "POST", body);
if (result.status === 200) {