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 f2da3882dc
commit 1c0faf2a71

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");