homebridge-config-ui-x 5.4.2-beta.7 → 5.4.2-beta.9

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.
Files changed (88) hide show
  1. package/CHANGELOG.md +12 -2
  2. package/dist/modules/accessories/accessories.service.js +5 -1
  3. package/dist/modules/accessories/accessories.service.js.map +1 -1
  4. package/dist/modules/plugins/plugins.service.d.ts +1 -0
  5. package/dist/modules/plugins/plugins.service.js +27 -15
  6. package/dist/modules/plugins/plugins.service.js.map +1 -1
  7. package/package.json +10 -5
  8. package/public/chunk-2CO3VBPY.js +1 -0
  9. package/public/{chunk-YZHAZSGE.js → chunk-3I6K5KUV.js} +1 -1
  10. package/public/{chunk-4MSFCTVQ.js → chunk-4WAU3AJS.js} +1 -1
  11. package/public/{chunk-ZY6Y43WL.js → chunk-5TCYRJ6A.js} +1 -1
  12. package/public/{chunk-4F3BAQ5O.js → chunk-5VA2P7IY.js} +1 -1
  13. package/public/{chunk-KIMRA3K7.js → chunk-6GMXEQVA.js} +1 -1
  14. package/public/{chunk-2XWUBKEU.js → chunk-77JZBWAC.js} +1 -1
  15. package/public/{chunk-7UI7QM4V.js → chunk-7LW4MGOQ.js} +1 -1
  16. package/public/{chunk-V2NELL63.js → chunk-AE7VAWOU.js} +1 -1
  17. package/public/{chunk-KJFP33AO.js → chunk-BBMQHM5Y.js} +1 -1
  18. package/public/{chunk-4NCLSTUB.js → chunk-BOJ5G5BR.js} +1 -1
  19. package/public/{chunk-RRPADCBT.js → chunk-BU65ZOCD.js} +1 -1
  20. package/public/{chunk-6V5YFV75.js → chunk-CCPSSGRZ.js} +1 -1
  21. package/public/{chunk-GHMXPHAP.js → chunk-CNMM42I5.js} +1 -1
  22. package/public/{chunk-CR4ZBYZW.js → chunk-D3JHDB7S.js} +1 -1
  23. package/public/{chunk-BMX3HHRX.js → chunk-DP64F7AR.js} +1 -1
  24. package/public/{chunk-7SEIUUE7.js → chunk-DYJDYESS.js} +1 -1
  25. package/public/{chunk-M425JDIT.js → chunk-E6YWZCLV.js} +1 -1
  26. package/public/{chunk-QRNW5KEK.js → chunk-EA3EXGPZ.js} +1 -1
  27. package/public/{chunk-NWUQOZLK.js → chunk-EOD26MLT.js} +1 -1
  28. package/public/{chunk-6OUDSSXN.js → chunk-F5LCQLBC.js} +1 -1
  29. package/public/chunk-FXX7OM3C.js +40 -0
  30. package/public/{chunk-77UFZWOO.js → chunk-G7FA4DP4.js} +1 -1
  31. package/public/{chunk-JWMUHHT5.js → chunk-GSI45GAI.js} +1 -1
  32. package/public/{chunk-3CKT2OQ7.js → chunk-H36QJYLQ.js} +3 -3
  33. package/public/{chunk-I4Z2M6DW.js → chunk-H3PPMCMP.js} +1 -1
  34. package/public/{chunk-SRK7ZHJU.js → chunk-H5ZWWQ4N.js} +1 -1
  35. package/public/{chunk-6I6TS7NS.js → chunk-I2TETZLW.js} +1 -1
  36. package/public/{chunk-X2QQNXTE.js → chunk-ICTLVT6T.js} +1 -1
  37. package/public/{chunk-KXDI62KE.js → chunk-J2QJA4E5.js} +1 -1
  38. package/public/chunk-JIAMQ2VI.js +1 -0
  39. package/public/{chunk-Z4TBQ5ME.js → chunk-KJ7TFOAF.js} +1 -1
  40. package/public/{chunk-IENA5L67.js → chunk-L452FIUI.js} +1 -1
  41. package/public/{chunk-QK4KTNPQ.js → chunk-LPHTUMGC.js} +1 -1
  42. package/public/{chunk-KCU6EMJC.js → chunk-MLQP4BIF.js} +1 -1
  43. package/public/chunk-N2DFJK5J.js +1 -0
  44. package/public/{chunk-EEI3BPIT.js → chunk-NFWGYMP7.js} +1 -1
  45. package/public/chunk-NGCBLX4N.js +1 -0
  46. package/public/{chunk-OXSXPR4C.js → chunk-NJOBXAPT.js} +1 -1
  47. package/public/{chunk-VBNG2YQZ.js → chunk-NQUU3I4B.js} +1 -1
  48. package/public/{chunk-RMAGF64Q.js → chunk-OKJ3EDLI.js} +1 -1
  49. package/public/{chunk-Q4UWK2FE.js → chunk-OPI4KEXA.js} +1 -1
  50. package/public/{chunk-JQJAMZI2.js → chunk-PGN4W67A.js} +1 -1
  51. package/public/{chunk-FZEXQZ5N.js → chunk-PJQJ4U6H.js} +1 -1
  52. package/public/{chunk-WST3XDBS.js → chunk-Q76LRRNA.js} +1 -1
  53. package/public/{chunk-2AOMAYLO.js → chunk-QKX6ZW6V.js} +1 -1
  54. package/public/{chunk-ZRXHCE63.js → chunk-QTPZZ54U.js} +1 -1
  55. package/public/chunk-R2OFMY4D.js +1 -0
  56. package/public/{chunk-AAAB34AQ.js → chunk-RVZECQBJ.js} +1 -1
  57. package/public/{chunk-YTNU24TR.js → chunk-SAZZA33Y.js} +1 -1
  58. package/public/{chunk-2L22XQX2.js → chunk-SJ3DSNFF.js} +1 -1
  59. package/public/{chunk-TQMERWYR.js → chunk-SNHTHMX3.js} +1 -1
  60. package/public/{chunk-NJ4ZO76F.js → chunk-TGOCI72Q.js} +1 -1
  61. package/public/{chunk-NORLI5CD.js → chunk-U2KAF42T.js} +1 -1
  62. package/public/{chunk-N6WB5CGQ.js → chunk-UHWT4HS2.js} +1 -1
  63. package/public/{chunk-IA32PJPE.js → chunk-UKLR7UOX.js} +1 -1
  64. package/public/chunk-UOLP7IQJ.js +1 -0
  65. package/public/chunk-UQX3UTFZ.js +4 -0
  66. package/public/{chunk-QUBAEQEC.js → chunk-V2P2FPJ7.js} +1 -1
  67. package/public/{chunk-SLXQKTB6.js → chunk-VU6MPE5H.js} +1 -1
  68. package/public/chunk-WV56IURB.js +30 -0
  69. package/public/{chunk-YSS66NWX.js → chunk-X7YL6WTA.js} +1 -1
  70. package/public/{chunk-J2JC6ZWM.js → chunk-XHYVOBCA.js} +1 -1
  71. package/public/{chunk-BZOIXE5M.js → chunk-XJZGI5OR.js} +1 -1
  72. package/public/{chunk-SRHJQ5GP.js → chunk-YATJTZML.js} +1 -1
  73. package/public/{chunk-Z6JMYIUL.js → chunk-YXI6VAVI.js} +1 -1
  74. package/public/{chunk-QPF5PFRM.js → chunk-Z3CXF63X.js} +1 -1
  75. package/public/{chunk-27YDRGYU.js → chunk-Z7BM53JV.js} +1 -1
  76. package/public/{chunk-UFVCERK3.js → chunk-ZHPB347D.js} +1 -1
  77. package/public/index.html +2 -2
  78. package/public/{main-PCGBMA6M.js → main-BZ3XOOI6.js} +1 -1
  79. package/public/{styles-LKRXKJ7O.css → styles-AUT3PDLG.css} +1 -1
  80. package/public/chunk-456M2QQG.js +0 -4
  81. package/public/chunk-4HFHNSTN.js +0 -1
  82. package/public/chunk-6WJPBOPW.js +0 -1
  83. package/public/chunk-7Q6VGFH2.js +0 -1
  84. package/public/chunk-BWN7SS7H.js +0 -30
  85. package/public/chunk-EQ64EQAS.js +0 -40
  86. package/public/chunk-MFTJIWVF.js +0 -1
  87. package/public/chunk-TNZKTZDM.js +0 -1
  88. package/public/chunk-WZ6F47WI.js +0 -1
