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