26 lines
696 B
JavaScript
26 lines
696 B
JavaScript
class BahmcloudStorePanel extends HTMLElement {
|
|
set hass(hass) {
|
|
if (this._rendered) return;
|
|
this._rendered = true;
|
|
|
|
const root = this.attachShadow({ mode: "open" });
|
|
const iframe = document.createElement("iframe");
|
|
|
|
iframe.src = "/api/bahmcloud_store_static/index.html";
|
|
iframe.style.width = "100%";
|
|
iframe.style.height = "100%";
|
|
iframe.style.border = "0";
|
|
iframe.style.display = "block";
|
|
|
|
const style = document.createElement("style");
|
|
style.textContent = `
|
|
:host { display: block; height: 100vh; }
|
|
`;
|
|
|
|
root.appendChild(style);
|
|
root.appendChild(iframe);
|
|
}
|
|
}
|
|
|
|
customElements.define("bahmcloud-store-panel", BahmcloudStorePanel);
|