UNPKG

iobroker.lovelace

Version:

With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI

1 lines 2.59 kB
export const __rspack_esm_id=54750;export const __rspack_esm_ids=[54750];export const __webpack_modules__={63130(t,o,e){e.d(o,{l:()=>i});var a=e(50248);const i=async(t,o)=>{if(navigator.clipboard)try{return void await navigator.clipboard.writeText(t)}catch{}const e=o||(0,a.n)()?.getRootNode()||document.body,i=document.createElement("textarea");i.value=t,i.setAttribute("readonly",""),i.style.position="fixed",i.style.top="0",i.style.left="0",i.style.opacity="0",e.appendChild(i),i.select(),document.execCommand("copy"),e.removeChild(i)}},29517(t,o,e){e.a(t,async function(t,a){try{e.r(o);e(18111),e(61701),e(33110);var i=e(62826),s=e(5124),r=e(22441),n=e(1087),l=e(63130),p=e(18350),c=(e(93444),e(72554)),d=e(81619),h=t([p,c]);[p,c]=h.then?(await h)():h;class y extends s.WF{async showDialog(t){this._params=t,this._open=!0}closeDialog(){this._open=!1}_dialogClosed(){this._params=void 0,(0,n.r)(this,"dialog-closed",{dialog:this.localName})}async _copyToClipboard(){this._params&&(await(0,l.l)(JSON.stringify(this._params.entry)),(0,d.P)(this,{message:this.hass.localize("ui.common.copied_clipboard")}))}render(){return this._params?s.qy` <ha-dialog .open="${this._open}" header-title="${this.hass.localize("ui.panel.config.zeroconf.discovery_information")}" @closed="${this._dialogClosed}"> <p> <b>${this.hass.localize("ui.panel.config.zeroconf.name")}</b>: ${this._params.entry.name.slice(0,-this._params.entry.type.length-1)} <br> <b>${this.hass.localize("ui.panel.config.zeroconf.type")}</b>: ${this._params.entry.type} <br> <b>${this.hass.localize("ui.panel.config.zeroconf.port")}</b>: ${this._params.entry.port} <br> </p> <h4>${this.hass.localize("ui.panel.config.zeroconf.ip_addresses")}</h4> <table width="100%"> <tbody> ${this._params.entry.ip_addresses.map(t=>s.qy` <tr> <td>${t}</td> </tr> `)} </tbody> </table> <h4>${this.hass.localize("ui.panel.config.zeroconf.properties")}</h4> <table width="100%"> <tbody> ${Object.entries(this._params.entry.properties).map(([t,o])=>s.qy` <tr> <td><b>${t}</b></td> <td>${o}</td> </tr> `)} </tbody> </table> <ha-dialog-footer slot="footer"> <ha-button slot="primaryAction" appearance="plain" @click="${this._copyToClipboard}"> ${this.hass.localize("ui.panel.config.zeroconf.copy_to_clipboard")} </ha-button> </ha-dialog-footer> </ha-dialog> `:s.s6}constructor(...t){super(...t),this._open=!1}}(0,i.Cg)([(0,r.MZ)({attribute:!1})],y.prototype,"hass",void 0),(0,i.Cg)([(0,r.wk)()],y.prototype,"_params",void 0),(0,i.Cg)([(0,r.wk)()],y.prototype,"_open",void 0),y=(0,i.Cg)([(0,r.EM)("dialog-zeroconf-device-info")],y),a()}catch(t){a(t)}})}};