fix instance type setting,
add min-content to center-div
This commit is contained in:
parent
63943782c6
commit
cb2cc97387
@ -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;
|
||||||
}
|
}
|
||||||
|
@ -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);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user