iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
2 lines • 2.64 kB
JavaScript
export const __webpack_ids__=["29756"];export const __webpack_modules__={83894:function(r,e,s){s.r(e),s.d(e,{REDIRECTS:()=>u});var t=s(44249),o=s(72621),i=(s(9359),s(31526),s(68203)),a=s(57243),d=s(15093),n=s(83523),c=s(58776);s(34515);const u={supervisor:{redirect:"/hassio/dashboard"},supervisor_logs:{redirect:"/hassio/system"},supervisor_info:{redirect:"/hassio/system"},supervisor_snapshots:{redirect:"/hassio/backups"},supervisor_backups:{redirect:"/hassio/backups"},supervisor_store:{redirect:"/hassio/store"},supervisor_addons:{redirect:"/hassio/dashboard"},supervisor_addon:{redirect:"/hassio/addon",params:{addon:"string"},optional_params:{repository_url:"url"}},supervisor_ingress:{redirect:"/hassio/ingress",params:{addon:"string"}},supervisor_add_addon_repository:{redirect:"/hassio/store",params:{repository_url:"url"}}};(0,t.Z)([(0,d.Mo)("hassio-my-redirect")],(function(r,e){class s extends e{constructor(...e){super(...e),r(this)}}return{F:s,d:[{kind:"field",decorators:[(0,d.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,d.Cb)({attribute:!1})],key:"supervisor",value:void 0},{kind:"field",decorators:[(0,d.Cb)({attribute:!1})],key:"route",value:void 0},{kind:"field",decorators:[(0,d.SB)()],key:"_error",value:void 0},{kind:"method",key:"connectedCallback",value:function(){(0,o.Z)(s,"connectedCallback",this,3)([]);const r=this.route.path.substr(1),e=u[r];if(!e)return void(this._error=this.supervisor.localize("my.not_supported",{link:a.dy`<a target="_blank" rel="noreferrer noopener" href="https://my.home-assistant.io/faq.html#supported-pages"> ${this.supervisor.localize("my.faq_link")} </a>`}));let t;try{t=this._createRedirectUrl(e)}catch(r){return void(this._error=this.supervisor.localize("my.error"))}(0,n.c)(t,{replace:!0})}},{kind:"method",key:"render",value:function(){return this._error?a.dy`<hass-error-screen .error="${this._error}"></hass-error-screen>`:a.Ld}},{kind:"method",key:"_createRedirectUrl",value:function(r){const e=this._createRedirectParams(r);return`${r.redirect}${e}`}},{kind:"method",key:"_createRedirectParams",value:function(r){const e=(0,c.Q2)();if(!r.params&&!Object.keys(e).length)return"";const s={};return Object.entries(r.params||{}).forEach((([r,t])=>{if(!e[r]||!this._checkParamType(t,e[r]))throw Error();s[r]=e[r]})),Object.entries(r.optional_params||{}).forEach((([r,t])=>{if(e[r]){if(!this._checkParamType(t,e[r]))throw Error();s[r]=e[r]}})),`?${(0,c.ou)(s)}`}},{kind:"method",key:"_checkParamType",value:function(r,e){return"string"===r||"url"===r&&(e&&e===(0,i.sanitizeUrl)(e))}}]}}),a.oi)}};
//# sourceMappingURL=29756.647c77b61ba747e5.js.map