custom_components/bahmcloud_store/panel/panel.js hinzugefügt
This commit is contained in:
25
custom_components/bahmcloud_store/panel/panel.js
Normal file
25
custom_components/bahmcloud_store/panel/panel.js
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
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);
|
||||||
Reference in New Issue
Block a user