The VM list is now sorted alphabetically

This commit is contained in:
elijahr2411 2023-01-26 21:20:20 -05:00
parent c8708df551
commit 8dce6c9ac8

View file

@ -449,11 +449,19 @@ function multicollab(url) {
card.appendChild(img); card.appendChild(img);
card.appendChild(bdy); card.appendChild(bdy);
div.appendChild(card); div.appendChild(card);
vmlist.children[0].appendChild(div); list[i].element = div;
reloadVMList();
} }
res(true); res(true);
}); });
} }
function reloadVMList() {
vms.sort(function(a, b) {
return a.id > b.id ? 1 : -1;
});
vmlist.children[0].innerHTML = "";
vms.forEach((v) => vmlist.children[0].appendChild(v.element));
}
function chatMessage(username, msg) { function chatMessage(username, msg) {
var tr = document.createElement("tr"); var tr = document.createElement("tr");
var td = document.createElement("td"); var td = document.createElement("td");