fix pci device pcie form get
This commit is contained in:
parent
59e75659bd
commit
1359ebcc87
@ -42,15 +42,20 @@ function buildResourceTable(resources, tableid) {
|
|||||||
let tbody = table.querySelector("tbody");
|
let tbody = table.querySelector("tbody");
|
||||||
Object.keys(resources.resources).forEach((element) => {
|
Object.keys(resources.resources).forEach((element) => {
|
||||||
if (resources.resources[element].display) {
|
if (resources.resources[element].display) {
|
||||||
let row = tbody.insertRow();
|
if (resources.resources[element].type === "list") {
|
||||||
let key = row.insertCell();
|
|
||||||
key.innerText = `${element}`;
|
}
|
||||||
let used = row.insertCell();
|
else {
|
||||||
used.innerText = `${parseNumber(resources.used[element], resources.resources[element])}`;
|
let row = tbody.insertRow();
|
||||||
let val = row.insertCell();
|
let key = row.insertCell();
|
||||||
val.innerText = `${parseNumber(resources.avail[element], resources.resources[element])}`;
|
key.innerText = `${element}`;
|
||||||
let total = row.insertCell();
|
let used = row.insertCell();
|
||||||
total.innerText = `${parseNumber(resources.max[element], resources.resources[element])}`;
|
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])}`;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -714,7 +714,7 @@ async function handleDeviceConfig() {
|
|||||||
vmid: vmid,
|
vmid: vmid,
|
||||||
hostpci: deviceID,
|
hostpci: deviceID,
|
||||||
device: form.get("device"),
|
device: form.get("device"),
|
||||||
pcie: form.get("pcie")
|
pcie: form.get("pcie") ? 1 : 0
|
||||||
}
|
}
|
||||||
let result = await requestAPI("/instance/pci/modify", "POST", body);
|
let result = await requestAPI("/instance/pci/modify", "POST", body);
|
||||||
if (result.status === 200) {
|
if (result.status === 200) {
|
||||||
|
Loading…
Reference in New Issue
Block a user