homebridge-config-ui-x 5.0.0-beta.0 → 5.0.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/public/{chunk-DPQR4EUP.js → chunk-2ZL77L5V.js} +1 -1
- package/public/{chunk-UEBRERJ6.js → chunk-36QI2JZZ.js} +1 -1
- package/public/{chunk-PSLVYKAC.js → chunk-54RIF7BL.js} +1 -1
- package/public/{chunk-Q7MYZYMQ.js → chunk-6PFEOQAC.js} +1 -1
- package/public/{chunk-HPRZRVV7.js → chunk-AA4ALV5Q.js} +1 -1
- package/public/{chunk-2XSSTW65.js → chunk-C4DMFK2F.js} +1 -1
- package/public/{chunk-47MGIKRX.js → chunk-CMASH2I6.js} +1 -1
- package/public/{chunk-XLAWLJES.js → chunk-D63P2BMG.js} +1 -1
- package/public/{chunk-NTTD35IF.js → chunk-E6TKCZQK.js} +1 -1
- package/public/{chunk-6T267MJT.js → chunk-EEAGROCO.js} +1 -1
- package/public/{chunk-GUXB6V7U.js → chunk-EXLYVJ3I.js} +1 -1
- package/public/{chunk-JQO6VAZ5.js → chunk-H7H7YVXE.js} +1 -1
- package/public/{chunk-CTWXFHBK.js → chunk-LL4U2S7T.js} +1 -1
- package/public/{chunk-SI3MSSTT.js → chunk-MMU5EB5I.js} +1 -1
- package/public/{chunk-3MMTBP3D.js → chunk-MQHO5ODL.js} +1 -1
- package/public/{chunk-6SZTMLNK.js → chunk-MQOC5AAT.js} +1 -1
- package/public/{chunk-C4VKSYGU.js → chunk-NJRXPLIM.js} +1 -1
- package/public/{chunk-DLVT4K74.js → chunk-NLHSKWUN.js} +1 -1
- package/public/{chunk-HXKR7RPF.js → chunk-PCHM6ESV.js} +1 -1
- package/public/{chunk-LM3J4EYP.js → chunk-PREOLVG7.js} +1 -1
- package/public/{chunk-2PWJQ3JG.js → chunk-RYWTZYEC.js} +1 -1
- package/public/{chunk-3SUL4N2K.js → chunk-TCMARCBB.js} +1 -1
- package/public/{chunk-K5UREZLG.js → chunk-UBGLUD5C.js} +1 -1
- package/public/{chunk-TTLBPD7L.js → chunk-V7NUKNPP.js} +1 -1
- package/public/{chunk-CKS7IGEQ.js → chunk-W5QNZH4U.js} +1 -1
- package/public/{chunk-3PUISAM4.js → chunk-YXVNS6GA.js} +1 -1
- package/public/index.html +1 -1
- package/public/{main-DTWXJAMM.js → main-EIMWK4RL.js} +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as H,b as h,c as $,m as S}from"./chunk-
|
|
1
|
+
import{a as H,b as h,c as $,m as S}from"./chunk-54RIF7BL.js";import{Lb as I,W as p,X as j,Y as E,Z as a,aa as y,g as O,h as l,i as d,ic as x,p as f,t as u,u as T,v as w,x as v}from"./chunk-IGUSDGD6.js";var k=O(H(),1);var g=new E("JWT_OPTIONS"),m=(()=>{class o{constructor(e=null){this.tokenGetter=e&&e.tokenGetter||function(){}}urlBase64Decode(e){let t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:{t+="==";break}case 3:{t+="=";break}default:throw new Error("Illegal base64url string!")}return this.b64DecodeUnicode(t)}b64decode(e){let t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",r="";if(e=String(e).replace(/=+$/,""),e.length%4===1)throw new Error("'atob' failed: The string to be decoded is not correctly encoded.");for(let i=0,c,s,b=0;s=e.charAt(b++);~s&&(c=i%4?c*64+s:s,i++%4)?r+=String.fromCharCode(255&c>>(-2*i&6)):0)s=t.indexOf(s);return r}b64DecodeUnicode(e){return decodeURIComponent(Array.prototype.map.call(this.b64decode(e),t=>"%"+("00"+t.charCodeAt(0).toString(16)).slice(-2)).join(""))}decodeToken(e=this.tokenGetter()){return e instanceof Promise?e.then(t=>this._decodeToken(t)):this._decodeToken(e)}_decodeToken(e){if(!e||e==="")return null;let t=e.split(".");if(t.length!==3)throw new Error("The inspected token doesn't appear to be a JWT. Check to make sure it has three parts and see https://jwt.io for more.");let r=this.urlBase64Decode(t[1]);if(!r)throw new Error("Cannot decode the token.");return JSON.parse(r)}getTokenExpirationDate(e=this.tokenGetter()){return e instanceof Promise?e.then(t=>this._getTokenExpirationDate(t)):this._getTokenExpirationDate(e)}_getTokenExpirationDate(e){let t;if(t=this.decodeToken(e),!t||!t.hasOwnProperty("exp"))return null;let r=new Date(0);return r.setUTCSeconds(t.exp),r}isTokenExpired(e=this.tokenGetter(),t){return e instanceof Promise?e.then(r=>this._isTokenExpired(r,t)):this._isTokenExpired(e,t)}_isTokenExpired(e,t){if(!e||e==="")return!0;let r=this.getTokenExpirationDate(e);return t=t||0,r===null?!1:!(r.valueOf()>new Date().valueOf()+t*1e3)}getAuthScheme(e,t){return typeof e=="function"?e(t):e}}return o.\u0275fac=function(e){return new(e||o)(a(g))},o.\u0275prov=p({token:o,factory:o.\u0275fac}),o})(),D=o=>o instanceof Promise?v(()=>o):f(o),J=(()=>{class o{constructor(e,t,r){this.jwtHelper=t,this.document=r,this.standardPorts=["80","443"],this.tokenGetter=e.tokenGetter,this.headerName=e.headerName||"Authorization",this.authScheme=e.authScheme||e.authScheme===""?e.authScheme:"Bearer ",this.allowedDomains=e.allowedDomains||[],this.disallowedRoutes=e.disallowedRoutes||[],this.throwNoTokenError=e.throwNoTokenError||!1,this.skipWhenExpired=e.skipWhenExpired}isAllowedDomain(e){let t=new URL(e.url,this.document.location.origin);if(t.host===this.document.location.host)return!0;let r=`${t.hostname}${t.port&&!this.standardPorts.includes(t.port)?":"+t.port:""}`;return this.allowedDomains.findIndex(i=>typeof i=="string"?i===r:i instanceof RegExp?i.test(r):!1)>-1}isDisallowedRoute(e){let t=new URL(e.url,this.document.location.origin);return this.disallowedRoutes.findIndex(r=>{if(typeof r=="string"){let i=new URL(r,this.document.location.origin);return i.hostname===t.hostname&&i.pathname===t.pathname}return r instanceof RegExp?r.test(e.url):!1})>-1}handleInterception(e,t,r){let i=this.jwtHelper.getAuthScheme(this.authScheme,t);if(!e&&this.throwNoTokenError)throw new Error("Could not get token from tokenGetter function.");let c=f(!1);return this.skipWhenExpired&&(c=e?D(this.jwtHelper.isTokenExpired(e)):f(!0)),e?c.pipe(T(s=>s&&this.skipWhenExpired?t.clone():t.clone({setHeaders:{[this.headerName]:`${i}${e}`}})),w(s=>r.handle(s))):r.handle(t)}intercept(e,t){if(!this.isAllowedDomain(e)||this.isDisallowedRoute(e))return t.handle(e);let r=this.tokenGetter(e);return D(r).pipe(w(i=>this.handleInterception(i,e,t)))}}return o.\u0275fac=function(e){return new(e||o)(a(g),a(m),a(I))},o.\u0275prov=p({token:o,factory:o.\u0275fac}),o})(),K=(()=>{class o{constructor(e){if(e)throw new Error("JwtModule is already loaded. It should only be imported in your application's main module.")}static forRoot(e){return{ngModule:o,providers:[{provide:x,useClass:J,multi:!0},e.jwtOptionsProvider||{provide:g,useValue:e.config},m]}}}return o.\u0275fac=function(e){return new(e||o)(a(o,12))},o.\u0275mod=y({type:o}),o.\u0275inj=j({}),o})();var X=(()=>{let n=class n{constructor(t,r,i){l(this,"$api");l(this,"$jwtHelper");l(this,"$settings");l(this,"token");l(this,"user",{});l(this,"logoutTimer");this.$api=t,this.$jwtHelper=r,this.$settings=i,this.loadToken()}login(t){return d(this,null,function*(){let r=yield u(this.$api.post("/auth/login",t));if(!this.validateToken(r.access_token))throw new Error("Invalid username or password.");window.localStorage.setItem(h.jwt.tokenKey,r.access_token),yield this.$settings.getAppSettings()})}noauth(){return d(this,null,function*(){let t=yield u(this.$api.post("/auth/noauth",{}));if(this.validateToken(t.access_token))window.localStorage.setItem(h.jwt.tokenKey,t.access_token),yield this.$settings.getAppSettings();else throw new Error("Invalid username or password.")})}logout(){this.user=null,this.token=null,window.localStorage.removeItem(h.jwt.tokenKey),window.location.reload()}loadToken(){return d(this,null,function*(){this.$settings.settingsLoaded||(yield u(this.$settings.onSettingsLoaded));let t=window.localStorage.getItem(h.jwt.tokenKey);t&&this.validateToken(t)})}validateToken(t){try{return this.$jwtHelper.isTokenExpired(t,this.$settings.serverTimeOffset)&&this.logout(),this.user=this.$jwtHelper.decodeToken(t),this.token=t,this.setLogoutTimer(),!0}catch{return window.localStorage.removeItem(h.jwt.tokenKey),this.token=null,!1}}checkToken(){return d(this,null,function*(){try{return yield u(this.$api.get("/auth/check"))}catch(t){t.status===401&&(console.error("Current token is not valid"),this.logout())}})}setLogoutTimer(){if(clearTimeout(this.logoutTimer),!this.$jwtHelper.isTokenExpired(this.token,this.$settings.serverTimeOffset)){let r=(0,k.default)(this.$jwtHelper.getTokenExpirationDate(this.token)).diff((0,k.default)().add(this.$settings.serverTimeOffset,"s"),"millisecond");r<=2147483647&&(this.logoutTimer=setTimeout(()=>d(this,null,function*(){this.$settings.formAuth===!1?(yield this.noauth(),window.location.reload()):this.logout()}),r))}}isLoggedIn(){return this.$settings.env.instanceId!==this.user.instanceId?(console.error("Token does not match instance"),!1):this.user&&this.token&&!this.$jwtHelper.isTokenExpired(this.token,this.$settings.serverTimeOffset)}};l(n,"\u0275fac",function(r){return new(r||n)(a($),a(m),a(S))}),l(n,"\u0275prov",p({token:n,factory:n.\u0275fac}));let o=n;return o})();export{m as a,K as b,X as c};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{M as R}from"./chunk-WCDFKYP6.js";import{c as y,k as I}from"./chunk-
|
|
1
|
+
import{M as R}from"./chunk-WCDFKYP6.js";import{c as y,k as I}from"./chunk-54RIF7BL.js";import{a as x,b as k}from"./chunk-F22FMU37.js";import{$,Ka as v,Ua as e,Va as c,Wa as b,ab as u,h as t,jb as p,kb as _,lb as h,sc as g,wa as i,xa as l,yb as r,zb as a}from"./chunk-IGUSDGD6.js";var D=(()=>{let n=class n{constructor(o,s,d,m,S){t(this,"$activeModal");t(this,"$api");t(this,"$router");t(this,"$toastr");t(this,"$translate");t(this,"fullRestart",!1);this.$activeModal=o,this.$api=s,this.$router=d,this.$toastr=m,this.$translate=S}onRestartHomebridgeClick(){if(!this.fullRestart){this.$router.navigate(["/restart"]),this.$activeModal.close();return}this.$api.put("/platform-tools/hb-service/set-full-service-restart-flag",{}).subscribe({next:()=>{this.$router.navigate(["/restart"]),this.$activeModal.close()},error:o=>{console.error(o),this.$toastr.error(o.message,this.$translate.instant("toast.title_error"))}})}};t(n,"\u0275fac",function(s){return new(s||n)(l(R),l(y),l(g),l(I),l(x))}),t(n,"\u0275cmp",$({type:n,selectors:[["ng-component"]],inputs:{fullRestart:"fullRestart"},decls:25,vars:18,consts:[[1,"modal-content"],[1,"modal-header"],[1,"modal-title"],["type","button","data-dismiss","modal",1,"close",3,"click"],["aria-hidden","true"],[1,"modal-body","w-100","text-center"],[1,"fas","fa-fw","fa-power-off","primary-text","mb-4",2,"font-size","75px"],[1,"w-100"],[1,"modal-footer","justify-content-between"],[1,"text-left"],["type","button","data-dismiss","modal",1,"btn","btn-elegant",3,"click"],[1,"text-center"],[1,"text-right"],["type","button",1,"btn","btn-primary",3,"click"]],template:function(s,d){s&1&&(e(0,"div",0)(1,"div",1)(2,"h5",2),p(3),r(4,"translate"),c(),e(5,"button",3),r(6,"translate"),u("click",function(){return d.$activeModal.dismiss("Dismiss")}),e(7,"span",4),p(8,"\xD7"),c()()(),e(9,"div",5),b(10,"i",6),e(11,"p",7),p(12),r(13,"translate"),c()(),e(14,"div",8)(15,"div",9)(16,"button",10),r(17,"translate"),u("click",function(){return d.$activeModal.dismiss("Dismiss")}),p(18),r(19,"translate"),c()(),b(20,"div",11),e(21,"div",12)(22,"button",13),u("click",function(){return d.onRestartHomebridgeClick()}),p(23),r(24,"translate"),c()()()()),s&2&&(i(3),_(a(4,6,"platform.version.service_restart_required")),i(2),v("aria-label",a(6,8,"form.button_close")),i(7),_(a(13,10,"restart.homebridge")),i(4),v("aria-label",a(17,12,"form.button_close")),i(2),h(" ",a(19,14,"form.button_close")," "),i(5),h(" ",a(24,16,"menu.tooltip_restart")," "))},dependencies:[k],encapsulation:2}));let f=n;return f})();export{D as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{O as D,Q as F,z as R}from"./chunk-WCDFKYP6.js";import{c as N,k as O,m as H}from"./chunk-
|
|
1
|
+
import{O as D,Q as F,z as R}from"./chunk-WCDFKYP6.js";import{c as N,k as O,m as H}from"./chunk-54RIF7BL.js";import{a as M,b as P,c as B}from"./chunk-F22FMU37.js";import{$ as S,$b as V,Ga as I,La as _,Rb as j,Ua as s,Va as a,Wa as k,X as g,Za as h,aa as x,ab as d,bb as y,h as r,ha as b,ia as w,jb as l,kb as T,lb as f,sc as E,vc as $,wa as o,xa as u,yb as p,zb as c}from"./chunk-IGUSDGD6.js";function J(e,t){if(e&1){let v=h();s(0,"p",5)(1,"button",6),d("click",function(){b(v);let i=y();return w(i.restartServer())}),l(2),p(3,"translate"),a()()}e&2&&(o(2),f(" ",c(3,1,"menu.linux.label_restart_server")," "))}function K(e,t){if(e&1){let v=h();s(0,"p",5)(1,"button",6),d("click",function(){b(v);let i=y();return w(i.shutdownServer())}),l(2),p(3,"translate"),a()()}e&2&&(o(2),f(" ",c(3,1,"menu.linux.label_shutdown_server")," "))}function L(e,t){if(e&1){let v=h();s(0,"p",5)(1,"button",6),d("click",function(){b(v);let i=y();return w(i.dockerRestartContainer())}),l(2),p(3,"translate"),a()()}e&2&&(o(2),f(" ",c(3,1,"menu.docker.restart_container")," "))}var A=(()=>{let t=class t{constructor(n,i,m,C,G){r(this,"$api");r(this,"$router");r(this,"$settings");r(this,"$toastr");r(this,"$translate");this.$api=n,this.$router=i,this.$settings=m,this.$toastr=C,this.$translate=G}restartHomebridge(){this.$router.navigate(["/restart"])}restartHomebridgeService(){this.$api.put("/platform-tools/hb-service/set-full-service-restart-flag",{}).subscribe({next:()=>{this.$router.navigate(["/restart"])},error:n=>{console.error(n),this.$toastr.error(n.message,this.$translate.instant("toast.title_error"))}})}restartServer(){this.$router.navigate(["/platform-tools/linux/restart-server"])}shutdownServer(){this.$router.navigate(["/platform-tools/linux/shutdown-server"])}dockerRestartContainer(){this.$router.navigate(["/platform-tools/docker/restart-container"])}};r(t,"\u0275fac",function(i){return new(i||t)(u(N),u(E),u(H),u(O),u(M))}),r(t,"\u0275cmp",S({type:t,selectors:[["ng-component"]],decls:19,vars:15,consts:[[1,"d-flex","justify-content-between"],[1,"primary-text","m-0"],[1,"my-4","align-items-center",2,"max-width","1000px","margin","auto"],[1,"w-100","text-center","primary-text","mb-5"],[1,"fas","fa-fw","fa-power-off",2,"font-size","75px"],[1,"w-100","text-center","my-5"],["type","button",1,"btn","btn-primary","p-3","my-0",2,"width","85%",3,"click"],["type","button","container","body","openDelay","150","triggers","hover",1,"btn","btn-primary","p-3","my-0",2,"width","85%",3,"click","ngbTooltip"],["class","w-100 text-center my-5",4,"ngIf"]],template:function(i,m){i&1&&(s(0,"div",0)(1,"h3",1),l(2),p(3,"translate"),a()(),s(4,"div",2)(5,"div",3),k(6,"i",4),a(),s(7,"p",5)(8,"button",6),d("click",function(){return m.restartHomebridge()}),l(9),p(10,"translate"),a()(),s(11,"p",5)(12,"button",7),p(13,"translate"),d("click",function(){return m.restartHomebridgeService()}),l(14),p(15,"translate"),a()(),I(16,J,4,3,"p",8)(17,K,4,3,"p",8)(18,L,4,3,"p",8),a()),i&2&&(o(2),T(c(3,7,"menu.restart.title")),o(7),f(" ",c(10,9,"menu.hbrestart.confirm_hb")," "),o(3),_("ngbTooltip",c(13,11,"reset.force_restart_hb_help_text")),o(2),f(" ",c(15,13,"menu.hbrestart.confirm_ui")," "),o(2),_("ngIf",m.$settings.env.canShutdownRestartHost),o(),_("ngIf",m.$settings.env.canShutdownRestartHost),o(),_("ngIf",m.$settings.env.runningInDocker))},dependencies:[j,D,P],encapsulation:2}));let e=t;return e})();var Q=[{path:"",component:A}],q=(()=>{let t=class t{};r(t,"\u0275fac",function(i){return new(i||t)}),r(t,"\u0275mod",x({type:t})),r(t,"\u0275inj",g({imports:[$.forChild(Q),$]}));let e=t;return e})();var vt=(()=>{let t=class t{};r(t,"\u0275fac",function(i){return new(i||t)}),r(t,"\u0275mod",x({type:t})),r(t,"\u0275inj",g({imports:[V,q,F,R,B]}));let e=t;return e})();export{vt as PowerOptionsModule};
|
package/public/index.html
CHANGED
|
@@ -20,5 +20,5 @@
|
|
|
20
20
|
|
|
21
21
|
<body>
|
|
22
22
|
<app-root></app-root>
|
|
23
|
-
<link rel="modulepreload" href="chunk-
|
|
23
|
+
<link rel="modulepreload" href="chunk-2ZL77L5V.js"><link rel="modulepreload" href="chunk-MMU5EB5I.js"><link rel="modulepreload" href="chunk-36QI2JZZ.js"><link rel="modulepreload" href="chunk-BROUJ7PT.js"><link rel="modulepreload" href="chunk-H7H7YVXE.js"><link rel="modulepreload" href="chunk-AA4ALV5Q.js"><link rel="modulepreload" href="chunk-PREOLVG7.js"><link rel="modulepreload" href="chunk-LL4U2S7T.js"><link rel="modulepreload" href="chunk-4R6MSI5I.js"><link rel="modulepreload" href="chunk-SJTXTMYT.js"><script src="polyfills-CE2SNIQF.js" type="module" crossorigin="use-credentials"></script><script src="scripts-6GVLYD7F.js" defer crossorigin="use-credentials"></script><script src="main-EIMWK4RL.js" type="module" crossorigin="use-credentials"></script></body>
|
|
24
24
|
</html>
|