UNPKG

iobroker.lovelace

Version:

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

2 lines 2.76 kB
"use strict";(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([["29756"],{83894:function(r,e,s){s.r(e),s.d(e,{REDIRECTS:()=>p});var t=s(61701),o=s(72621),i=(s(52247),s(71695),s(9359),s(31526),s(47021),s(68203)),a=s(57243),n=s(50778),d=s(83523),c=s(58776);s(34515);let u,h,l=r=>r;const p={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,n.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,n.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,n.Cb)({attribute:!1})],key:"supervisor",value:void 0},{kind:"field",decorators:[(0,n.Cb)({attribute:!1})],key:"route",value:void 0},{kind:"field",decorators:[(0,n.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=p[r];if(!e)return void(this._error=this.supervisor.localize("my.not_supported",{link:(0,a.dy)(u||(u=l`<a target="_blank" rel="noreferrer noopener" href="https://my.home-assistant.io/faq.html#supported-pages"> ${0} </a>`),this.supervisor.localize("my.faq_link"))}));let t;try{t=this._createRedirectUrl(e)}catch(i){return void(this._error=this.supervisor.localize("my.error"))}(0,d.c)(t,{replace:!0})}},{kind:"method",key:"render",value:function(){return this._error?(0,a.dy)(h||(h=l`<hass-error-screen .error="${0}"></hass-error-screen>`),this._error):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.65b8c66f5a611aa7.js.map