From baac800e17d562189d900cda36fc92aee3b62857 Mon Sep 17 00:00:00 2001 From: bahmcloud Date: Wed, 14 Jan 2026 18:31:11 +0000 Subject: [PATCH] =?UTF-8?q?custom=5Fcomponents/bahmcloud=5Fstore/panel/pan?= =?UTF-8?q?el.js=20hinzugef=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bahmcloud_store/panel/panel.js | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 custom_components/bahmcloud_store/panel/panel.js diff --git a/custom_components/bahmcloud_store/panel/panel.js b/custom_components/bahmcloud_store/panel/panel.js new file mode 100644 index 0000000..12be78a --- /dev/null +++ b/custom_components/bahmcloud_store/panel/panel.js @@ -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);