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:
parent
6a20785b7c
commit
72e0407be2
@ -39,9 +39,17 @@ class Instance extends HTMLElement {
|
|||||||
this.vmid = data.vmid;
|
this.vmid = data.vmid;
|
||||||
|
|
||||||
let nameParagraph = this.shadowElement.querySelector("#instance-name");
|
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");
|
let nodeImg = this.shadowElement.querySelector("#node-status");
|
||||||
|
if (data.status === "undefined") {
|
||||||
|
data.status = "stopped";
|
||||||
|
}
|
||||||
nodeImg.src = `images/nodes/${data.node.status}.svg`;
|
nodeImg.src = `images/nodes/${data.node.status}.svg`;
|
||||||
|
|
||||||
let nodeParagraph = this.shadowElement.querySelector("#node-name");
|
let nodeParagraph = this.shadowElement.querySelector("#node-name");
|
||||||
|
Loading…
Reference in New Issue
Block a user