separate instance card data elements
This commit is contained in:
parent
8ef1cc3344
commit
6400f36324
@ -24,10 +24,31 @@ class Instance extends HTMLElement {
|
|||||||
set data (data) {
|
set data (data) {
|
||||||
let instanceArticle = this.shadowElement.querySelector("article");
|
let instanceArticle = this.shadowElement.querySelector("article");
|
||||||
|
|
||||||
let instanceParagraph = document.createElement("p");
|
let type = document.createElement("img");
|
||||||
instanceParagraph.innerText = `${data.type} | ${data.vmid} | ${data.name} | ${data.status} | ${data.node.name} (${data.node.status})`;
|
type.src = `images/${data.type}.svg`;
|
||||||
instanceParagraph.style.color = data.status === "running" ? "#00ff00" : "#ff0000";
|
instanceArticle.append(type);
|
||||||
instanceArticle.append(instanceParagraph);
|
|
||||||
|
let vmid = document.createElement("p");
|
||||||
|
vmid.innerText = data.vmid;
|
||||||
|
instanceArticle.append(vmid);
|
||||||
|
|
||||||
|
let name = document.createElement("p");
|
||||||
|
name.innerText = data.name;
|
||||||
|
instanceArticle.append(name);
|
||||||
|
|
||||||
|
let status = document.createElement("p");
|
||||||
|
status.innerText = data.status;
|
||||||
|
status.style.color = data.status === "running" ? "#00ff00" : "#ff0000";
|
||||||
|
instanceArticle.append(status);
|
||||||
|
|
||||||
|
let nodeName = document.createElement("p");
|
||||||
|
nodeName.innerText = data.node.name;
|
||||||
|
instanceArticle.append(nodeName);
|
||||||
|
|
||||||
|
let nodeStatus = document.createElement("p");
|
||||||
|
nodeStatus.innerText = data.node.status;
|
||||||
|
nodeStatus.style.color = data.node.status === "online" ? "#00ff00" : "#ff0000";
|
||||||
|
instanceArticle.append(nodeStatus);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user