homebridge-config-ui-x 5.8.1-beta.10 → 5.8.1-beta.11
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/CHANGELOG.md +1 -0
- package/package.json +1 -1
- package/public/{chunk-QD3VVLOS.js → chunk-265KMAKU.js} +1 -1
- package/public/{chunk-BI7LP7NL.js → chunk-32PNKEBU.js} +1 -1
- package/public/{chunk-GJ4NQ6RR.js → chunk-45JBQ27F.js} +1 -1
- package/public/{chunk-6EXUDJK2.js → chunk-4E3TNUZA.js} +1 -1
- package/public/{chunk-PKFOUW7F.js → chunk-4FR5IUD6.js} +1 -1
- package/public/{chunk-MC3ZSW3C.js → chunk-54MO372V.js} +1 -1
- package/public/{chunk-6BSVFS3Z.js → chunk-5RUAAFRN.js} +1 -1
- package/public/{chunk-MHXXUKNU.js → chunk-6M4BKXPC.js} +1 -1
- package/public/{chunk-OO2PFMUT.js → chunk-72KUFY2I.js} +1 -1
- package/public/{chunk-ZL7WGJJW.js → chunk-7AQ3U466.js} +1 -1
- package/public/{chunk-2HJ656K2.js → chunk-7NT5O6NB.js} +1 -1
- package/public/{chunk-U5XWZU46.js → chunk-B7RSGI3Z.js} +1 -1
- package/public/{chunk-KBANEWIP.js → chunk-BG4ME3P7.js} +1 -1
- package/public/{chunk-WWOSAPQ6.js → chunk-CXUIQYGD.js} +1 -1
- package/public/{chunk-7T3PHJA2.js → chunk-DCHKUJZE.js} +1 -1
- package/public/{chunk-XNI3GOWL.js → chunk-E2Y73M2C.js} +1 -1
- package/public/{chunk-LLGR6YT6.js → chunk-EDB2UTOB.js} +1 -1
- package/public/{chunk-UDI7EA7K.js → chunk-FMVILKMI.js} +1 -1
- package/public/{chunk-5IK7S5UY.js → chunk-FMZG46GC.js} +1 -1
- package/public/{chunk-6IQUVFAH.js → chunk-GCWIOFO2.js} +20 -20
- package/public/{chunk-IMHGEFPQ.js → chunk-GKPSTVMD.js} +1 -1
- package/public/{chunk-YJAZ7E5U.js → chunk-GPQF5BVT.js} +1 -1
- package/public/{chunk-KRAE3ZV7.js → chunk-HCVBQMPY.js} +1 -1
- package/public/{chunk-5HSTGU2S.js → chunk-HOEWVSEV.js} +1 -1
- package/public/{chunk-SBX42YGL.js → chunk-IGNYAGV3.js} +1 -1
- package/public/{chunk-BPL74ASO.js → chunk-IOQQFCCQ.js} +1 -1
- package/public/{chunk-HOVPO47J.js → chunk-IQSWTLDE.js} +1 -1
- package/public/{chunk-OTLQZLR6.js → chunk-JFWMDYB2.js} +1 -1
- package/public/{chunk-XYQ2P6TQ.js → chunk-JK5YO5KW.js} +1 -1
- package/public/chunk-KNKBGJLC.js +1 -0
- package/public/{chunk-FSNKYVUR.js → chunk-KR6UKANA.js} +1 -1
- package/public/{chunk-HVEA2SOL.js → chunk-KRITOQOP.js} +1 -1
- package/public/{chunk-WQPHE2UF.js → chunk-LGE6IIB6.js} +1 -1
- package/public/{chunk-C23A5G7X.js → chunk-MGEETPA4.js} +1 -1
- package/public/{chunk-NJB7W7XG.js → chunk-MTRIU6D6.js} +1 -1
- package/public/{chunk-4GXPXAHY.js → chunk-OATJRYLX.js} +1 -1
- package/public/{chunk-AF6WHPSI.js → chunk-PA763GKM.js} +1 -1
- package/public/{chunk-BF2MU3RQ.js → chunk-PX4RUPGA.js} +1 -1
- package/public/{chunk-ZA7Y6W26.js → chunk-Q5HBBNPS.js} +1 -1
- package/public/{chunk-VNVPY4GU.js → chunk-RBK35FRK.js} +1 -1
- package/public/{chunk-I4IR5TID.js → chunk-REQ2KDPF.js} +1 -1
- package/public/{chunk-7RAE6BDV.js → chunk-RL3JMCBV.js} +1 -1
- package/public/{chunk-LCVDYVDC.js → chunk-RNGMPCB7.js} +1 -1
- package/public/{chunk-FECLRIF2.js → chunk-RSX7YTWK.js} +1 -1
- package/public/{chunk-LUVKT24F.js → chunk-S7APF3RO.js} +1 -1
- package/public/{chunk-OAWUW5JK.js → chunk-SCAD3EW6.js} +1 -1
- package/public/{chunk-AOMA2RFA.js → chunk-T22TV4MJ.js} +1 -1
- package/public/{chunk-OMFAE35M.js → chunk-TIRNCEGL.js} +1 -1
- package/public/{chunk-YX6RZUQD.js → chunk-UTPDI7IW.js} +1 -1
- package/public/{chunk-GU2LDNRA.js → chunk-VFTAEW2J.js} +1 -1
- package/public/{chunk-P47D6YKF.js → chunk-WDOEQLFB.js} +1 -1
- package/public/{chunk-LQIV3IVL.js → chunk-YRAXAUQH.js} +1 -1
- package/public/{chunk-WKZJCNS6.js → chunk-ZIHUFL2Q.js} +1 -1
- package/public/index.html +1 -1
- package/public/{main-MGR4YROM.js → main-HY23LZ3Q.js} +1 -1
- package/public/chunk-MFJYDGFF.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as b}from"./chunk-
|
|
1
|
+
import{a as b}from"./chunk-JFWMDYB2.js";import"./chunk-FMVILKMI.js";import{e as T}from"./chunk-NKVA4YGF.js";import{b as w}from"./chunk-BG4ME3P7.js";import{k as C,l as $,n as k,q as S}from"./chunk-GPQF5BVT.js";import{$b as s,Ab as r,Bb as i,Cb as l,Jb as E,La as x,Nb as h,Qa as n,_b as a,db as _,lc as g,na as o,qb as d,rb as f,rc as m,sc as c,tc as y}from"./chunk-YYORCSG2.js";var I=t=>({command:t});function D(t,u){if(t&1&&(r(0,"div",7),a(1),i()),t&2){let e=h();n(),s(e.error)}}function R(t,u){t&1&&(r(0,"p",9),a(1),m(2,"translate"),i(),r(3,"div",10)(4,"div",11),l(5,"i",12),i()()),t&2&&(n(),s(c(2,1,"restart.please_wait_while_server_restarts")))}function B(t,u){if(t&1&&(r(0,"div",8)(1,"p"),a(2),m(3,"translate"),i(),l(4,"p",13),m(5,"translate"),i()),t&2){let e=h();n(2),s(c(3,2,"platform.docker.server_long_time")),n(2),E("innerHTML",y(5,4,"platform.docker.run_with_restart",g(7,I,e.command)),x)}}var U=(()=>{class t{$api=o(S);$router=o(T);$settings=o(w);$toastr=o(k);$translate=o(C);$ws=o(b);checkTimeout;checkDelay;io;resp={};timeout=!1;error=!1;command='<span class="font-monospace">--restart=always</span>';ngOnInit(){this.io=this.$ws.connectToNamespace("status"),this.io.connected.subscribe(()=>{this.io.socket.emit("monitor-server-status"),this.$settings.getAppSettings().catch(()=>{})}),this.$api.put("/platform-tools/docker/restart-container",{}).subscribe({next:e=>{this.resp=e,this.checkIfServerUp()},error:e=>{this.error=this.$translate.instant("restart.toast_server_restart_error"),console.error(e),this.$toastr.error(this.$translate.instant("restart.toast_server_restart_error"),this.$translate.instant("toast.title_error"))}})}ngOnDestroy(){this.io.end(),clearTimeout(this.checkDelay),clearTimeout(this.checkTimeout)}checkIfServerUp(){this.checkDelay=setTimeout(()=>{this.io.socket.on("homebridge-status",e=>{(e.status==="ok"||e.status==="pending")&&(this.$toastr.success(this.$translate.instant("platform.docker.container_restarted"),this.$translate.instant("toast.title_success")),this.$router.navigate(["/"]))})},1e4),this.checkTimeout=setTimeout(()=>{this.$toastr.warning(this.$translate.instant("restart.toast_server_restart_timeout"),this.$translate.instant("toast.title_warning"),{timeOut:1e4}),this.timeout=!0},6e4)}static \u0275fac=function(p){return new(p||t)};static \u0275cmp=_({type:t,selectors:[["ng-component"]],decls:14,vars:8,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,"fab","fa-docker",2,"font-size","75px"],[1,"text-center"],[1,"primary-text","mb-4"],[1,"alert","alert-error","my-4"],[1,"alert","alert-warning","my-4"],[1,"grey-text"],[1,"justify-content-center","my-4"],[1,"restart-progress-box","primary-text"],[1,"fas","fa-spinner","fa-spin"],[1,"grey-text","mb-0",3,"innerHTML"]],template:function(p,v){p&1&&(r(0,"div",0)(1,"h3",1),a(2),m(3,"translate"),i()(),r(4,"div",2)(5,"div",3),l(6,"i",4),i(),r(7,"div",5)(8,"h4",6),a(9),m(10,"translate"),i(),d(11,D,2,1,"div",7)(12,R,6,3),d(13,B,6,9,"div",8),i()()),p&2&&(n(2),s(c(3,4,"menu.restart.title")),n(7),s(c(10,6,"platform.docker.title_restarting")),n(2),f(v.error?11:12),n(2),f(v.timeout?13:-1))},dependencies:[$],styles:[".restart-progress-box[_ngcontent-%COMP%]{font-size:22px;font-weight:300;margin-top:15px}"]})}return t})();export{U as ContainerRestartComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as i}from"./chunk-NKVA4YGF.js";import{eb as e,ja as t}from"./chunk-YYORCSG2.js";var d=[{path:"",redirectTo:"/",pathMatch:"full"},{path:"docker",loadChildren:()=>import("./chunk-
|
|
1
|
+
import{h as i}from"./chunk-NKVA4YGF.js";import{eb as e,ja as t}from"./chunk-YYORCSG2.js";var d=[{path:"",redirectTo:"/",pathMatch:"full"},{path:"docker",loadChildren:()=>import("./chunk-CXUIQYGD.js").then(o=>o.DockerModule)},{path:"linux",loadChildren:()=>import("./chunk-Q5HBBNPS.js").then(o=>o.LinuxModule)},{path:"terminal",loadChildren:()=>import("./chunk-HOEWVSEV.js").then(o=>o.TerminalModule)}],l=(()=>{class o{static \u0275fac=function(r){return new(r||o)};static \u0275mod=e({type:o});static \u0275inj=t({imports:[i.forChild(d),i]})}return o})();var p=(()=>{class o{static \u0275fac=function(r){return new(r||o)};static \u0275mod=e({type:o});static \u0275inj=t({imports:[l]})}return o})();export{p as PlatformToolsModule};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as $}from"./chunk-
|
|
1
|
+
import{b as $}from"./chunk-BG4ME3P7.js";import{p as h,q as S}from"./chunk-GPQF5BVT.js";import{A as w,D as T,eb as E,gd as j,h as a,ia as d,ja as v,la as y,ma as l,na as p,s as f,x as c,xa as I,y as k}from"./chunk-YYORCSG2.js";var g=new y("JWT_OPTIONS"),m=(()=>{class i{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+/=",o="";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 r=0,s,n,D=0;n=e.charAt(D++);~n&&(s=r%4?s*64+n:n,r++%4)?o+=String.fromCharCode(255&s>>(-2*r&6)):0)n=t.indexOf(n);return o}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 o=this.urlBase64Decode(t[1]);if(!o)throw new Error("Cannot decode the token.");return JSON.parse(o)}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 o=new Date(0);return o.setUTCSeconds(t.exp),o}isTokenExpired(e=this.tokenGetter(),t){return e instanceof Promise?e.then(o=>this._isTokenExpired(o,t)):this._isTokenExpired(e,t)}_isTokenExpired(e,t){if(!e||e==="")return!0;let o=this.getTokenExpirationDate(e);return t=t||0,o===null?!1:!(o.valueOf()>new Date().valueOf()+t*1e3)}getAuthScheme(e,t){return typeof e=="function"?e(t):e}}return i.\u0275fac=function(e){return new(e||i)(l(g))},i.\u0275prov=d({token:i,factory:i.\u0275fac}),i})(),x=i=>i instanceof Promise?T(()=>i):f(i),b=(()=>{class i{constructor(e,t,o){this.jwtHelper=t,this.document=o,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 o=`${t.hostname}${t.port&&!this.standardPorts.includes(t.port)?":"+t.port:""}`;return this.allowedDomains.findIndex(r=>typeof r=="string"?r===o:r instanceof RegExp?r.test(o):!1)>-1}isDisallowedRoute(e){let t=new URL(e.url,this.document.location.origin);return this.disallowedRoutes.findIndex(o=>{if(typeof o=="string"){let r=new URL(o,this.document.location.origin);return r.hostname===t.hostname&&r.pathname===t.pathname}return o instanceof RegExp?o.test(e.url):!1})>-1}handleInterception(e,t,o){let r=this.jwtHelper.getAuthScheme(this.authScheme,t);if(!e&&this.throwNoTokenError)throw new Error("Could not get token from tokenGetter function.");let s=f(!1);return this.skipWhenExpired&&(s=e?x(this.jwtHelper.isTokenExpired(e)):f(!0)),e?s.pipe(k(n=>n&&this.skipWhenExpired?t.clone():t.clone({setHeaders:{[this.headerName]:`${r}${e}`}})),w(n=>o.handle(n))):o.handle(t)}intercept(e,t){if(!this.isAllowedDomain(e)||this.isDisallowedRoute(e))return t.handle(e);let o=this.tokenGetter(e);return x(o).pipe(w(r=>this.handleInterception(r,e,t)))}}return i.\u0275fac=function(e){return new(e||i)(l(g),l(m),l(I))},i.\u0275prov=d({token:i,factory:i.\u0275fac}),i})(),U=(()=>{class i{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:i,providers:[{provide:j,useClass:b,multi:!0},e.jwtOptionsProvider||{provide:g,useValue:e.config},m]}}}return i.\u0275fac=function(e){return new(e||i)(l(i,12))},i.\u0275mod=E({type:i}),i.\u0275inj=v({}),i})();var X=(()=>{class i{$api=p(S);$jwtHelper=p(m);$settings=p($);token;user={};logoutTimer;lastRefreshTime=Date.now();isRefreshing=!1;constructor(){this.loadToken()}login(e){return a(this,null,function*(){let t=yield c(this.$api.post("/auth/login",e));if(!this.validateToken(t.access_token))throw new Error("Invalid username or password.");window.localStorage.setItem(h.jwt.tokenKey,t.access_token),yield this.$settings.getAppSettings()})}noauth(){return a(this,null,function*(){let e=yield c(this.$api.post("/auth/noauth",{}));if(this.validateToken(e.access_token))window.localStorage.setItem(h.jwt.tokenKey,e.access_token),yield this.$settings.getAppSettings();else throw new Error("Invalid username or password.")})}logout(){this.user=null,this.token=null,clearTimeout(this.logoutTimer),window.localStorage.removeItem(h.jwt.tokenKey),window.location.reload()}loadToken(){return a(this,null,function*(){this.$settings.settingsLoaded||(yield c(this.$settings.onSettingsLoaded));let e=window.localStorage.getItem(h.jwt.tokenKey);e&&this.validateToken(e)})}checkToken(){return a(this,null,function*(){if(!this.token||this.$jwtHelper.isTokenExpired(this.token,this.$settings.serverTimeOffset)){console.warn("Token expired on client side, logging out immediately"),this.logout();return}try{return yield c(this.$api.get("/auth/check"))}catch(e){throw e.status===401&&(console.warn("Current token is not valid on server"),this.logout()),e}})}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)}validateToken(e){try{return this.$jwtHelper.isTokenExpired(e,this.$settings.serverTimeOffset)&&this.logout(),this.user=this.$jwtHelper.decodeToken(e),this.token=e,this.setLogoutTimer(),!0}catch{return window.localStorage.removeItem(h.jwt.tokenKey),this.token=null,!1}}setLogoutTimer(){if(clearTimeout(this.logoutTimer),!this.$jwtHelper.isTokenExpired(this.token,this.$settings.serverTimeOffset)){let e=this.$settings.sessionTimeout*1e3;e<=2147483647&&(this.logoutTimer=setTimeout(()=>a(this,null,function*(){this.$settings.formAuth===!1?(yield this.noauth(),window.location.reload()):this.logout()}),e))}}checkAndRefreshIfNeeded(){return a(this,null,function*(){if(!this.$settings.formAuth||!this.$settings.sessionTimeoutInactivityBased||!this.token||!this.isLoggedIn()||this.isRefreshing)return;let t=Date.now()-this.lastRefreshTime,r=this.$settings.sessionTimeout*1e3*.7;if(t>r)try{yield this.refreshSession()}catch(s){console.error("Failed to refresh session:",s)}})}refreshSession(){return a(this,null,function*(){if(!this.isRefreshing){this.isRefreshing=!0;try{let e=yield c(this.$api.post("/auth/refresh",{}));e.access_token&&(this.token=e.access_token,window.localStorage.setItem(h.jwt.tokenKey,e.access_token),this.lastRefreshTime=Date.now(),this.setLogoutTimer())}finally{this.isRefreshing=!1}}})}static \u0275fac=function(t){return new(t||i)};static \u0275prov=d({token:i,factory:i.\u0275fac})}return i})();export{U as a,X as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as c}from"./chunk-
|
|
1
|
+
import{b as c}from"./chunk-FMVILKMI.js";import{p as r}from"./chunk-GPQF5BVT.js";import{h as i,ia as a,na as o}from"./chunk-YYORCSG2.js";var h=(()=>{class t{cache=null;CACHE_DURATION_MS=6e4;getToken(){let n=Date.now();if(this.cache&&n-this.cache.timestamp<this.CACHE_DURATION_MS)return this.cache.token;let e=window.localStorage.getItem(r.jwt.tokenKey);return this.cache={token:e,timestamp:n},e}invalidateCache(){this.cache=null}static \u0275fac=function(e){return new(e||t)};static \u0275prov=a({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();var p=(()=>{class t{$auth=o(c);$tokenCache=o(h);isAuthenticated(){return i(this,null,function*(){if(!this.$tokenCache.getToken())return this.$auth.token=null,this.$auth.user={},this.$tokenCache.invalidateCache(),!1;try{let e=this.$auth.isLoggedIn();return e||(this.$auth.token=null,this.$auth.user={},this.$tokenCache.invalidateCache()),e}catch{return console.warn("Token validation error, clearing auth state"),this.$auth.logout(),this.$tokenCache.invalidateCache(),!1}})}static \u0275fac=function(e){return new(e||t)};static \u0275prov=a({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();export{h as a,p as b};
|