add top div to instance article

This commit is contained in:
Arthur Lu 2022-12-14 15:32:22 -08:00
parent a8664a4e04
commit 02ed33c674
2 changed files with 12 additions and 3 deletions

View File

@ -2,4 +2,8 @@ article {
border-top: solid white 1px; border-top: solid white 1px;
border-bottom: solid white 1px; border-bottom: solid white 1px;
margin: 0px; margin: 0px;
}
.instance-top-div {
display: flex;
} }

View File

@ -24,17 +24,22 @@ class Instance extends HTMLElement {
set data (data) { set data (data) {
let instanceArticle = this.shadowElement.querySelector("article"); let instanceArticle = this.shadowElement.querySelector("article");
let topDiv = document.createElement("div");
topDiv.classList.add("instance-top-div");
let typeImg = document.createElement("img"); let typeImg = document.createElement("img");
typeImg.src = `images/instances/${data.type}/${data.status}.svg`; typeImg.src = `images/instances/${data.type}/${data.status}.svg`;
instanceArticle.append(typeImg); topDiv.append(typeImg);
let vmidParagraph = document.createElement("p"); let vmidParagraph = document.createElement("p");
vmidParagraph.innerText = data.vmid; vmidParagraph.innerText = data.vmid;
instanceArticle.append(vmidParagraph); topDiv.append(vmidParagraph);
let nameParagraph = document.createElement("p"); let nameParagraph = document.createElement("p");
nameParagraph.innerText = data.name; nameParagraph.innerText = data.name;
instanceArticle.append(nameParagraph); topDiv.append(nameParagraph);
instanceArticle.append(topDiv);
let nodeImg = document.createElement("img"); let nodeImg = document.createElement("img");
nodeImg.src = `images/nodes/${data.node.status}.svg`; nodeImg.src = `images/nodes/${data.node.status}.svg`;