remove template in index,
add article content in js Signed-off-by: Arthur Lu <learthurgo@gmail.com>
This commit is contained in:
parent
96569d3f88
commit
a8f9c67711
20
index.html
20
index.html
@ -17,24 +17,4 @@
|
|||||||
</header>
|
</header>
|
||||||
<main><div id="instance-container" class="center-div"></div></main>
|
<main><div id="instance-container" class="center-div"></div></main>
|
||||||
</body>
|
</body>
|
||||||
<template id="instance-template">
|
|
||||||
<article>
|
|
||||||
<div>
|
|
||||||
<div>
|
|
||||||
<img id="instance-type">
|
|
||||||
<p id="instance-id"></p>
|
|
||||||
<p id="instance-name"></p>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<img id="node-status" alt="instance node">
|
|
||||||
<p id="node-name"></p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<hr>
|
|
||||||
<div class="btn-group">
|
|
||||||
<img id="power-btn">
|
|
||||||
<img id="configure-btn" alt="change instance configuration">
|
|
||||||
</div>
|
|
||||||
</article>
|
|
||||||
</template>
|
|
||||||
</html>
|
</html>
|
@ -7,9 +7,26 @@ class Instance extends HTMLElement {
|
|||||||
super();
|
super();
|
||||||
let shadowRoot = this.attachShadow({mode: "open"});
|
let shadowRoot = this.attachShadow({mode: "open"});
|
||||||
|
|
||||||
let instanceTemplate = document.querySelector("#instance-template");
|
shadowRoot.innerHTML = `
|
||||||
let instanceTemplateContent = instanceTemplate.content;
|
<article>
|
||||||
shadowRoot.append(instanceTemplateContent.cloneNode(true));
|
<div>
|
||||||
|
<div>
|
||||||
|
<img id="instance-type">
|
||||||
|
<p id="instance-id"></p>
|
||||||
|
<p id="instance-name"></p>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<img id="node-status" alt="instance node">
|
||||||
|
<p id="node-name"></p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<hr>
|
||||||
|
<div class="btn-group">
|
||||||
|
<img id="power-btn">
|
||||||
|
<img id="configure-btn" alt="change instance configuration">
|
||||||
|
</div>
|
||||||
|
</article>
|
||||||
|
`;
|
||||||
|
|
||||||
let styleLink = document.createElement("link");
|
let styleLink = document.createElement("link");
|
||||||
styleLink.rel = "stylesheet";
|
styleLink.rel = "stylesheet";
|
||||||
|
Loading…
Reference in New Issue
Block a user