show blank name if instance is unknown,

show stopped icon if instance is unknown

Signed-off-by: Arthur Lu <learthurgo@gmail.com>
This commit is contained in:
Arthur Lu 2023-01-17 12:33:21 -08:00
parent 6a20785b7c
commit 72e0407be2

View File

@ -39,9 +39,17 @@ class Instance extends HTMLElement {
this.vmid = data.vmid;
let nameParagraph = this.shadowElement.querySelector("#instance-name");
nameParagraph.innerText = data.name;
if (data.name) {
nameParagraph.innerText = data.name;
}
else {
nameParagraph.innerText = "";
}
let nodeImg = this.shadowElement.querySelector("#node-status");
if (data.status === "undefined") {
data.status = "stopped";
}
nodeImg.src = `images/nodes/${data.node.status}.svg`;
let nodeParagraph = this.shadowElement.querySelector("#node-name");