sort nodes and instances
This commit is contained in:
parent
8349cfd31d
commit
3be0c02595
4
index.js
4
index.js
@ -12,13 +12,17 @@ async function init () {
|
||||
}
|
||||
|
||||
let nodes = await request("/nodes", "GET", null);
|
||||
nodes.data.sort((a, b) => (a.node > b.node) ? 1 : -1);
|
||||
|
||||
let nodeContainer = document.getElementById("node-container")
|
||||
for (let i = 0; i < nodes.data.length; i++) {
|
||||
let newNode = document.createElement("node-card");
|
||||
newNode.data = nodes.data[i];
|
||||
|
||||
let qemu = await request(`/nodes/${nodes.data[i].node}/qemu`, "GET", null);
|
||||
qemu.data.sort((a, b) => (a.vmid > b.vmid) ? 1 : -1);
|
||||
let lxc = await request(`/nodes/${nodes.data[i].node}/lxc`, "GET", null);
|
||||
lxc.data.sort((a, b) => (a.vmid > b.vmid) ? 1 : -1);
|
||||
newNode.qemu = qemu.data;
|
||||
newNode.lxc = lxc.data;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user