fix instance type setting,

add min-content to center-div
This commit is contained in:
Arthur Lu 2022-12-13 23:26:43 -08:00
parent f0e5b31bdf
commit 979307095d
2 changed files with 5 additions and 4 deletions

View File

@ -32,6 +32,7 @@ p {
.center-div { .center-div {
min-width: 480px; min-width: 480px;
max-width: 50%; max-width: 50%;
width: min-content;
margin-left: auto; margin-left: auto;
margin-right: auto; margin-right: auto;
} }

View File

@ -58,8 +58,8 @@ class Instance extends HTMLElement {
super(); super();
let shadowRoot = this.attachShadow({mode: "open"}); let shadowRoot = this.attachShadow({mode: "open"});
let instanceDiv = document.createElement("div"); let instanceArticle = document.createElement("article");
shadowRoot.append(instanceDiv); shadowRoot.append(instanceArticle);
let styleLink = document.createElement("link"); let styleLink = document.createElement("link");
styleLink.rel = "stylesheet"; styleLink.rel = "stylesheet";
@ -71,10 +71,10 @@ class Instance extends HTMLElement {
} }
set data (data) { set data (data) {
let instanceDiv = this.shadowElement.querySelector("div"); let instanceArticle = this.shadowElement.querySelector("article");
let instanceParagraph = document.createElement("p"); let instanceParagraph = document.createElement("p");
instanceParagraph.innerText = `CT | ${data.vmid} | ${data.name} | ${data.status}`; instanceParagraph.innerText = `${data.type} | ${data.vmid} | ${data.name} | ${data.status}`;
instanceParagraph.style.color = data.status === "running" ? "#00ff00" : "#ff0000"; instanceParagraph.style.color = data.status === "running" ? "#00ff00" : "#ff0000";
instanceDiv.append(instanceParagraph); instanceDiv.append(instanceParagraph);
} }