@@ -1 +1 @@
1
- import{a as _,b as D}from"./chunk-M425JDIT.js";import{m as c,n as S}from"./chunk-6WJPBOPW.js";import{e as x}from"./chunk-KIMRA3K7.js";import{C as v,fa as h,g as O,ga as E,h as a,ia as y,ja as l,ka as f,nb as I,r as p,va as j,w as d,x as T,z as w}from"./chunk-3CKT2OQ7.js";var g=new y("JWT_OPTIONS"),m=(()=>{class r{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 i=0,s,n,b=0;n=e.charAt(b++);~n&&(s=i%4?s*64+n:n,i++%4)?o+=String.fromCharCode(255&s>>(-2*i&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 r.\u0275fac=function(e){return new(e||r)(l(g))},r.\u0275prov=h({token:r,factory:r.\u0275fac}),r})(),$=r=>r instanceof Promise?v(()=>r):p(r),R=(()=>{class r{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(i=>typeof i=="string"?i===o:i instanceof RegExp?i.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 i=new URL(o,this.document.location.origin);return i.hostname===t.hostname&&i.pathname===t.pathname}return o instanceof RegExp?o.test(e.url):!1})>-1}handleInterception(e,t,o){let i=this.jwtHelper.getAuthScheme(this.authScheme,t);if(!e&&this.throwNoTokenError)throw new Error("Could not get token from tokenGetter function.");let s=p(!1);return this.skipWhenExpired&&(s=e?$(this.jwtHelper.isTokenExpired(e)):p(!0)),e?s.pipe(T(n=>n&&this.skipWhenExpired?t.clone():t.clone({setHeaders:{[this.headerName]:`${i}${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 $(o).pipe(w(i=>this.handleInterception(i,e,t)))}}return r.\u0275fac=function(e){return new(e||r)(l(g),l(m),l(j))},r.\u0275prov=h({token:r,factory:r.\u0275fac}),r})(),F=(()=>{class r{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:r,providers:[{provide:x,useClass:R,multi:!0},e.jwtOptionsProvider||{provide:g,useValue:e.config},m]}}}return r.\u0275fac=function(e){return new(e||r)(l(r,12))},r.\u0275mod=I({type:r}),r.\u0275inj=E({}),r})();var k=O(_(),1);var q=(()=>{class r{$api=f(S);$jwtHelper=f(m);$settings=f(D);token;user={};logoutTimer;constructor(){this.loadToken()}login(e){return a(this,null,function*(){let t=yield d(this.$api.post("/auth/login",e));if(!this.validateToken(t.access_token))throw new Error("Invalid username or password.");window.localStorage.setItem(c.jwt.tokenKey,t.access_token),yield this.$settings.getAppSettings()})}noauth(){return a(this,null,function*(){let e=yield d(this.$api.post("/auth/noauth",{}));if(this.validateToken(e.access_token))window.localStorage.setItem(c.jwt.tokenKey,e.access_token),yield this.$settings.getAppSettings();else throw new Error("Invalid username or password.")})}logout(){this.user=null,this.token=null,window.localStorage.removeItem(c.jwt.tokenKey),window.location.reload()}loadToken(){return a(this,null,function*(){this.$settings.settingsLoaded||(yield d(this.$settings.onSettingsLoaded));let e=window.localStorage.getItem(c.jwt.tokenKey);e&&this.validateToken(e)})}checkToken(){return a(this,null,function*(){try{return yield d(this.$api.get("/auth/check"))}catch(e){e.status===401&&(console.error("Current token is not valid"),this.logout())}})}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(c.jwt.tokenKey),this.token=null,!1}}setLogoutTimer(){if(clearTimeout(this.logoutTimer),!this.$jwtHelper.isTokenExpired(this.token,this.$settings.serverTimeOffset)){let t=(0,k.default)(this.$jwtHelper.getTokenExpirationDate(this.token)).diff((0,k.default)().add(this.$settings.serverTimeOffset,"s"),"millisecond");t<=2147483647&&(this.logoutTimer=setTimeout(()=>a(this,null,function*(){this.$settings.formAuth===!1?(yield this.noauth(),window.location.reload()):this.logout()}),t))}}static \u0275fac=function(t){return new(t||r)};static \u0275prov=h({token:r,factory:r.\u0275fac})}return r})();export{F as a,q as b};
1
+ import{a as _,b as D}from"./chunk-E6YWZCLV.js";import{m as c,n as S}from"./chunk-2CO3VBPY.js";import{e as x}from"./chunk-6GMXEQVA.js";import{C as v,fa as h,g as O,ga as E,h as a,ia as y,ja as l,ka as f,nb as I,r as p,va as j,w as d,x as T,z as w}from"./chunk-H36QJYLQ.js";var g=new y("JWT_OPTIONS"),m=(()=>{class r{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 i=0,s,n,b=0;n=e.charAt(b++);~n&&(s=i%4?s*64+n:n,i++%4)?o+=String.fromCharCode(255&s>>(-2*i&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 r.\u0275fac=function(e){return new(e||r)(l(g))},r.\u0275prov=h({token:r,factory:r.\u0275fac}),r})(),$=r=>r instanceof Promise?v(()=>r):p(r),R=(()=>{class r{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(i=>typeof i=="string"?i===o:i instanceof RegExp?i.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 i=new URL(o,this.document.location.origin);return i.hostname===t.hostname&&i.pathname===t.pathname}return o instanceof RegExp?o.test(e.url):!1})>-1}handleInterception(e,t,o){let i=this.jwtHelper.getAuthScheme(this.authScheme,t);if(!e&&this.throwNoTokenError)throw new Error("Could not get token from tokenGetter function.");let s=p(!1);return this.skipWhenExpired&&(s=e?$(this.jwtHelper.isTokenExpired(e)):p(!0)),e?s.pipe(T(n=>n&&this.skipWhenExpired?t.clone():t.clone({setHeaders:{[this.headerName]:`${i}${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 $(o).pipe(w(i=>this.handleInterception(i,e,t)))}}return r.\u0275fac=function(e){return new(e||r)(l(g),l(m),l(j))},r.\u0275prov=h({token:r,factory:r.\u0275fac}),r})(),F=(()=>{class r{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:r,providers:[{provide:x,useClass:R,multi:!0},e.jwtOptionsProvider||{provide:g,useValue:e.config},m]}}}return r.\u0275fac=function(e){return new(e||r)(l(r,12))},r.\u0275mod=I({type:r}),r.\u0275inj=E({}),r})();var k=O(_(),1);var q=(()=>{class r{$api=f(S);$jwtHelper=f(m);$settings=f(D);token;user={};logoutTimer;constructor(){this.loadToken()}login(e){return a(this,null,function*(){let t=yield d(this.$api.post("/auth/login",e));if(!this.validateToken(t.access_token))throw new Error("Invalid username or password.");window.localStorage.setItem(c.jwt.tokenKey,t.access_token),yield this.$settings.getAppSettings()})}noauth(){return a(this,null,function*(){let e=yield d(this.$api.post("/auth/noauth",{}));if(this.validateToken(e.access_token))window.localStorage.setItem(c.jwt.tokenKey,e.access_token),yield this.$settings.getAppSettings();else throw new Error("Invalid username or password.")})}logout(){this.user=null,this.token=null,window.localStorage.removeItem(c.jwt.tokenKey),window.location.reload()}loadToken(){return a(this,null,function*(){this.$settings.settingsLoaded||(yield d(this.$settings.onSettingsLoaded));let e=window.localStorage.getItem(c.jwt.tokenKey);e&&this.validateToken(e)})}checkToken(){return a(this,null,function*(){try{return yield d(this.$api.get("/auth/check"))}catch(e){e.status===401&&(console.error("Current token is not valid"),this.logout())}})}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(c.jwt.tokenKey),this.token=null,!1}}setLogoutTimer(){if(clearTimeout(this.logoutTimer),!this.$jwtHelper.isTokenExpired(this.token,this.$settings.serverTimeOffset)){let t=(0,k.default)(this.$jwtHelper.getTokenExpirationDate(this.token)).diff((0,k.default)().add(this.$settings.serverTimeOffset,"s"),"millisecond");t<=2147483647&&(this.logoutTimer=setTimeout(()=>a(this,null,function*(){this.$settings.formAuth===!1?(yield this.noauth(),window.location.reload()):this.logout()}),t))}}static \u0275fac=function(t){return new(t||r)};static \u0275prov=h({token:r,factory:r.\u0275fac})}return r})();export{F as a,q as b};
@@ -1 +1 @@
1
- import{a as D}from"./chunk-RMAGF64Q.js";import"./chunk-YSS66NWX.js";import{d as E}from"./chunk-WZ6F47WI.js";import{b as R}from"./chunk-M425JDIT.js";import{k as O,n as B}from"./chunk-6WJPBOPW.js";import{a as k,b as I}from"./chunk-77UFZWOO.js";import"./chunk-KIMRA3K7.js";import{Dc as b,Ec as g,Ib as f,Jb as _,Jc as o,Kc as l,Ob as x,Pb as r,Qb as n,Rb as v,_b as $,ab as i,bc as S,dc as d,id as T,ka as m,mb as w,qa as C,qc as a,ra as y,rc as c,sc as h}from"./chunk-3CKT2OQ7.js";var U=(t,p)=>({"fas fa-fw fa-spinner fa-spin":t,"far fa-fw fa-check-circle":p}),F=t=>({"grey-text":t}),P=(t,p)=>({"far fa-fw fa-circle":t,"fas fa-fw fa-spinner fa-spin":p});function j(t,p){if(t&1&&(r(0,"div",7),a(1),n()),t&2){let e=d();i(),c(e.error)}}function M(t,p){if(t&1&&(r(0,"p",9),a(1),o(2,"translate"),n(),r(3,"div",10)(4,"div",11)(5,"span"),v(6,"i",12),a(7),o(8,"translate"),n()(),r(9,"div",11)(10,"span",12),v(11,"i",12),a(12),o(13,"translate"),n()()()),t&2){let e=d();i(),c(l(2,6,"restart.please_wait_while_server_restarts")),i(5),x("ngClass",g(12,U,!e.uiOnline,e.uiOnline)),i(),h(" ",l(8,8,"restart.ui_online")," "),i(3),x("ngClass",b(15,F,!e.uiOnline)),i(),x("ngClass",g(17,P,!e.uiOnline,e.uiOnline)),i(),h(" ",l(13,10,"restart.service_ready")," ")}}function V(t,p){if(t&1){let e=$();r(0,"p",15)(1,"button",16),S("click",function(){C(e);let u=d(2);return y(u.viewLogs())}),a(2),o(3,"translate"),n()()}t&2&&(i(2),c(l(3,1,"menu.tooltip_view_logs")))}function z(t,p){if(t&1&&(r(0,"div",8)(1,"p"),a(2),o(3,"translate"),n(),r(4,"p",13),a(5),o(6,"translate"),r(7,"span",14),a(8),n()(),f(9,V,4,3,"p",15),n()),t&2){let e=d();i(2),c(l(3,4,"restart.server_is_taking_long_time_to_restart")),i(3),h(" ",l(6,6,"restart.label_restart_command_executed"),": "),i(3),c(e.resp.command||"End Process"),i(),_(e.uiOnline?9:-1)}}var X=(()=>{class t{$api=m(B);$router=m(E);$settings=m(R);$toastr=m(O);$translate=m(k);$ws=m(D);checkTimeout;checkDelay;io;uiOnline=!1;error=!1;resp={};timeout=!1;ngOnInit(){this.io=this.$ws.connectToNamespace("status"),this.io.connected.subscribe(()=>{this.io.socket.emit("monitor-server-status"),this.$settings.getAppSettings().catch(()=>{})}),this.$router.parseUrl(this.$router.url).queryParams.restarting?(this.uiOnline=!0,this.checkIfServerUp()):this.$api.put("/server/restart",{}).subscribe({next:s=>{this.resp=s,this.checkIfServerUp(),s.restartingUI||(this.uiOnline=!0)},error:s=>{console.error(s),this.error=this.$translate.instant("restart.toast_server_restart_error"),this.$toastr.error(this.$translate.instant("restart.toast_server_restart_error"),this.$translate.instant("toast.title_error"))}})}viewLogs(){this.$router.navigate(["/logs"])}ngOnDestroy(){this.io.end(),clearTimeout(this.checkDelay),clearTimeout(this.checkTimeout)}checkIfServerUp(){this.checkDelay=setTimeout(()=>{this.io.socket.on("homebridge-status",e=>{this.uiOnline=!0,(e.status==="up"||e.status==="pending")&&(this.$toastr.success(this.$translate.instant("restart.toast_server_restarted"),this.$translate.instant("toast.title_success")),this.$router.navigate(["/"]))})},7e3),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},4e4)}static \u0275fac=function(s){return new(s||t)};static \u0275cmp=w({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,"fas","fa-fw","fa-power-off",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"],[3,"ngClass"],[1,"grey-text","mb-0"],[1,"font-monospace"],[1,"mt-2","mb-0"],[1,"btn","btn-primary","mb-0",3,"click"]],template:function(s,u){s&1&&(r(0,"div",0)(1,"h3",1),a(2),o(3,"translate"),n()(),r(4,"div",2)(5,"div",3),v(6,"i",4),n(),r(7,"div",5)(8,"h4",6),a(9),o(10,"translate"),n(),f(11,j,2,1,"div",7)(12,M,14,20),f(13,z,10,8,"div",8),n()()),s&2&&(i(2),c(l(3,4,"menu.restart.title")),i(7),c(l(10,6,"restart.title_restart")),i(2),_(u.error?11:12),i(2),_(u.timeout?13:-1))},dependencies:[T,I],styles:[".restart-progress-box[_ngcontent-%COMP%]{font-size:22px;font-weight:300;margin-top:15px}"]})}return t})();export{X as RestartComponent};
1
+ import{a as D}from"./chunk-OKJ3EDLI.js";import"./chunk-X7YL6WTA.js";import{d as E}from"./chunk-UOLP7IQJ.js";import{b as R}from"./chunk-E6YWZCLV.js";import{k as O,n as B}from"./chunk-2CO3VBPY.js";import{a as k,b as I}from"./chunk-G7FA4DP4.js";import"./chunk-6GMXEQVA.js";import{Dc as b,Ec as g,Ib as f,Jb as _,Jc as o,Kc as l,Ob as x,Pb as r,Qb as n,Rb as v,_b as $,ab as i,bc as S,dc as d,id as T,ka as m,mb as w,qa as C,qc as a,ra as y,rc as c,sc as h}from"./chunk-H36QJYLQ.js";var U=(t,p)=>({"fas fa-fw fa-spinner fa-spin":t,"far fa-fw fa-check-circle":p}),F=t=>({"grey-text":t}),P=(t,p)=>({"far fa-fw fa-circle":t,"fas fa-fw fa-spinner fa-spin":p});function j(t,p){if(t&1&&(r(0,"div",7),a(1),n()),t&2){let e=d();i(),c(e.error)}}function M(t,p){if(t&1&&(r(0,"p",9),a(1),o(2,"translate"),n(),r(3,"div",10)(4,"div",11)(5,"span"),v(6,"i",12),a(7),o(8,"translate"),n()(),r(9,"div",11)(10,"span",12),v(11,"i",12),a(12),o(13,"translate"),n()()()),t&2){let e=d();i(),c(l(2,6,"restart.please_wait_while_server_restarts")),i(5),x("ngClass",g(12,U,!e.uiOnline,e.uiOnline)),i(),h(" ",l(8,8,"restart.ui_online")," "),i(3),x("ngClass",b(15,F,!e.uiOnline)),i(),x("ngClass",g(17,P,!e.uiOnline,e.uiOnline)),i(),h(" ",l(13,10,"restart.service_ready")," ")}}function V(t,p){if(t&1){let e=$();r(0,"p",15)(1,"button",16),S("click",function(){C(e);let u=d(2);return y(u.viewLogs())}),a(2),o(3,"translate"),n()()}t&2&&(i(2),c(l(3,1,"menu.tooltip_view_logs")))}function z(t,p){if(t&1&&(r(0,"div",8)(1,"p"),a(2),o(3,"translate"),n(),r(4,"p",13),a(5),o(6,"translate"),r(7,"span",14),a(8),n()(),f(9,V,4,3,"p",15),n()),t&2){let e=d();i(2),c(l(3,4,"restart.server_is_taking_long_time_to_restart")),i(3),h(" ",l(6,6,"restart.label_restart_command_executed"),": "),i(3),c(e.resp.command||"End Process"),i(),_(e.uiOnline?9:-1)}}var X=(()=>{class t{$api=m(B);$router=m(E);$settings=m(R);$toastr=m(O);$translate=m(k);$ws=m(D);checkTimeout;checkDelay;io;uiOnline=!1;error=!1;resp={};timeout=!1;ngOnInit(){this.io=this.$ws.connectToNamespace("status"),this.io.connected.subscribe(()=>{this.io.socket.emit("monitor-server-status"),this.$settings.getAppSettings().catch(()=>{})}),this.$router.parseUrl(this.$router.url).queryParams.restarting?(this.uiOnline=!0,this.checkIfServerUp()):this.$api.put("/server/restart",{}).subscribe({next:s=>{this.resp=s,this.checkIfServerUp(),s.restartingUI||(this.uiOnline=!0)},error:s=>{console.error(s),this.error=this.$translate.instant("restart.toast_server_restart_error"),this.$toastr.error(this.$translate.instant("restart.toast_server_restart_error"),this.$translate.instant("toast.title_error"))}})}viewLogs(){this.$router.navigate(["/logs"])}ngOnDestroy(){this.io.end(),clearTimeout(this.checkDelay),clearTimeout(this.checkTimeout)}checkIfServerUp(){this.checkDelay=setTimeout(()=>{this.io.socket.on("homebridge-status",e=>{this.uiOnline=!0,(e.status==="up"||e.status==="pending")&&(this.$toastr.success(this.$translate.instant("restart.toast_server_restarted"),this.$translate.instant("toast.title_success")),this.$router.navigate(["/"]))})},7e3),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},4e4)}static \u0275fac=function(s){return new(s||t)};static \u0275cmp=w({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,"fas","fa-fw","fa-power-off",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"],[3,"ngClass"],[1,"grey-text","mb-0"],[1,"font-monospace"],[1,"mt-2","mb-0"],[1,"btn","btn-primary","mb-0",3,"click"]],template:function(s,u){s&1&&(r(0,"div",0)(1,"h3",1),a(2),o(3,"translate"),n()(),r(4,"div",2)(5,"div",3),v(6,"i",4),n(),r(7,"div",5)(8,"h4",6),a(9),o(10,"translate"),n(),f(11,j,2,1,"div",7)(12,M,14,20),f(13,z,10,8,"div",8),n()()),s&2&&(i(2),c(l(3,4,"menu.restart.title")),i(7),c(l(10,6,"restart.title_restart")),i(2),_(u.error?11:12),i(2),_(u.timeout?13:-1))},dependencies:[T,I],styles:[".restart-progress-box[_ngcontent-%COMP%]{font-size:22px;font-weight:300;margin-top:15px}"]})}return t})();export{X as RestartComponent};
@@ -1 +1 @@
1
- import{d as u,g as n}from"./chunk-WZ6F47WI.js";import{k as l,n as d}from"./chunk-6WJPBOPW.js";import{a as f}from"./chunk-77UFZWOO.js";import"./chunk-KIMRA3K7.js";import{fa as p,ga as i,h as m,ka as o,nb as s,w as c}from"./chunk-3CKT2OQ7.js";var a=(()=>{class r{$api=o(d);$router=o(u);$toastr=o(l);$translate=o(f);resolve(){return m(this,null,function*(){try{return yield c(this.$api.get("/users"))}catch(t){console.error(t),this.$toastr.error(t.message,this.$translate.instant("toast.title_error")),this.$router.navigate(["/"])}})}static \u0275fac=function(e){return new(e||r)};static \u0275prov=p({token:r,factory:r.\u0275fac})}return r})();var h=[{path:"",loadComponent:()=>import("./chunk-4F3BAQ5O.js").then(r=>r.UsersComponent),resolve:{homebridgeUsers:a}}],v=(()=>{class r{static \u0275fac=function(e){return new(e||r)};static \u0275mod=s({type:r});static \u0275inj=i({imports:[n.forChild(h),n]})}return r})();var T=(()=>{class r{static \u0275fac=function(e){return new(e||r)};static \u0275mod=s({type:r});static \u0275inj=i({providers:[a],imports:[v]})}return r})();export{T as UsersModule};
1
+ import{d as u,g as n}from"./chunk-UOLP7IQJ.js";import{k as l,n as d}from"./chunk-2CO3VBPY.js";import{a as f}from"./chunk-G7FA4DP4.js";import"./chunk-6GMXEQVA.js";import{fa as p,ga as i,h as m,ka as o,nb as s,w as c}from"./chunk-H36QJYLQ.js";var a=(()=>{class r{$api=o(d);$router=o(u);$toastr=o(l);$translate=o(f);resolve(){return m(this,null,function*(){try{return yield c(this.$api.get("/users"))}catch(t){console.error(t),this.$toastr.error(t.message,this.$translate.instant("toast.title_error")),this.$router.navigate(["/"])}})}static \u0275fac=function(e){return new(e||r)};static \u0275prov=p({token:r,factory:r.\u0275fac})}return r})();var h=[{path:"",loadComponent:()=>import("./chunk-5VA2P7IY.js").then(r=>r.UsersComponent),resolve:{homebridgeUsers:a}}],v=(()=>{class r{static \u0275fac=function(e){return new(e||r)};static \u0275mod=s({type:r});static \u0275inj=i({imports:[n.forChild(h),n]})}return r})();var T=(()=>{class r{static \u0275fac=function(e){return new(e||r)};static \u0275mod=s({type:r});static \u0275inj=i({providers:[a],imports:[v]})}return r})();export{T as UsersModule};