simplify instacne node assignment
This commit is contained in:
parent
0a72233baa
commit
b5901cb002
@ -18,17 +18,9 @@ async function init () {
|
|||||||
let nodeStatus = nodes.data[i].status;
|
let nodeStatus = nodes.data[i].status;
|
||||||
|
|
||||||
let qemu = await request(`/nodes/${nodeName}/qemu`, "GET");
|
let qemu = await request(`/nodes/${nodeName}/qemu`, "GET");
|
||||||
qemu.data.forEach((item) => {
|
qemu.data.forEach((item) => {item.node = {name: nodeName, status: nodeStatus}});
|
||||||
item.node = {};
|
|
||||||
item.node.name = nodeName;
|
|
||||||
item.node.status = nodeStatus;
|
|
||||||
});
|
|
||||||
let lxc = await request(`/nodes/${nodeName}/lxc`, "GET");
|
let lxc = await request(`/nodes/${nodeName}/lxc`, "GET");
|
||||||
lxc.data.forEach((item) => {
|
lxc.data.forEach((item) => {item.node = {name: nodeName, status: nodeStatus}});
|
||||||
item.node = {};
|
|
||||||
item.node.name = nodeName;
|
|
||||||
item.node.status = nodeStatus;
|
|
||||||
});
|
|
||||||
instances = instances.concat(qemu.data, lxc.data);
|
instances = instances.concat(qemu.data, lxc.data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user