homebridge-config-ui-x 5.12.1-alpha.0 → 5.12.1-alpha.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/CHANGELOG.md +2 -1
- package/package.json +8 -3
- package/public/{chunk-FRQW55RH.js → chunk-2AJXG25V.js} +1 -1
- package/public/{chunk-VVQDBX54.js → chunk-2ZAXV4YC.js} +1 -1
- package/public/{chunk-ETPA4W22.js → chunk-3OHVXX6B.js} +1 -1
- package/public/{chunk-2C24YPBT.js → chunk-4BEKQY2O.js} +1 -1
- package/public/{chunk-VT7JPEPM.js → chunk-4BWNO6KH.js} +1 -1
- package/public/{chunk-RFZWSS3U.js → chunk-5DFV4KN6.js} +1 -1
- package/public/{chunk-TDTMHOY3.js → chunk-5E262IZY.js} +1 -1
- package/public/{chunk-657MY7IJ.js → chunk-5IJ7WJ7D.js} +1 -1
- package/public/{chunk-JP4UERHI.js → chunk-AHMTEEWV.js} +2 -2
- package/public/{chunk-WWIBIOK5.js → chunk-AMA5KYHI.js} +1 -1
- package/public/{chunk-H73LUU46.js → chunk-D7BCWWSP.js} +1 -1
- package/public/{chunk-GQUKWTAM.js → chunk-DXT7NLKJ.js} +1 -1
- package/public/{chunk-3H4HIZHS.js → chunk-EMAIV5V4.js} +1 -1
- package/public/{chunk-RCUGTYVU.js → chunk-EMTQLND2.js} +1 -1
- package/public/{chunk-OVMPEMPZ.js → chunk-F3HXP7VF.js} +1 -1
- package/public/{chunk-TFD6FNNU.js → chunk-FOCYUW3Q.js} +1 -1
- package/public/{chunk-CK4L2OZA.js → chunk-FTKEUELX.js} +1 -1
- package/public/{chunk-7H56ZY4K.js → chunk-H2SGUM2A.js} +1 -1
- package/public/{chunk-36DWHVJK.js → chunk-HDGCOO6N.js} +1 -1
- package/public/{chunk-XJ6E3F3B.js → chunk-HWZEDUYR.js} +1 -1
- package/public/{chunk-PBTOROO2.js → chunk-HYK7MYI4.js} +1 -1
- package/public/{chunk-4DP4S4T6.js → chunk-JMLLNMVV.js} +1 -1
- package/public/{chunk-6XTPZD35.js → chunk-JTQUK76J.js} +4 -4
- package/public/{chunk-TP2KLH5Z.js → chunk-KZDX7DML.js} +1 -1
- package/public/{chunk-RQHDC2H4.js → chunk-LP4J3P2M.js} +1 -1
- package/public/{chunk-SKXHAHCO.js → chunk-LY2WH7XJ.js} +1 -1
- package/public/{chunk-4VZUA2FM.js → chunk-LYBXKFGZ.js} +1 -1
- package/public/{chunk-PPDVWLPC.js → chunk-MWO4XHMK.js} +1 -1
- package/public/{chunk-RHMBWG6P.js → chunk-NPF6UAYU.js} +1 -1
- package/public/{chunk-FYKCFXZ2.js → chunk-OD5BLW73.js} +1 -1
- package/public/{chunk-GE6FUSBI.js → chunk-OKKX5II3.js} +1 -1
- package/public/{chunk-YJHSSXBL.js → chunk-P5NUDX6Y.js} +1 -1
- package/public/{chunk-JYPTQF33.js → chunk-PTJ2WHN2.js} +1 -1
- package/public/{chunk-RJJ7UQ5A.js → chunk-PXX46N67.js} +1 -1
- package/public/{chunk-M5PVRCNI.js → chunk-QAMTKHGP.js} +1 -1
- package/public/{chunk-ZM7HZFSJ.js → chunk-QESYIXUR.js} +1 -1
- package/public/{chunk-J7YCDUH4.js → chunk-QHBHZIPJ.js} +1 -1
- package/public/{chunk-3D5CLRTZ.js → chunk-R4D64BTL.js} +1 -1
- package/public/{chunk-XDVMRWJO.js → chunk-REAVFWBE.js} +1 -1
- package/public/{chunk-LLHJXAVZ.js → chunk-SUZMQF44.js} +1 -1
- package/public/chunk-T5FIMD5K.js +1 -0
- package/public/{chunk-NBNIZ4FB.js → chunk-TIVCIPD3.js} +1 -1
- package/public/{chunk-HTAXQLUC.js → chunk-U3VPHA7X.js} +1 -1
- package/public/{chunk-YO6R75NE.js → chunk-U5CDHG4J.js} +1 -1
- package/public/{chunk-VD4V4NEZ.js → chunk-U6OOUZY4.js} +1 -1
- package/public/{chunk-GLSCRXLU.js → chunk-UC6DGFOX.js} +1 -1
- package/public/{chunk-U7J32ZCT.js → chunk-ULHOVOCI.js} +1 -1
- package/public/{chunk-JLMGZNW5.js → chunk-ULIXJ6WW.js} +1 -1
- package/public/chunk-VWDC2WDK.js +1 -0
- package/public/{chunk-TCAIGKCZ.js → chunk-WPMAY5Z5.js} +1 -1
- package/public/{chunk-QDSMJS6K.js → chunk-XOZXUAP4.js} +1 -1
- package/public/{chunk-ARFZQCZK.js → chunk-YDZJF4EY.js} +1 -1
- package/public/{chunk-DEUOHDAT.js → chunk-ZHCPTG5R.js} +1 -1
- package/public/index.html +2 -2
- package/public/{main-Q72DV553.js → main-XJKFV7IC.js} +1 -1
- package/public/{styles-IW6HR5PX.css → styles-FEDC3CMK.css} +1 -1
- package/public/chunk-WAVNYOYF.js +0 -1
- package/public/chunk-YEQ475QM.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{A,C as G,D as Q,c as $,d as C,e as B,f as O,g as T,j as w,m as q,q as z,r as D,y as H}from"./chunk-LZU5VVW4.js";import{b as K}from"./chunk-
|
|
1
|
+
import{A,C as G,D as Q,c as $,d as C,e as B,f as O,g as T,j as w,m as q,q as z,r as D,y as H}from"./chunk-LZU5VVW4.js";import{b as K}from"./chunk-D7BCWWSP.js";import{e as U}from"./chunk-O7FV4MLW.js";import{b as J}from"./chunk-U6OOUZY4.js";import{l as j,p as W}from"./chunk-VWDC2WDK.js";import{Ab as a,Bb as s,Ec as b,Gc as L,Na as x,Nb as E,Pb as M,R as I,Rc as N,Sa as i,Tc as V,Wb as v,Xb as F,ac as g,bc as h,bd as P,cc as R,fb as k,h as y,nc as f,pa as p,sb as u,tb as c,tc as l,uc as d,yb as m,z as S,zb as r}from"./chunk-UUXRTS4O.js";var Y=["password"],Z=["username"],ee=["otp"],te=e=>({background:e}),ie=e=>({anim:e}),X=e=>({"is-invalid":e});function ne(e,_){if(e&1&&(r(0,"div",8)(1,"span",12),s(2,"i",13),a(),s(3,"input",14,0),l(5,"translate"),a(),r(6,"div",8)(7,"span",12),s(8,"i",15),a(),s(9,"input",16,1),l(11,"translate"),a()),e&2){let n=M();i(3),m("placeholder",d(5,4,"users.label_username"))("ngClass",f(8,X,n.form.controls.username.dirty&&n.form.controls.username.errors)),i(6),m("placeholder",d(11,6,"users.label_password"))("ngClass",f(10,X,n.form.controls.password.dirty&&n.form.controls.password.errors))}}function oe(e,_){e&1&&(r(0,"div",8)(1,"span",12),s(2,"i",17),a(),s(3,"input",18,2),l(5,"translate"),a()),e&2&&(i(3),m("placeholder",d(5,1,"login.label_2fa_code")))}function ae(e,_){e&1&&(r(0,"div",9)(1,"div",12),s(2,"i",19),a(),r(3,"div",20)(4,"div",21),g(5),l(6,"translate"),a(),s(7,"div",22),l(8,"translate"),a()()),e&2&&(i(5),h(d(6,2,"login.invalid_credentials")),i(2),m("innerHTML",d(8,4,"login.invalid_credentials_2"),x))}function re(e,_){e&1&&(r(0,"div",9)(1,"div",12),s(2,"i",19),a(),r(3,"div",20)(4,"div",21),g(5),l(6,"translate"),a(),s(7,"div",22),l(8,"translate"),a()()),e&2&&(i(5),h(d(6,2,"login.invalid_code")),i(2),m("innerHTML",d(8,4,"login.invalid_credentials_2"),x))}var _e=(()=>{class e{$auth=p(K);$cdr=p(L);$router=p(U);$settings=p(J);targetRoute;validNonAdminRoutes=["/accessories","/plugins","/logs","/support"];passwordInput=b("password");usernameInput=b("username");otpInput=b("otp");backgroundStyle;invalidCredentials=!1;invalid2faCode=!1;twoFactorCodeRequired=!1;inProgress=!1;form;ngOnInit(){this.form=new T({username:new w(""),password:new w("")}),this.form.valueChanges.pipe(I(500)).subscribe(n=>{let o=this.passwordInput()?.nativeElement.value;o&&o!==n.password&&this.form.controls.password.setValue(o)}),this.targetRoute=window.sessionStorage.getItem("target_route")||"",this.setBackground()}ngAfterViewChecked(){this.$cdr.detectChanges()}onSubmit(){return y(this,null,function*(){this.invalidCredentials=!1,this.invalid2faCode=!1,this.inProgress=!0,document.getElementById("submit-button")?.blur();let n=this.passwordInput()?.nativeElement.value;n&&n!==this.form.get("password").value&&this.form.controls.password.setValue(n);let o=this.usernameInput()?.nativeElement.value;if(o&&o!==this.form.get("username").value&&this.form.controls.username.setValue(o),this.twoFactorCodeRequired){let t=this.otpInput()?.nativeElement.value;t&&t!==this.form.get("otp").value&&this.form.controls.username.setValue(t)}try{yield this.$auth.login(this.form.getRawValue()),!this.$auth.user.admin&&!this.validNonAdminRoutes.includes(this.targetRoute)&&(this.targetRoute="/"),this.$router.navigateByUrl(this.targetRoute),window.sessionStorage.removeItem("target_route")}catch(t){t.status===412?(this.form.controls.otp?(this.form.controls.otp.setErrors(["Invalid Code"]),this.invalid2faCode=!0):this.form.addControl("otp",new w("",[C.required,C.minLength(6),C.maxLength(6)])),this.twoFactorCodeRequired=!0,setTimeout(()=>{document.getElementById("form-ota").focus()},100)):this.invalidCredentials=!0}this.inProgress=!1})}setBackground(){return y(this,null,function*(){if(this.$settings.settingsLoaded||(yield S(this.$settings.onSettingsLoaded)),this.$settings.env.customWallpaperHash){let n=`${W.api.base}/auth/wallpaper/${this.$settings.env.customWallpaperHash}`;this.backgroundStyle=`url('${n}') center/cover`}})}static \u0275fac=function(o){return new(o||e)};static \u0275cmp=k({type:e,selectors:[["ng-component"]],viewQuery:function(o,t){o&1&&(v(t.passwordInput,Y,5),v(t.usernameInput,Z,5),v(t.otpInput,ee,5)),o&2&&F(3)},decls:15,vars:18,consts:[["username",""],["password",""],["otp",""],[1,"login-container","gradient","d-flex","align-items-start","justify-content-center",3,"ngStyle","ngClass"],[1,"w-100","login-card","d-flex","py-4","flex-column"],["ngSrc","assets/homebridge-color-round.svg","alt","Homebridge Logo","height","100","width","100","priority","true",1,"homebridge-logo","mx-auto","my-3"],["novalidate","",3,"ngSubmit","formGroup"],[1,"mb-4","text-center"],[1,"input-group","mb-4"],[1,"input-group","no-border","mb-4"],[1,"text-center"],["tabindex","3","id","submit-button","type","submit",1,"btn","btn-primary","mb-2",3,"disabled"],[1,"input-group-text","custom-input"],[1,"fas","fa-user","primary-text","fa-lg"],["formControlName","username","type","text","id","form-username","autofocus","","autocomplete","username","autocapitalize","none","tabindex","1","required","",1,"form-control","custom-input",3,"placeholder","ngClass"],[1,"fas","fa-lock","primary-text","fa-lg"],["formControlName","password","type","password","id","form-pass","autocomplete","current-password","tabindex","2","required","",1,"form-control","custom-input",3,"placeholder","ngClass"],[1,"fas","fa-key","primary-text","fa-lg"],["formControlName","otp","type","text","id","form-ota","autofocus","","autocomplete","one-time-code","autocapitalize","none","inputmode","numeric","pattern","[0-9]*","tabindex","1",1,"form-control","custom-input",3,"placeholder"],[1,"fas","fa-exclamation-triangle","pink-text","fa-lg"],[1,"form-control","custom-input"],[1,"small","grey-text","fw-semibold"],[1,"small","grey-text",3,"innerHTML"]],template:function(o,t){o&1&&(r(0,"div",3)(1,"div",4),s(2,"img",5),r(3,"form",6),E("ngSubmit",function(){return t.onSubmit()}),r(4,"h4",7),g(5),l(6,"translate"),a(),u(7,ne,12,12),u(8,oe,6,3,"div",8),u(9,ae,9,6,"div",9),u(10,re,9,6,"div",9),r(11,"div",10)(12,"button",11),g(13),l(14,"translate"),a()()()()()),o&2&&(m("ngStyle",f(14,te,t.backgroundStyle))("ngClass",f(16,ie,!t.backgroundStyle)),i(3),m("formGroup",t.form),i(2),h(d(6,10,"setup.welcome_to_homebridge")),i(2),c(t.twoFactorCodeRequired?-1:7),i(),c(t.twoFactorCodeRequired?8:-1),i(),c(t.invalidCredentials?9:-1),i(),c(t.invalid2faCode?10:-1),i(2),m("disabled",t.form.invalid),i(),R(" ",d(14,12,"form.button_continue")," "))},dependencies:[V,G,q,$,B,O,H,A,Q,z,D,N,P,j],styles:["body{overflow:scroll!important} body.dark-mode .login-card{background-color:#2b2b2b;color:#fff}.login-container[_ngcontent-%COMP%]{z-index:-1;padding-top:2em;padding-bottom:2em;min-height:100%;background-size:300% 300%}.anim[_ngcontent-%COMP%]{-webkit-animation:_ngcontent-%COMP%_gradient 20s ease infinite;-moz-animation:gradient 20s ease infinite;-o-animation:gradient 20s ease infinite;animation:_ngcontent-%COMP%_gradient 20s ease infinite}@keyframes _ngcontent-%COMP%_gradient{0%{background-position:0 50%}50%{background-position:100% 50%}to{background-position:0 50%}}.login-card[_ngcontent-%COMP%]{max-width:550px;border-radius:1rem;padding-right:25px;padding-left:25px;background-color:#ffffffe6}.login-card[_ngcontent-%COMP%] .form-control[_ngcontent-%COMP%]:focus{background-color:inherit!important}@media screen and (max-width: 575px){.login-card[_ngcontent-%COMP%]{margin-left:1em;margin-right:1em}}.homebridge-logo[_ngcontent-%COMP%]{margin-bottom:10px}"]})}return e})();export{_e as LoginComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as $}from"./chunk-
|
|
1
|
+
import{b as $}from"./chunk-U6OOUZY4.js";import{p as h,q as S}from"./chunk-VWDC2WDK.js";import{A as k,C as w,F as T,gb as E,gd as j,h as a,ka as d,la as v,na as y,oa as l,pa as p,u as f,z as c,za as I}from"./chunk-UUXRTS4O.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{a as n}from"./chunk-
|
|
1
|
+
import{a as n}from"./chunk-F3HXP7VF.js";import"./chunk-EMTQLND2.js";import"./chunk-D7BCWWSP.js";import{h as r}from"./chunk-O7FV4MLW.js";import"./chunk-U6OOUZY4.js";import"./chunk-VWDC2WDK.js";import{gb as e,la as o}from"./chunk-UUXRTS4O.js";var c=[{path:"",loadComponent:()=>import("./chunk-U5CDHG4J.js").then(t=>t.SettingsComponent),canActivate:[n]}],m=(()=>{class t{static \u0275fac=function(i){return new(i||t)};static \u0275mod=e({type:t});static \u0275inj=o({imports:[r.forChild(c),r]})}return t})();var l=(()=>{class t{static \u0275fac=function(i){return new(i||t)};static \u0275mod=e({type:t});static \u0275inj=o({imports:[m]})}return t})();export{l as SettingsModule};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as T}from"./chunk-
|
|
1
|
+
import{a as T}from"./chunk-4BWNO6KH.js";import"./chunk-D7BCWWSP.js";import{e as $}from"./chunk-O7FV4MLW.js";import{b as S}from"./chunk-U6OOUZY4.js";import{k as g,l as _,n as E,q as y}from"./chunk-VWDC2WDK.js";import{Cb as r,Db as i,Eb as u,Pb as v,Sa as n,ac as a,bc as s,fb as x,pa as o,sb as c,tb as d,tc as m,uc as l}from"./chunk-UUXRTS4O.js";function C(t,f){if(t&1&&(r(0,"div",7),a(1),i()),t&2){let e=v();n(),s(e.error)}}function w(t,f){t&1&&(r(0,"p",9),a(1),m(2,"translate"),i(),r(3,"div",10)(4,"div",11),u(5,"i",12),i()()),t&2&&(n(),s(l(2,1,"restart.please_wait_while_server_restarts")))}function k(t,f){t&1&&(r(0,"div",8),a(1),m(2,"translate"),i()),t&2&&(n(),s(l(2,1,"platform.linux.long_time")))}var z=(()=>{class t{$api=o(y);$router=o($);$settings=o(S);$toastr=o(E);$translate=o(g);$ws=o(T);checkTimeout;checkDelay;io;resp={};timeout=!1;error=!1;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/linux/restart-host",{}).subscribe({next:e=>{this.resp=e,this.checkIfServerUp()},error:e=>{console.error(e),this.error=this.$translate.instant("platform.linux.server_restart_error"),this.$toastr.error(this.$translate.instant("platform.linux.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.linux.server_restarted"),this.$translate.instant("toast.title_success")),this.$router.navigate(["/"]))})},3e4),this.checkTimeout=setTimeout(()=>{this.$toastr.warning(this.$translate.instant("platform.linux.server_taking_long_time"),this.$translate.instant("toast.title_warning"),{timeOut:1e4}),this.timeout=!0},12e4)}static \u0275fac=function(p){return new(p||t)};static \u0275cmp=x({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-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"],[1,"fas","fa-circle-notch","fa-spin"]],template:function(p,h){p&1&&(r(0,"div",0)(1,"h3",1),a(2),m(3,"translate"),i()(),r(4,"div",2)(5,"div",3),u(6,"i",4),i(),r(7,"div",5)(8,"h4",6),a(9),m(10,"translate"),i(),c(11,C,2,1,"div",7)(12,w,6,3),c(13,k,3,3,"div",8),i()()),p&2&&(n(2),s(l(3,4,"menu.restart.title")),n(7),s(l(10,6,"platform.linux.restarting_server")),n(2),d(h.error?11:12),n(2),d(h.timeout?13:-1))},dependencies:[_],styles:[".restart-progress-box[_ngcontent-%COMP%]{font-size:22px;font-weight:300;margin-top:15px}"]})}return t})();export{z as RestartLinuxComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as c}from"./chunk-
|
|
1
|
+
import{b as c}from"./chunk-D7BCWWSP.js";import{p as r}from"./chunk-VWDC2WDK.js";import{h as i,ka as a,pa as o}from"./chunk-UUXRTS4O.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};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as c}from"./chunk-
|
|
1
|
+
import{b as c}from"./chunk-EMTQLND2.js";import{b as f}from"./chunk-D7BCWWSP.js";import{e as u}from"./chunk-O7FV4MLW.js";import{b as h}from"./chunk-U6OOUZY4.js";import{k as o,n}from"./chunk-VWDC2WDK.js";import{h as i,ka as s,pa as t,z as a}from"./chunk-UUXRTS4O.js";var j=(()=>{class e{$auth=t(f);$authHelper=t(c);$router=t(u);$settings=t(h);$translate=t(o);$toastr=t(n);canActivate(m,r){return i(this,null,function*(){return this.$settings.settingsLoaded||(yield a(this.$settings.onSettingsLoaded)),this.$settings.formAuth===!1?(yield this.$auth.noauth(),!0):(yield this.$authHelper.isAuthenticated())?(yield this.$auth.checkAndRefreshIfNeeded(),this.$auth.user?.admin?!0:(this.$toastr.error(this.$translate.instant("toast.no_auth"),this.$translate.instant("toast.title_error")),yield this.$router.navigate(["/"]),!1)):(window.sessionStorage.setItem("target_route",r.url),yield this.$router.navigate(["/login"]),!1)})}static \u0275fac=function(r){return new(r||e)};static \u0275prov=s({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();export{j as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{m as J}from"./chunk-YHD44ZXJ.js";import{C as H,e as O,l as W,s as z,t as q,v as G}from"./chunk-LZU5VVW4.js";import{e as Y}from"./chunk-O7FV4MLW.js";import{k as K,l as Q,n as X,q as Z}from"./chunk-
|
|
1
|
+
import{m as J}from"./chunk-YHD44ZXJ.js";import{C as H,e as O,l as W,s as z,t as q,v as G}from"./chunk-LZU5VVW4.js";import{e as Y}from"./chunk-O7FV4MLW.js";import{k as K,l as Q,n as X,q as Z}from"./chunk-VWDC2WDK.js";import{Ab as a,Bb as b,Kb as B,Nb as h,Pb as d,Rc as j,Sa as s,a as T,ac as c,b as R,bc as g,cc as I,dc as V,fb as D,h as M,hc as F,ic as U,jc as L,oc as N,pa as w,pc as P,rb as A,sb as _,tb as u,tc as m,ua as v,uc as p,va as f,vb as E,wb as k,xb as $,yb as C,z as S,zb as o}from"./chunk-UUXRTS4O.js";var te=(t,l)=>({"btn-danger":t,"btn-elegant":l}),ie=(t,l,e)=>({"fa-trash":t,"fa-undo":l,"fa-circle-notch fa-spin":e});function ne(t,l){t&1&&(o(0,"div",12),b(1,"i",13),a(),o(2,"p",14),c(3),m(4,"translate"),a()),t&2&&(s(3),g(p(4,1,"reset.no_accessories")))}function se(t,l){if(t&1&&(o(0,"option",24),c(1),a()),t&2){let e=l.$implicit;C("value",e._id),s(),V("",e.name," (",e._username,")")}}function oe(t,l){if(t&1){let e=B();o(0,"li",20),c(1),m(2,"translate"),a(),o(3,"li",18)(4,"label",21),c(5),m(6,"translate"),a(),o(7,"div",22)(8,"select",23),L("ngModelChange",function(i){v(e);let r=d(2);return U(r.selectedBridge,i)||(r.selectedBridge=i),f(i)}),h("change",function(i){v(e);let r=d(2);return f(r.onBridgeChange(i.target.value))}),k(9,se,2,3,"option",24,E),a()()()}if(t&2){let e=d(2);s(),g(p(2,3,"form.label.changes_kept")),s(4),g(p(6,5,"reset.accessory_ind.bridge")),s(3),F("ngModel",e.selectedBridge),s(),$(e.pairings)}}function ae(t,l){if(t&1&&(o(0,"li",18)(1,"label",25),c(2),m(3,"translate"),a(),o(4,"div",26),c(5),a()()),t&2){let e=d(2);s(2),g(p(3,2,"reset.accessory_ind.bridge")),s(3),I(" ",e.getCurrentlySelectedBridge()," ")}}function re(t,l){if(t&1){let e=B();o(0,"li",19)(1,"span",27),b(2,"i",28),a(),o(3,"span",29),c(4),b(5,"br"),o(6,"small")(7,"span",30),c(8),a()()(),o(9,"button",31),m(10,"translate"),h("click",function(){let i=v(e).$implicit,r=d(2);return f(r.toggleList(i.UUID,i.$cacheFile))}),b(11,"i",32),a()()}if(t&2){let e=l.$implicit,n=d(2);s(4),I(" ",e.displayName," "),s(4),g(e.UUID),s(),C("disabled",n.clicked)("ngClass",N(8,te,!n.isInList(e.UUID,e.$cacheFile),n.isInList(e.UUID,e.$cacheFile))),A("aria-label",p(10,6,"form.button_delete")),s(2),C("ngClass",P(11,ie,!n.isInList(e.UUID,e.$cacheFile),n.isInList(e.UUID,e.$cacheFile)&&!n.clicked,n.isInList(e.UUID,e.$cacheFile)&&n.clicked))}}function le(t,l){if(t&1&&(o(0,"div",12),b(1,"i",15),a(),o(2,"ul",16)(3,"li"),c(4),m(5,"translate"),a(),o(6,"li"),c(7),m(8,"translate"),a(),o(9,"li"),c(10),m(11,"translate"),a()(),o(12,"ul",17),_(13,oe,11,7),_(14,ae,6,4,"li",18),k(15,re,12,15,"li",19,E),a()),t&2){let e=d();s(4),g(p(5,5,"reset.accessory_ind.list_1")),s(3),g(p(8,7,"reset.accessory_ind.list_2")),s(3),g(p(11,9,"reset.accessory_ind.list_3")),s(3),u(e.pairings.length>1?13:-1),s(),u(e.pairings.length===1?14:-1),s(),$(e.selectedBridgeAccessories)}}function ce(t,l){if(t&1){let e=B();o(0,"button",33),h("click",function(){v(e);let i=d();return f(i.dismissModal())}),c(1),m(2,"translate"),a()}if(t&2){let e=d();C("disabled",e.clicked),s(),I(" ",p(2,2,"form.button_close")," ")}}function de(t,l){if(t&1){let e=B();o(0,"button",34),h("click",function(){v(e);let i=d();return f(i.dismissModal())}),c(1),m(2,"translate"),a()}t&2&&(s(),I(" ",p(2,1,"form.button_close")," "))}function me(t,l){if(t&1&&c(0),t&2){let e=d(3);I(" (",e.toDelete.length,") ")}}function pe(t,l){if(t&1&&(c(0),m(1,"translate"),_(2,me,1,1)),t&2){let e=d(2);I(" ",p(1,2,"form.button_remove")," "),s(2),u(e.toDelete.length>0?2:-1)}}function _e(t,l){t&1&&b(0,"i",36)}function ue(t,l){if(t&1){let e=B();o(0,"button",35),h("click",function(){v(e);let i=d();return f(i.removeAccessories())}),_(1,pe,3,4),_(2,_e,1,0,"i",36),a()}if(t&2){let e=d();C("disabled",!e.toDelete.length||e.clicked),s(),u(e.clicked?-1:1),s(),u(e.clicked?2:-1)}}var Ee=(()=>{class t{$activeModal=w(J);$api=w(Z);$router=w(Y);$toastr=w(X);$translate=w(K);selectedBridge="";pairings=[];clicked=!1;selectedBridgeAccessories=[];accessoriesExist=!1;toDelete=[];ngOnInit(){this.loadCachedAccessories()}onBridgeChange(e){this.selectedBridge=e,this.selectedBridgeAccessories=this.pairings.find(n=>n._id===this.selectedBridge)?.accessories}getCurrentlySelectedBridge(){let e=this.pairings.find(n=>n._id===this.selectedBridge);return`${e.name} - ${e._username}`}toggleList(e,n){this.toDelete.some(i=>i.uuid===e&&i.cacheFile===n)?this.toDelete=this.toDelete.filter(i=>i.uuid!==e||i.cacheFile!==n):this.toDelete.push({cacheFile:n,uuid:e})}isInList(e,n){return this.toDelete.some(i=>i.uuid===e&&i.cacheFile===n)}removeAccessories(){return this.clicked=!0,this.$api.delete("/server/cached-accessories",{body:this.toDelete}).subscribe({next:()=>{this.$toastr.success(this.$translate.instant("reset.accessory_ind.done"),this.$translate.instant("toast.title_success")),this.$activeModal.close(),this.$router.navigate(["/restart"],{queryParams:{restarting:!0}})},error:e=>{this.clicked=!1,console.error(e),this.$toastr.error(this.$translate.instant("reset.accessory_ind.fail"),this.$translate.instant("toast.title_error"))}})}dismissModal(){this.$activeModal.dismiss("Dismiss")}loadCachedAccessories(){return M(this,null,function*(){try{let[e,n]=yield Promise.all([S(this.$api.get("/server/cached-accessories")),S(this.$api.get("/server/pairings"))]),i=new Map(n.map(r=>[r._id,R(T({},r),{accessories:[]})]));e.sort((r,x)=>r.displayName.localeCompare(x.displayName)).forEach(r=>{let x=n.find(ee=>ee._main),y=r.$cacheFile?.split(".")?.[1]||x._id;(!this.selectedBridge||this.selectedBridge===y)&&(i.has(y)||i.set(y,{_id:y,_username:y.match(/.{1,2}/g).join(":"),name:this.$translate.instant("reset.accessory_ind.unknown"),accessories:[]}),i.get(y).accessories.push(r))}),this.pairings=Array.from(i.values()).filter(r=>r.accessories.length>0).sort((r,x)=>r._main&&!x._main?-1:!r._main&&x._main?1:r.name.localeCompare(x.name)),this.selectedBridge=this.selectedBridge||this.pairings[0]?._id,this.selectedBridge&&(this.accessoriesExist=!0,this.selectedBridgeAccessories=this.pairings[0].accessories)}catch(e){console.error(e),this.$toastr.error(this.$translate.instant("reset.error_message"),this.$translate.instant("toast.title_error")),this.$activeModal.close()}})}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=D({type:t,selectors:[["ng-component"]],inputs:{selectedBridge:"selectedBridge"},decls:17,vars:12,consts:[[1,"modal-content"],[1,"modal-header"],[1,"modal-title"],["type","button","data-bs-dismiss","modal",1,"btn-close",3,"click","disabled"],[1,"modal-body"],[1,"modal-footer","justify-content-between"],[1,"text-start"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"disabled"],[1,"text-center"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant"],[1,"text-end"],["type","button","data-bs-dismiss","modal",1,"btn","btn-danger",3,"disabled"],[1,"text-center","mb-3"],[1,"fas","fa-circle-check","primary-text",2,"font-size","75px"],[1,"mb-0","text-center"],[1,"fas","fa-network-wired","primary-text",2,"font-size","75px"],[1,"mb-3"],[1,"list-group","list-group-box","mb-0"],[1,"list-group-item","d-flex","flex-column","flex-md-row","align-items-center"],[1,"list-group-item","d-flex","justify-content-between","align-items-center"],[1,"list-group-item","text-center","grey-text","small"],["for","bridgeSelect",1,"mb-2","mb-md-0","w-100","w-md-50"],[1,"text-start","text-md-end","w-100","w-md-50"],["id","bridgeSelect",1,"custom-select",3,"ngModelChange","change","ngModel"],[3,"value"],[1,"mb-2","mb-md-0","w-100","w-md-50"],[1,"text-start","text-md-end","w-100","w-md-50","grey-text","font-monospace"],[1,"me-3"],[1,"fas","fa-lg","fa-hap"],[1,"flex-grow-1"],[1,"font-monospace","grey-text"],[1,"btn","btn-danger","m-0","ms-3",3,"click","disabled","ngClass"],[1,"fas",3,"ngClass"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"click","disabled"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"click"],["type","button","data-bs-dismiss","modal",1,"btn","btn-danger",3,"click","disabled"],[1,"fas","fa-circle-notch","fa-spin"]],template:function(n,i){n&1&&(o(0,"div",0)(1,"div",1)(2,"h5",2),c(3),m(4,"translate"),a(),o(5,"button",3),m(6,"translate"),h("click",function(){return i.dismissModal()}),a()(),o(7,"div",4),_(8,ne,5,3),_(9,le,17,11),a(),o(10,"div",5)(11,"div",6),_(12,ce,3,4,"button",7),a(),o(13,"div",8),_(14,de,3,3,"button",9),a(),o(15,"div",10),_(16,ue,3,3,"button",11),a()()()),n&2&&(s(3),g(p(4,8,"reset.accessory_ind.title")),s(2),C("disabled",i.clicked),A("aria-label",p(6,10,"form.button_close")),s(3),u(i.accessoriesExist?-1:8),s(),u(i.accessoriesExist?9:-1),s(3),u(i.accessoriesExist?12:-1),s(2),u(i.accessoriesExist?-1:14),s(2),u(i.accessoriesExist?16:-1))},dependencies:[j,H,q,G,z,O,W,Q],encapsulation:2})}return t})();export{Ee as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as n}from"./chunk-O7FV4MLW.js";import{gb as i,ka as a,la as r}from"./chunk-UUXRTS4O.js";var u=(()=>{class t{canDeactivate(e,o,p,m){return e.canDeactivate?e.canDeactivate(m?.url):!0}static \u0275fac=function(o){return new(o||t)};static \u0275prov=a({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();var f=[{path:"",loadComponent:()=>import("./chunk-
|
|
1
|
+
import{h as n}from"./chunk-O7FV4MLW.js";import{gb as i,ka as a,la as r}from"./chunk-UUXRTS4O.js";var u=(()=>{class t{canDeactivate(e,o,p,m){return e.canDeactivate?e.canDeactivate(m?.url):!0}static \u0275fac=function(o){return new(o||t)};static \u0275prov=a({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();var f=[{path:"",loadComponent:()=>import("./chunk-HDGCOO6N.js").then(t=>t.LogsComponent),canDeactivate:[u]}],s=(()=>{class t{static \u0275fac=function(o){return new(o||t)};static \u0275mod=i({type:t});static \u0275inj=r({imports:[n.forChild(f),n]})}return t})();var v=(()=>{class t{static \u0275fac=function(o){return new(o||t)};static \u0275mod=i({type:t});static \u0275inj=r({imports:[s]})}return t})();export{v as LogsModule};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{M as ne,P as oe,a as pe,b as E,c as te,d as C,e as M,f as ie,g as W,h as j,i as q,j as N}from"./chunk-
|
|
1
|
+
import{M as ne,P as oe,a as pe,b as E,c as te,d as C,e as M,f as ie,g as W,h as j,i as q,j as N}from"./chunk-JTQUK76J.js";import{b as R}from"./chunk-PCFKF3RR.js";import{$b as _,Ab as h,Bb as g,Dc as k,Ea as O,Fc as ee,Gc as A,Kb as X,Na as I,Nb as Y,Pb as c,Sa as a,Zc as D,_b as F,a as $,ac as x,b as V,bc as Z,fb as L,g as ce,gb as w,ka as T,la as v,na as G,oa as K,pa as f,q as J,rb as z,sb as p,tb as u,ua as Q,va as U,yb as y,zb as d}from"./chunk-UUXRTS4O.js";var m=ce(pe(),1);function ue(i,n){if(i&1){let s=X();d(0,"button",5),Y("click",function(){Q(s);let o=c();return U(o.removeItem())}),d(1,"span",6),x(2,"\xD7"),h(),d(3,"span"),x(4,"Close"),h()()}if(i&2){let s=c();_(s.widgetStyles().__remove_item__),a(3),_(s.widgetStyles().__screen_reader__)}}function he(i,n){if(i&1&&g(0,"p",7),i&2){let s=c(2);_(s.widgetStyles().__help_block__),y("innerHTML",s.options==null?null:s.options.helpBlock,I)}}function me(i,n){if(i&1&&(d(0,"div"),p(1,he,1,3,"p",2),h()),i&2){let s=c();a(),u(s.options!=null&&s.options.helpBlock?1:-1)}}function fe(i,n){if(i&1&&g(0,"label",7),i&2){let s,t=c();_((t.options==null?null:t.options.labelHtmlClass)||""),F("sr-only",t.options==null?null:t.options.notitle),y("innerHTML",t.dynamicTitle,I),z("for","control"+((s=t.layoutNode())==null?null:s._id))}}function ge(i,n){if(i&1&&(d(0,"p")(1,"strong"),x(2,"*"),h(),x(3," = required fields "),h()),i&2){let s=c();a(),_(s.widgetStyles().__required_asterisk__)}}function _e(i,n){if(i&1&&g(0,"span",7),i&2){let s=c();_(s.widgetStyles().__field_addon_left__),y("innerHTML",s.options==null?null:s.options.fieldAddonLeft,I)}}function be(i,n){if(i&1&&g(0,"span",7),i&2){let s=c();_(s.widgetStyles().__field_addon_right__),y("innerHTML",s.options==null?null:s.options.fieldAddonRight,I)}}function ye(i,n){if(i&1&&g(0,"span",8),i&2){let s=c();F("glyphicon-ok",(s.options==null?null:s.options.enableSuccessState)&&!(s.formControl!=null&&s.formControl.errors))("glyphicon-remove",(s.options==null?null:s.options.enableErrorState)&&(s.formControl==null?null:s.formControl.errors))}}function Ce(i,n){if(i&1&&g(0,"p",7),i&2){let s=c(2);_(s.widgetStyles().__help_block__),y("innerHTML",s.options==null?null:s.options.helpBlock,I)}}function ve(i,n){if(i&1&&(d(0,"div"),p(1,Ce,1,3,"p",2),h()),i&2){let s=c();a(),u(s.options!=null&&s.options.helpBlock?1:-1)}}function we(i,n){if(i&1&&(d(0,"div"),x(1,"debug: "),d(2,"pre"),x(3),h()()),i&2){let s=c();a(3),Z(s.debugOutput)}}var H=(()=>{let n=class n{constructor(){this.frameworkThemeSubject=new J("default"),this.frameworkTheme$=this.frameworkThemeSubject.asObservable()}requestThemeChange(t){this.frameworkThemeSubject.next(t),this.activeRequestedTheme=t}getActiveRequestedTheme(){return this.activeRequestedTheme}};n.\u0275fac=function(o){return new(o||n)},n.\u0275prov=T({token:n,factory:n.\u0275fac,providedIn:"root"});let i=n;return i})(),P=(()=>{let n=class n{applyCssClasses(t,o,e){let r=this.widgetStyles()[t];(!r||m.default.isEmpty(r))&&(r=this.widgetStyles().default),Object.keys(r).forEach(l=>{let b=r[l];b.length&&(o[l]=C(o[l],b)),e&&(o[l]=C(o[l],e))})}flattenWidgetStyles(t){var o={};let e=["__themes__"];return Object.keys(t).forEach(r=>{let l=t[r];if(e.indexOf(r)>=0){o[r]=l;return}m.default.isArray(l)&&(o[r]=l.join(" ")),m.default.isObject(l)&&(o[r]=o[r]||{},Object.keys(l).forEach(b=>{let S=l[b];m.default.isArray(S)?o[r][b]=S.join(" "):o[r][b]=S})),m.default.isString(l)&&(o[r]=l)}),o}constructor(){this.cdr=f(A),this.jsf=f(M),this.jsfFLService=f(j),this.cssFWService=f(H),this.frameworkInitialized=!1,this.formControl=null,this.debugOutput="",this.debug="",this.parentArray=null,this.isOrderable=!1,this.dynamicTitle=null,this.layoutNode=k(void 0),this.layoutIndex=k(void 0),this.dataIndex=k(void 0),this.widgetStyles=ee(void 0),this.defaultStyling={array:{},default:{fieldHtmlClass:"cssfw-form-control"},__themes__:[{name:"notheme",text:"None"}],__remove_item__:"cssfw-remove-item",__array_item_nonref__:{htmlClass:"cssfw-array-item-nonref"},__active__:{activeClass:"cssfw-active"},__array__:{htmlClass:"cssfw-array"},__control_label__:{labelHtmlClass:"cssfw-control-label"},__form_group__:{htmlClass:"cssfw-form-group"},__field_addon_left__:"cssfw-addon-left",__field_addon_right__:"cssfw-addon-right",__help_block__:"cssfw-help-block",__required_asterisk__:"cssfw-required-astersisk",__screen_reader__:"cssfw-screen-reader"};let t=this.cssFWService,e=this.jsfFLService.activeFramework.config||{};this.widgetStyles.set(Object.assign(this.defaultStyling,e.widgetstyles));let r=this.widgetStyles().__themes__[0],l=t.activeRequestedTheme||r.name;this.theme=this.options?.theme||l}ngOnDestroy(){this.frameworkThemeSubs?.unsubscribe(),this.frameworkThemeSubs=null}get showRemoveButton(){let t=this.layoutNode();return!this.options.removable||this.options.readonly||t.type==="$ref"?!1:t.recursiveReference?!0:!t.arrayItem||!this.parentArray||this.parentArray.items.length-1<=this.parentArray.options.minItems?!1:t.arrayItemType==="list"?!0:this.layoutIndex()[this.layoutIndex().length-1]===this.parentArray.items.length-2}ngOnInit(){let t=this.cssFWService;this.frameworkThemeSubs=t.frameworkTheme$.subscribe(e=>{this.theme=e,this.cdr.detectChanges()}),this.initializeFramework();let o=this.layoutNode();o.arrayItem&&o.type!=="$ref"&&(this.parentArray=this.jsf.getParentNode(this),this.parentArray&&(this.isOrderable=o.arrayItemType==="list"&&!this.options.readonly&&this.parentArray.options.orderable))}ngOnChanges(t){this.frameworkInitialized||this.initializeFramework(),this.isDynamicTitle&&this.updateTitle()}initializeFramework(){let t=this.layoutNode();if(t){if(this.options=(0,m.cloneDeep)(t.options),this.widgetLayoutNode=V($({},t),{options:(0,m.cloneDeep)(t.options)}),this.widgetOptions=this.widgetLayoutNode.options,this.formControl=this.jsf.getFormControl(this),this.options.isInputWidget=te(t.type,["button","checkbox","checkboxes-inline","checkboxes","color","date","datetime-local","datetime","email","file","hidden","image","integer","month","number","password","radio","radiobuttons","radios-inline","radios","range","reset","search","select","submit","tel","text","textarea","time","url","week"]),this.isDynamicTitle=this.options?.title&&/{{.+?}}/.test(this.options.title),this.dynamicTitle=this.options?.title,!["$ref","advancedfieldset","authfieldset","button","card","checkbox","expansion-panel","help","message","msg","section","submit","tabarray","tabs"].includes(t.type)&&/{{.+?}}/.test(this.widgetOptions.title||"")&&this.updateTitle(),this.options.title=this.setTitle(),this.widgetOptions.title&&(this.dynamicTitle=""),this.options.htmlClass=C(this.options.htmlClass,"schema-form-"+t.type),t.type==="array"?this.options.htmlClass=C(this.options.htmlClass,this.widgetStyles().__array__.htmlClass):t.arrayItem&&t.type!=="$ref"?this.options.htmlClass=C(this.options.htmlClass,this.widgetStyles().__array_item_nonref__.htmlClass):this.options.htmlClass=C(this.options.htmlClass,this.widgetStyles().__form_group__.htmlClass),this.widgetOptions.htmlClass="",this.options.labelHtmlClass=C(this.options.labelHtmlClass,this.widgetStyles().__control_label__.labelHtmlClass),this.widgetOptions.activeClass=C(this.widgetOptions.activeClass,this.widgetStyles().__active__.activeClass),this.options.fieldAddonLeft=this.options.fieldAddonLeft||this.options.prepend,this.options.fieldAddonRight=this.options.fieldAddonRight||this.options.append,this.options.title&&t.type!=="tab"&&!this.options.notitle&&this.options.required&&!this.options.title.includes("*")){let o=this.widgetStyles().__required_asterisk__||"text-danger";this.options.title+=`<strong class="${o}">◦</strong>`}if(t.type=="optionfieldset"&&(this.options.messageLocation="top"),this.applyCssClasses(t.type,this.widgetOptions,this.options.style),this.formControl&&(this.updateHelpBlock(this.formControl.status),this.formControl.statusChanges.subscribe(o=>this.updateHelpBlock(o)),this.options.debug)){let o=[];this.debugOutput=(0,m.map)(o,e=>JSON.stringify(e,null,2)).join(`
|
|
2
2
|
`)}this.updateTitle(),this.frameworkInitialized=!0}}updateHelpBlock(t){this.options.helpBlock=t==="INVALID"&&this.options.enableErrorState&&this.formControl.errors&&(this.formControl.dirty||this.options.feedbackOnRender)?this.jsf.formatErrors(this.formControl.errors,this.options.validationMessages):this.options.description||this.options.help||null}setTitle(){switch(this.layoutNode().type){case"button":case"checkbox":case"section":case"help":case"msg":case"submit":case"message":case"tabarray":case"tabs":case"$ref":return null;case"advancedfieldset":return this.widgetOptions.expandable=!0,this.widgetOptions.title="Advanced options",null;case"authfieldset":return this.widgetOptions.expandable=!0,this.widgetOptions.title="Authentication settings",null;case"fieldset":return this.widgetOptions.title=this.options.title,null;case"array":return this.widgetOptions.title=this.options.title,null;default:return this.widgetOptions.title=null,this.jsf.setItemTitle(this)}}updateTitle(){this.dynamicTitle=this.jsf.parseText(this.options?.title,this.jsf.getFormControlValue(this),this.jsf.getFormControlGroup(this)?.value,this.dataIndex()[this.dataIndex().length-1])}removeItem(){this.jsf.removeItem(this)}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=L({type:n,selectors:[["css-framework"]],inputs:{layoutNode:[1,"layoutNode"],layoutIndex:[1,"layoutIndex"],dataIndex:[1,"dataIndex"],widgetStyles:[1,"widgetStyles"]},outputs:{widgetStyles:"widgetStylesChange"},standalone:!1,features:[O],decls:12,vars:24,consts:[["type","button",3,"class"],[3,"class","sr-only","innerHTML"],[3,"class","innerHTML"],[3,"layoutNode","dataIndex","layoutIndex"],["aria-hidden","true",1,"form-control-feedback","glyphicon",3,"glyphicon-ok","glyphicon-remove"],["type","button",3,"click"],["aria-hidden","true"],[3,"innerHTML"],["aria-hidden","true",1,"form-control-feedback","glyphicon"]],template:function(o,e){if(o&1&&(d(0,"div"),p(1,ue,5,4,"button",0),p(2,me,2,1,"div"),p(3,fe,1,6,"label",1),p(4,ge,4,2,"p"),d(5,"div"),p(6,_e,1,3,"span",2),g(7,"select-widget-widget",3),p(8,be,1,3,"span",2),h(),p(9,ye,1,4,"span",4),p(10,ve,2,1,"div"),h(),p(11,we,4,1,"div")),o&2){let r,l,b,S;_((e.options==null?null:e.options.htmlClass)||""),F("has-feedback",(e.options==null?null:e.options.feedback)&&(e.options==null?null:e.options.isInputWidget)&&((e.formControl==null?null:e.formControl.dirty)||(e.options==null?null:e.options.feedbackOnRender)))("has-error",(e.options==null?null:e.options.enableErrorState)&&(e.formControl==null?null:e.formControl.errors)&&((e.formControl==null?null:e.formControl.dirty)||(e.options==null?null:e.options.feedbackOnRender)))("has-success",(e.options==null?null:e.options.enableSuccessState)&&!(e.formControl!=null&&e.formControl.errors)&&((e.formControl==null?null:e.formControl.dirty)||(e.options==null?null:e.options.feedbackOnRender))),z("data-bs-theme",e.theme)("data-theme",e.theme),a(),u(e.showRemoveButton?1:-1),a(),u((e.options==null?null:e.options.messageLocation)==="top"&&((r=e.layoutNode())==null?null:r.type)!=="array"?2:-1),a(),u(e.options!=null&&e.options.title&&((l=e.layoutNode())==null?null:l.type)!=="tab"&&((l=e.layoutNode())==null?null:l.type)!=="array"?3:-1),a(),u(((b=e.layoutNode())==null?null:b.type)==="submit"&&(!(e.jsf==null||e.jsf.formOptions==null)&&e.jsf.formOptions.fieldsRequired)?4:-1),a(),F("input-group",(e.options==null?null:e.options.fieldAddonLeft)||(e.options==null?null:e.options.fieldAddonRight)),a(),u(e.options!=null&&e.options.fieldAddonLeft?6:-1),a(),y("layoutNode",e.widgetLayoutNode)("dataIndex",e.dataIndex())("layoutIndex",e.layoutIndex()),a(),u(e.options!=null&&e.options.fieldAddonRight?8:-1),a(),u(e.options!=null&&e.options.feedback&&(e.options!=null&&e.options.isInputWidget)&&!(e.options!=null&&e.options.fieldAddonRight)&&!e.layoutNode().arrayItem&&(e.formControl!=null&&e.formControl.dirty||e.options!=null&&e.options.feedbackOnRender)?9:-1),a(),u((e.options==null?null:e.options.messageLocation)!=="top"&&((S=e.layoutNode())==null?null:S.type)!=="array"?10:-1),a(),u(e.debug&&e.debugOutput?11:-1)}},dependencies:[ie],styles:[`:host ::ng-deep .list-group-item .form-control-feedback{top:40px}:host ::ng-deep .checkbox,:host ::ng-deep .radio{margin-top:0;margin-bottom:0}:host ::ng-deep .checkbox-inline,:host ::ng-deep .checkbox-inline+.checkbox-inline,:host ::ng-deep .checkbox-inline+.radio-inline,:host ::ng-deep .radio-inline,:host ::ng-deep .radio-inline+.radio-inline,:host ::ng-deep .radio-inline+.checkbox-inline{margin-left:0;margin-right:10px}:host ::ng-deep .checkbox-inline:last-child,:host ::ng-deep .radio-inline:last-child{margin-right:0}:host ::ng-deep .ng-invalid.ng-touched{border:1px solid #f44336}.checkbox-inline,.checkbox-inline+.checkbox-inline,.checkbox-inline+.radio-inline,.radio-inline,.radio-inline+.radio-inline,.radio-inline+.checkbox-inline{margin-left:0;margin-right:10px}.checkbox-inline:last-child,.radio-inline:last-child{margin-right:0}.ng-invalid.ng-touched{border:1px solid #f44336}
|
|
3
3
|
`],encapsulation:2});let i=n;return i})(),ke=new G("CSS_FRAMEWORK_CFG"),se;(function(i){class n{}i.csscategories=n})(se||(se={}));var le=(()=>{let n=class n{};n.\u0275fac=function(o){return new(o||n)},n.\u0275mod=w({type:n}),n.\u0275inj=v({providers:[M,j,W,H],imports:[N,D,q]});let i=n;return i})(),re=(()=>{let n=class n extends E{constructor(t){super(),this.cssFWService=f(H),this.name="css",this.framework=P,this.name=t.name,this.text=t.text||this.name,this.stylesheets=t.stylesheets,this.scripts=t.scripts,this.config=t,this.widgets=t.widgets}getActiveTheme(){let t=this.cssFWService.getActiveRequestedTheme(),o=this.config?.widgetstyles?.__themes__,e=o&&o[0];if(t&&(e={name:t,text:t},o)){let r=o.filter(l=>l.name==t);e=r&&r[0]||e}return e}requestThemeChange(t){this.cssFWService.requestThemeChange(t)}registerTheme(t,o=!0){let r=(this.config?.widgetstyles?.__themes__||[]).filter(l=>t.name==l.name);if(r&&r[0]){if(o)return r[0].text=t.text,!0;if(!o)return!1}if(!r||r.length==0){let l=this.config;return l.widgetstyles=this.config.widgetstyles||{},l.widgetstyles.__themes__=l.widgetstyles.__themes__||[],l.widgetstyles.__themes__.push(t),!0}}unregisterTheme(t){let o=this.config?.widgetstyles?.__themes__,e=-1;return o&&(o.forEach((r,l)=>{t==r.name&&(e=l)}),e>=0)?(o.splice(e,1),!0):!1}getConfig(){return this.config}};n.\u0275fac=function(o){return new(o||n)(K(ke))},n.\u0275prov=T({token:n,factory:n.\u0275fac});let i=n;return i})();var Se=(()=>{let n=class n{constructor(){this.changeDetector=f(A),this.jsf=f(M),this.frameworkInitialized=!1,this.formControl=null,this.debugOutput="",this.debug="",this.parentArray=null,this.isOrderable=!1,this.layoutNode=k(void 0),this.layoutIndex=k(void 0),this.dataIndex=k(void 0)}ngOnInit(){}ngOnChanges(){}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=L({type:n,selectors:[["bootstrap-5-framework"]],inputs:{layoutNode:[1,"layoutNode"],layoutIndex:[1,"layoutIndex"],dataIndex:[1,"dataIndex"]},standalone:!1,features:[O],decls:2,vars:3,consts:[[3,"layoutNode","layoutIndex","dataIndex"]],template:function(o,e){o&1&&(d(0,"div"),g(1,"css-framework",0),h()),o&2&&(a(),y("layoutNode",e.layoutNode())("layoutIndex",e.layoutIndex())("dataIndex",e.dataIndex()))},dependencies:[P],styles:[`:host ::ng-deep .list-group-item .list-group-item-hb .form-control-feedback{top:40px}:host ::ng-deep .checkbox,:host ::ng-deep .radio{margin-top:0;margin-bottom:0}:host ::ng-deep .checkbox-inline,:host ::ng-deep .checkbox-inline+.checkbox-inline,:host ::ng-deep .checkbox-inline+.radio-inline,:host ::ng-deep .radio-inline,:host ::ng-deep .radio-inline+.radio-inline,:host ::ng-deep .radio-inline+.checkbox-inline{margin-left:0;margin-right:10px}:host ::ng-deep .checkbox-inline:last-child,:host ::ng-deep .radio-inline:last-child{margin-right:0}:host ::ng-deep .ng-invalid.ng-touched{border:1px solid #f44336}.input-group .form-control:first-child,.input-group-text:first-child,.input-group-btn:first-child>.btn,.input-group-btn:first-child>.btn-group>.btn,.input-group-btn:first-child>.dropdown-toggle,.input-group-btn:last-child>.btn:not(:last-child):not(.dropdown-toggle),.input-group-btn:last-child>.btn-group:not(:last-child)>.btn{border-top-right-radius:0;border-bottom-right-radius:0}.input-group-text:first-child{border-right:0}.input-group .form-control:last-child,.input-group-text:last-child,.input-group-btn:last-child>.btn,.input-group-btn:last-child>.btn-group>.btn,.input-group-btn:last-child>.dropdown-toggle,.input-group-btn:first-child>.btn:not(:first-child),.input-group-btn:first-child>.btn-group:not(:first-child)>.btn{border-top-left-radius:0;border-bottom-left-radius:0}.input-group-text:last-child{border-left:0}.input-group .form-control:not(:first-child):not(:last-child),.input-group-text:not(:first-child):not(:last-child),.input-group-btn:not(:first-child):not(:last-child){border-radius:0}.btn-close>span:first-child{display:none}
|
|
4
4
|
`],encapsulation:2});let i=n;return i})(),Ie={name:"bootstrap-5",text:"Bootstrap 5",scripts:["//cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"],stylesheets:["//cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css"],widgetstyles:{__themes__:[{name:"bootstrap5_default",text:"Bootstrap5 default"},{name:"dark",text:"Dark"},{name:"light",text:"Light"}],$ref:{fieldHtmlClass:"btn btn-primary"},__array_item_nonref__:{htmlClass:"list-group-item list-group-item-hb"},__form_group__:{htmlClass:"form-group"},__control_label__:{labelHtmlClass:"control-label"},__active__:{activeClass:"active"},__required_asterisk__:"text-danger",__screen_reader__:"visually-hidden",__remove_item__:"btn-close float-end",__help_block__:"help-block grey-text small",__field_addon_left__:"input-group-text",__field_addon_right__:"input-group-text","alt-date":{},"alt-datetime":{},__array__:{htmlClass:"list-group list-group-hb"},array:{},authfieldset:{},advancedfieldset:{},button:{fieldHtmlClass:"btn btn-sm btn-primary"},checkbox:{fieldHtmlClass:"form-check-input"},checkboxes:{fieldHtmlClass:"form-check-input"},checkboxbuttons:{fieldHtmlClass:"visually-hidden",htmlClass:"btn-group",itemLabelHtmlClass:"btn"},"checkboxes-inline":{htmlClass:"form-check-input",itemLabelHtmlClass:"form-check-inline"},date:{},"datetime-local":{},fieldset:{},integer:{},number:{},optionfieldset:{},password:{},radiobuttons:{fieldHtmlClass:"visually-hidden",htmlClass:"btn-group",itemLabelHtmlClass:"btn"},radio:{fieldHtmlClass:"form-check-input"},radios:{fieldHtmlClass:"form-check-input"},"radios-inline":{htmlClass:"form-check form-check-inline",itemLabelHtmlClass:"form-check-label"},range:{},section:{},selectfieldset:{},select:{fieldHtmlClass:"form-select"},submit:{fieldHtmlClass:"btn btn-primary"},text:{},tabs:{labelHtmlClass:"nav nav-tabs",htmlClass:"tab-content",fieldHtmlClass:"tab-pane",widget_radioClass:"form-check-input"},tabarray:{labelHtmlClass:"nav nav-tabs",htmlClass:"tab-content",fieldHtmlClass:"tab-pane",widget_radioClass:"form-check-input"},"one-of":{labelHtmlClass:"nav nav-tabs",htmlClass:"tab-content",fieldHtmlClass:"tab-pane",widget_radioClass:"form-check-input"},textarea:{},default:{fieldHtmlClass:"form-control"}}},Me=(()=>{let n=class n extends re{constructor(){let t=f(H);super(Ie),this.framework=Se,this.cssFWService=t}};n.\u0275fac=function(o){return new(o||n)},n.\u0275prov=T({token:n,factory:n.\u0275fac});let i=n;return i})(),ae=(()=>{let n=class n{};n.\u0275fac=function(o){return new(o||n)},n.\u0275mod=w({type:n}),n.\u0275inj=v({providers:[M,j,W,{provide:E,useClass:Me,multi:!0}],imports:[N,D,q,le,N]});let i=n;return i})();var de=(()=>{class i{static \u0275fac=function(t){return new(t||i)};static \u0275mod=w({type:i});static \u0275inj=v({providers:[ne],imports:[ae,R]})}return i})();var tt=(()=>{class i{static \u0275fac=function(t){return new(t||i)};static \u0275mod=w({type:i});static \u0275inj=v({providers:[oe],imports:[R,de]})}return i})();export{tt as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as et}from"./chunk-J7YCDUH4.js";import"./chunk-VCZ6KBM7.js";import{a as rt}from"./chunk-MGZVKFCX.js";import{a as L}from"./chunk-SKXHAHCO.js";import{n as W,t as J}from"./chunk-YHD44ZXJ.js";import{D as R,c as D,e as N,f as z,g as A,j,m as G,q as Q,r as H}from"./chunk-LZU5VVW4.js";import"./chunk-VT7JPEPM.js";import{b as tt}from"./chunk-H73LUU46.js";import{b as U}from"./chunk-VD4V4NEZ.js";import{k as K,l as X,n as Y,q as Z}from"./chunk-WAVNYOYF.js";import{$b as V,Ab as l,Bb as p,Ca as x,Ec as T,Kb as v,Nb as u,Pb as d,R as M,Ra as k,Sa as n,V as P,Wb as y,Xb as q,_b as S,ac as $,bc as B,fb as O,g as nt,h as E,kc as F,p as I,pa as m,rb as b,sb as _,tb as w,tc as a,ua as h,uc as s,va as g,yb as f,zb as c}from"./chunk-UUXRTS4O.js";var ot=nt(rt(),1);var at=["logoutput"],st=["searchInput"];function lt(i,C){if(i&1){let t=v();c(0,"div",5)(1,"button",9),a(2,"translate"),a(3,"translate"),u("click",function(){h(t);let o=d();return g(o.showSearch())}),p(4,"i"),l(),c(5,"button",9),a(6,"translate"),a(7,"translate"),u("click",function(){h(t);let o=d();return g(o.downloadLogFile())}),p(8,"i",10),l(),c(9,"button",11),a(10,"translate"),a(11,"translate"),u("click",function(){h(t);let o=d();return g(o.truncateLogFile())}),p(12,"i",12),l()()}if(i&2){let t=d();n(),f("openDelay",150)("ngbTooltip",s(2,12,"form.search")),b("aria-label",s(3,14,"form.search")),n(3),V(F("fas",t.showSearchBar()?" primary-text":""," fa-search")),n(),f("openDelay",150)("ngbTooltip",s(6,16,"form.button_download")),b("aria-label",s(7,18,"form.button_download")),n(4),f("openDelay",150)("ngbTooltip",s(10,20,"form.button_delete")),b("aria-label",s(11,22,"form.button_delete"))}}function ct(i,C){if(i&1){let t=v();c(0,"button",18),a(1,"translate"),u("click",function(){h(t);let o=d(2);return g(o.onClearSearch())}),p(2,"i",19),l()}i&2&&b("aria-label",s(1,1,"form.button_clear"))}function mt(i,C){i&1&&(c(0,"span",17),$(1),a(2,"translate"),l()),i&2&&(n(),B(s(2,1,"common.labels.beta")))}function dt(i,C){if(i&1){let t=v();c(0,"div",6)(1,"div",13)(2,"form",14),u("ngSubmit",function(){h(t);let o=d();return g(o.onSubmit(o.form.value))}),p(3,"input",15,1),a(5,"translate"),_(6,ct,3,3,"button",16)(7,mt,3,3,"span",17),l()()()}if(i&2){let t,e=d();n(2),f("formGroup",e.form),n(),S("is-invalid",e.searchInputInvalid),f("placeholder",s(5,5,"logs.placeholder_search_logs")),n(3),w((t=e.form.get("query"))!=null&&t.value?6:7)}}var Lt=(()=>{class i{$api=m(Z);$auth=m(tt);$log=m(et);$modal=m(W);$settings=m(U);$toastr=m(Y);$translate=m(K);termTarget=T("logoutput");searchInput=T("searchInput");resizeEvent=new I;valueChangesSubscription;isAdmin=this.$auth.user.admin;showSearchBar=x(!1);showExitButton=x(!1);form=new A({query:new j("")});get searchInputInvalid(){let t=(this.form.get("query")?.value||"").trim();return t.length>0&&t.length<3}onWindowResize(){this.resizeEvent.next(void 0)}ngOnInit(){let t=this.$translate.instant("menu.linux.label_logs");if(this.$settings.setPageTitle(t),window.document.querySelector("body").classList.add("bg-black"),this.$settings.actualLightingMode==="light"){window.document.querySelector("body").classList.add("light-mode");let e=this.termTarget()?.nativeElement;e&&e.classList.add("light-mode")}this.$log.startTerminal(this.termTarget(),{allowProposedApi:!0},this.resizeEvent),this.valueChangesSubscription=this.form.get("query")?.valueChanges.pipe(M(500),P()).subscribe(e=>{let o=e||"",r=o.trim();r!==o&&this.form.get("query")?.setValue(r,{emitEvent:!1}),r.length>=3?(this.showExitButton.set(!0),this.$log.setSearchFilter(r),this.$log.scrollToBottom()):r.length<3&&this.showExitButton()&&(this.showExitButton.set(!1),this.$log.clearSearchFilter(),this.$log.scrollToBottom())})}showSearch(){if(this.showSearchBar())this.showSearchBar.set(!1),this.showExitButton.set(!1),this.form.setValue({query:""}),this.$log.clearSearchFilter();else{this.showSearchBar.set(!0);let t=this.searchInput();t&&setTimeout(()=>t.nativeElement.focus(),10)}setTimeout(()=>this.resizeEvent.next(void 0),10),this.$log.scrollToBottom()}onSubmit(t){let e=(t.query||"").trim();!e.length||e.length<3?(e.length||this.showSearchBar.set(!1),this.form.setValue({query:""}),this.showExitButton.set(!1),this.$log.clearSearchFilter()):(this.showExitButton.set(!0),this.$log.setSearchFilter(e)),this.$log.scrollToBottom()}onClearSearch(){this.form.setValue({query:""}),this.showExitButton.set(!1),this.$log.clearSearchFilter(),this.$log.scrollToBottom()}canDeactivate(t){return this.$settings.actualLightingMode!=="light"?(window.document.querySelector("body").classList.remove("bg-black"),Promise.resolve(!0)):(this.showSearchBar()&&this.showSearchBar.set(!1),window.document.querySelector("body").classList.remove("light-mode"),new Promise(e=>{let o=t&&(t.includes("/platform-tools/terminal")||t.includes("/logs")),r=this.termTarget()?.nativeElement;r&&r.classList.add("fade-out"),o?setTimeout(()=>{e(!0)},250):(setTimeout(()=>{window.document.querySelector("body").classList.remove("bg-black")},250),setTimeout(()=>{e(!0)},500))}))}ngOnDestroy(){window.document.querySelector("body").classList.remove("light-mode"),this.valueChangesSubscription&&this.valueChangesSubscription.unsubscribe(),this.resizeEvent.complete(),this.$log.destroyTerminal()}downloadLogFile(){let t=this.$modal.open(L,{size:"lg",backdrop:"static"});t.componentInstance.title=this.$translate.instant("logs.title_download_log_file"),t.componentInstance.message=this.$translate.instant("logs.download_warning"),t.componentInstance.confirmButtonLabel=this.$translate.instant("form.button_download"),t.componentInstance.faIconClass="fas fa-user-secret primary-text",t.result.then(()=>{this.$api.get("/platform-tools/hb-service/log/download",{observe:"response",responseType:"blob"}).subscribe({next:e=>{(0,ot.saveAs)(e.body,"homebridge.log.txt")},error:e=>E(this,null,function*(){let o;try{o=JSON.parse(yield e.error.text()).message}catch(r){console.error(r)}this.$toastr.error(o||this.$translate.instant("logs.download.error"),this.$translate.instant("toast.title_error"))})})}).catch(()=>{})}truncateLogFile(){let t=this.$modal.open(L,{size:"lg",backdrop:"static"});t.componentInstance.title=this.$translate.instant("logs.title_truncate_log_file"),t.componentInstance.message=this.$translate.instant("logs.truncate_log_warning"),t.componentInstance.confirmButtonLabel=this.$translate.instant("form.button_delete"),t.componentInstance.confirmButtonClass="btn-danger",t.componentInstance.faIconClass="fas fa-circle-exclamation primary-text",t.result.then(()=>{this.$api.put("/platform-tools/hb-service/log/truncate",{}).subscribe({next:()=>{this.$toastr.success(this.$translate.instant("logs.log_file_truncated"),this.$translate.instant("toast.title_success")),this.$log.term.clear()},error:e=>{console.error(e),this.$toastr.error(e.error?.message||this.$translate.instant("logs.truncate.error"),this.$translate.instant("toast.title_error"))}})}).catch(()=>{})}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=O({type:i,selectors:[["ng-component"]],viewQuery:function(e,o){e&1&&(y(o.termTarget,at,5),y(o.searchInput,st,5)),e&2&&q(2)},hostBindings:function(e,o){e&1&&u("resize",function(it){return o.onWindowResize(it)},k)},decls:10,vars:9,consts:[["logoutput",""],["searchInput",""],[1,"row","mb-3"],[1,"col-6"],[1,"primary-text","m-0"],[1,"col-6","text-end"],[1,"row"],[1,"flex-column","d-flex","align-items-stretch"],["id","log-output",1,"align-self-end","w-100","h-100","mb-1"],["container","body","placement","bottom","triggers","hover",1,"btn","btn-elegant","my-0","me-2",3,"click","openDelay","ngbTooltip"],[1,"fas","fa-download"],["container","body","placement","bottom","triggers","hover",1,"btn","btn-elegant","my-0","me-0",3,"click","openDelay","ngbTooltip"],[1,"fas","fa-trash-alt"],[1,"col-md-12"],["novalidate","",3,"ngSubmit","formGroup"],["type","text","id","logs-search","formControlName","query",1,"search-bar",3,"placeholder"],["type","button",1,"search-bar-clear"],[1,"search-bar-badge","badge","badge-primary","badge-beta"],["type","button",1,"search-bar-clear",3,"click"],["aria-hidden","true",1,"fas","fa-square-xmark"]],template:function(e,o){e&1&&(c(0,"div",2)(1,"div",3)(2,"h3",4),$(3),a(4,"translate"),l()(),_(5,lt,13,24,"div",5),l(),_(6,dt,8,7,"div",6),c(7,"div",7),p(8,"div",8,0),l()),e&2&&(n(3),B(s(4,7,"menu.linux.label_logs")),n(2),w(o.isAdmin?5:-1),n(),w(o.showSearchBar()?6:-1),n(),S("adjust-for-mobile",!o.showSearchBar())("adjust-for-mobile-with-search",o.showSearchBar()))},dependencies:[J,R,G,D,N,z,Q,H,X],styles:["body.light-mode{transition:background-color .25s ease-in-out}#log-output.light-mode[_ngcontent-%COMP%]{opacity:0;animation:_ngcontent-%COMP%_fadeIn .25s ease-in-out .25s forwards}#log-output.light-mode.fade-out[_ngcontent-%COMP%]{animation:_ngcontent-%COMP%_fadeOut .25s ease-in-out forwards!important;opacity:1}@keyframes _ngcontent-%COMP%_fadeIn{to{opacity:1}}@keyframes _ngcontent-%COMP%_fadeOut{to{opacity:0}}.search-bar[_ngcontent-%COMP%]{background-color:#111!important;color:#999!important;border:0 #242424!important}@media (hover: hover){.search-bar[_ngcontent-%COMP%]:hover{border:1px solid #242424!important}}.search-bar[_ngcontent-%COMP%]:focus{border:1px solid #242424!important;box-shadow:inherit!important;color:#eee!important}.search-bar[_ngcontent-%COMP%]::placeholder{color:#636363!important;opacity:1!important}.search-bar.is-invalid[_ngcontent-%COMP%]{border:1px solid #d32f2f!important;box-shadow:0 1px #d32f2f!important}@media (hover: hover){.search-bar.is-invalid[_ngcontent-%COMP%]:hover{border:1px solid #d32f2f!important;box-shadow:0 1px #d32f2f!important}}.search-bar.is-invalid[_ngcontent-%COMP%]:focus{border:1px solid #d32f2f!important;box-shadow:0 1px #d32f2f!important}.search-bar-badge[_ngcontent-%COMP%]{position:absolute;right:10px;top:16px;font-size:.75rem;padding:.25em .5em}.adjust-for-mobile-with-search[_ngcontent-%COMP%]{height:calc(100% - 97px);width:calc(100% + 17px);overflow:hidden}@media (max-width: 767px){.adjust-for-mobile-with-search[_ngcontent-%COMP%]{height:calc(100% - 125px);width:calc(100% + 16px)}}"]})}return i})();export{Lt as LogsComponent};
|
|
1
|
+
import{a as et}from"./chunk-QHBHZIPJ.js";import"./chunk-VCZ6KBM7.js";import{a as rt}from"./chunk-MGZVKFCX.js";import{a as L}from"./chunk-LY2WH7XJ.js";import{n as R,t as J}from"./chunk-YHD44ZXJ.js";import{D as W,c as D,e as z,f as N,g as A,j,m as G,q as H,r as Q}from"./chunk-LZU5VVW4.js";import"./chunk-4BWNO6KH.js";import{b as tt}from"./chunk-D7BCWWSP.js";import{b as U}from"./chunk-U6OOUZY4.js";import{k as K,l as X,n as Y,q as Z}from"./chunk-VWDC2WDK.js";import{$b as V,Ab as l,Bb as p,Ca as y,Ec as T,Kb as v,Nb as u,Pb as d,R as M,Ra as k,Sa as n,V as P,Wb as x,Xb as q,_b as S,ac as $,bc as B,fb as O,g as nt,h as E,kc as F,p as I,pa as m,rb as b,sb as _,tb as w,tc as a,ua as h,uc as s,va as g,yb as f,zb as c}from"./chunk-UUXRTS4O.js";var ot=nt(rt(),1);var at=["logoutput"],st=["searchInput"];function lt(i,C){if(i&1){let t=v();c(0,"div",5)(1,"button",9),a(2,"translate"),a(3,"translate"),u("click",function(){h(t);let o=d();return g(o.showSearch())}),p(4,"i"),l(),c(5,"button",9),a(6,"translate"),a(7,"translate"),u("click",function(){h(t);let o=d();return g(o.downloadLogFile())}),p(8,"i",10),l(),c(9,"button",11),a(10,"translate"),a(11,"translate"),u("click",function(){h(t);let o=d();return g(o.truncateLogFile())}),p(12,"i",12),l()()}if(i&2){let t=d();n(),f("openDelay",150)("ngbTooltip",s(2,12,"form.search")),b("aria-label",s(3,14,"form.search")),n(3),V(F("fas",t.showSearchBar()?" primary-text":""," fa-search")),n(),f("openDelay",150)("ngbTooltip",s(6,16,"form.button_download")),b("aria-label",s(7,18,"form.button_download")),n(4),f("openDelay",150)("ngbTooltip",s(10,20,"form.button_delete")),b("aria-label",s(11,22,"form.button_delete"))}}function ct(i,C){if(i&1){let t=v();c(0,"button",18),a(1,"translate"),u("click",function(){h(t);let o=d(2);return g(o.onClearSearch())}),p(2,"i",19),l()}i&2&&b("aria-label",s(1,1,"form.button_clear"))}function mt(i,C){i&1&&(c(0,"span",17),$(1),a(2,"translate"),l()),i&2&&(n(),B(s(2,1,"common.labels.beta")))}function dt(i,C){if(i&1){let t=v();c(0,"div",6)(1,"div",13)(2,"form",14),u("ngSubmit",function(){h(t);let o=d();return g(o.onSubmit(o.form.value))}),p(3,"input",15,1),a(5,"translate"),_(6,ct,3,3,"button",16)(7,mt,3,3,"span",17),l()()()}if(i&2){let t,e=d();n(2),f("formGroup",e.form),n(),S("is-invalid",e.searchInputInvalid),f("placeholder",s(5,5,"logs.placeholder_search_logs")),n(3),w((t=e.form.get("query"))!=null&&t.value?6:7)}}var Lt=(()=>{class i{$api=m(Z);$auth=m(tt);$log=m(et);$modal=m(R);$settings=m(U);$toastr=m(Y);$translate=m(K);termTarget=T("logoutput");searchInput=T("searchInput");resizeEvent=new I;valueChangesSubscription;isAdmin=this.$auth.user.admin;showSearchBar=y(!1);showExitButton=y(!1);form=new A({query:new j("")});get searchInputInvalid(){let t=(this.form.get("query")?.value||"").trim();return t.length>0&&t.length<3}onWindowResize(){this.resizeEvent.next(void 0)}ngOnInit(){let t=this.$translate.instant("menu.linux.label_logs");if(this.$settings.setPageTitle(t),window.document.querySelector("body").classList.add("bg-black"),this.$settings.actualLightingMode==="light"){window.document.querySelector("body").classList.add("light-mode");let e=this.termTarget()?.nativeElement;e&&e.classList.add("light-mode")}this.$log.startTerminal(this.termTarget(),{allowProposedApi:!0,allowTransparency:!1,fontSize:13,fontWeight:400,lineHeight:1.25},this.resizeEvent),this.valueChangesSubscription=this.form.get("query")?.valueChanges.pipe(M(500),P()).subscribe(e=>{let o=e||"",r=o.trim();r!==o&&this.form.get("query")?.setValue(r,{emitEvent:!1}),r.length>=3?(this.showExitButton.set(!0),this.$log.setSearchFilter(r),this.$log.scrollToBottom()):r.length<3&&this.showExitButton()&&(this.showExitButton.set(!1),this.$log.clearSearchFilter(),this.$log.scrollToBottom())})}showSearch(){if(this.showSearchBar())this.showSearchBar.set(!1),this.showExitButton.set(!1),this.form.setValue({query:""}),this.$log.clearSearchFilter();else{this.showSearchBar.set(!0);let t=this.searchInput();t&&setTimeout(()=>t.nativeElement.focus(),10)}setTimeout(()=>this.resizeEvent.next(void 0),10),this.$log.scrollToBottom()}onSubmit(t){let e=(t.query||"").trim();!e.length||e.length<3?(e.length||this.showSearchBar.set(!1),this.form.setValue({query:""}),this.showExitButton.set(!1),this.$log.clearSearchFilter()):(this.showExitButton.set(!0),this.$log.setSearchFilter(e)),this.$log.scrollToBottom()}onClearSearch(){this.form.setValue({query:""}),this.showExitButton.set(!1),this.$log.clearSearchFilter(),this.$log.scrollToBottom()}canDeactivate(t){return this.$settings.actualLightingMode!=="light"?(window.document.querySelector("body").classList.remove("bg-black"),Promise.resolve(!0)):(this.showSearchBar()&&this.showSearchBar.set(!1),window.document.querySelector("body").classList.remove("light-mode"),new Promise(e=>{let o=t&&(t.includes("/platform-tools/terminal")||t.includes("/logs")),r=this.termTarget()?.nativeElement;r&&r.classList.add("fade-out"),o?setTimeout(()=>{e(!0)},250):(setTimeout(()=>{window.document.querySelector("body").classList.remove("bg-black")},250),setTimeout(()=>{e(!0)},500))}))}ngOnDestroy(){window.document.querySelector("body").classList.remove("light-mode"),this.valueChangesSubscription&&this.valueChangesSubscription.unsubscribe(),this.resizeEvent.complete(),this.$log.destroyTerminal()}downloadLogFile(){let t=this.$modal.open(L,{size:"lg",backdrop:"static"});t.componentInstance.title=this.$translate.instant("logs.title_download_log_file"),t.componentInstance.message=this.$translate.instant("logs.download_warning"),t.componentInstance.confirmButtonLabel=this.$translate.instant("form.button_download"),t.componentInstance.faIconClass="fas fa-user-secret primary-text",t.result.then(()=>{this.$api.get("/platform-tools/hb-service/log/download",{observe:"response",responseType:"blob"}).subscribe({next:e=>{(0,ot.saveAs)(e.body,"homebridge.log.txt")},error:e=>E(this,null,function*(){let o;try{o=JSON.parse(yield e.error.text()).message}catch(r){console.error(r)}this.$toastr.error(o||this.$translate.instant("logs.download.error"),this.$translate.instant("toast.title_error"))})})}).catch(()=>{})}truncateLogFile(){let t=this.$modal.open(L,{size:"lg",backdrop:"static"});t.componentInstance.title=this.$translate.instant("logs.title_truncate_log_file"),t.componentInstance.message=this.$translate.instant("logs.truncate_log_warning"),t.componentInstance.confirmButtonLabel=this.$translate.instant("form.button_delete"),t.componentInstance.confirmButtonClass="btn-danger",t.componentInstance.faIconClass="fas fa-circle-exclamation primary-text",t.result.then(()=>{this.$api.put("/platform-tools/hb-service/log/truncate",{}).subscribe({next:()=>{this.$toastr.success(this.$translate.instant("logs.log_file_truncated"),this.$translate.instant("toast.title_success")),this.$log.term.clear()},error:e=>{console.error(e),this.$toastr.error(e.error?.message||this.$translate.instant("logs.truncate.error"),this.$translate.instant("toast.title_error"))}})}).catch(()=>{})}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=O({type:i,selectors:[["ng-component"]],viewQuery:function(e,o){e&1&&(x(o.termTarget,at,5),x(o.searchInput,st,5)),e&2&&q(2)},hostBindings:function(e,o){e&1&&u("resize",function(it){return o.onWindowResize(it)},k)},decls:10,vars:9,consts:[["logoutput",""],["searchInput",""],[1,"row","mb-3"],[1,"col-6"],[1,"primary-text","m-0"],[1,"col-6","text-end"],[1,"row"],[1,"flex-column","d-flex","align-items-stretch"],["id","log-output",1,"align-self-end","w-100","h-100","mb-1"],["container","body","placement","bottom","triggers","hover",1,"btn","btn-elegant","my-0","me-2",3,"click","openDelay","ngbTooltip"],[1,"fas","fa-download"],["container","body","placement","bottom","triggers","hover",1,"btn","btn-elegant","my-0","me-0",3,"click","openDelay","ngbTooltip"],[1,"fas","fa-trash-alt"],[1,"col-md-12"],["novalidate","",3,"ngSubmit","formGroup"],["type","text","id","logs-search","formControlName","query",1,"search-bar",3,"placeholder"],["type","button",1,"search-bar-clear"],[1,"search-bar-badge","badge","badge-primary","badge-beta"],["type","button",1,"search-bar-clear",3,"click"],["aria-hidden","true",1,"fas","fa-square-xmark"]],template:function(e,o){e&1&&(c(0,"div",2)(1,"div",3)(2,"h3",4),$(3),a(4,"translate"),l()(),_(5,lt,13,24,"div",5),l(),_(6,dt,8,7,"div",6),c(7,"div",7),p(8,"div",8,0),l()),e&2&&(n(3),B(s(4,7,"menu.linux.label_logs")),n(2),w(o.isAdmin?5:-1),n(),w(o.showSearchBar()?6:-1),n(),S("adjust-for-mobile",!o.showSearchBar())("adjust-for-mobile-with-search",o.showSearchBar()))},dependencies:[J,W,G,D,z,N,H,Q,X],styles:["body.light-mode{transition:background-color .25s ease-in-out}#log-output.light-mode[_ngcontent-%COMP%]{opacity:0;animation:_ngcontent-%COMP%_fadeIn .25s ease-in-out .25s forwards}#log-output.light-mode.fade-out[_ngcontent-%COMP%]{animation:_ngcontent-%COMP%_fadeOut .25s ease-in-out forwards!important;opacity:1}@keyframes _ngcontent-%COMP%_fadeIn{to{opacity:1}}@keyframes _ngcontent-%COMP%_fadeOut{to{opacity:0}}.search-bar[_ngcontent-%COMP%]{background-color:#111!important;color:#999!important;border:0 #242424!important}@media (hover: hover){.search-bar[_ngcontent-%COMP%]:hover{border:1px solid #242424!important}}.search-bar[_ngcontent-%COMP%]:focus{border:1px solid #242424!important;box-shadow:inherit!important;color:#eee!important}.search-bar[_ngcontent-%COMP%]::placeholder{color:#636363!important;opacity:1!important}.search-bar.is-invalid[_ngcontent-%COMP%]{border:1px solid #d32f2f!important;box-shadow:0 1px #d32f2f!important}@media (hover: hover){.search-bar.is-invalid[_ngcontent-%COMP%]:hover{border:1px solid #d32f2f!important;box-shadow:0 1px #d32f2f!important}}.search-bar.is-invalid[_ngcontent-%COMP%]:focus{border:1px solid #d32f2f!important;box-shadow:0 1px #d32f2f!important}.search-bar-badge[_ngcontent-%COMP%]{position:absolute;right:10px;top:16px;font-size:.75rem;padding:.25em .5em}.adjust-for-mobile-with-search[_ngcontent-%COMP%]{height:calc(100% - 97px);width:calc(100% + 17px);overflow:hidden}@media (max-width: 767px){.adjust-for-mobile-with-search[_ngcontent-%COMP%]{height:calc(100% - 127px)}}"]})}return i})();export{Lt as LogsComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as c}from"./chunk-
|
|
1
|
+
import{a as c}from"./chunk-H2SGUM2A.js";import"./chunk-JTQUK76J.js";import"./chunk-3OHVXX6B.js";import"./chunk-PTJ2WHN2.js";import"./chunk-JT7SPTVG.js";import"./chunk-N6D52WI6.js";import"./chunk-QHBHZIPJ.js";import"./chunk-VCZ6KBM7.js";import"./chunk-MGZVKFCX.js";import"./chunk-DDJU52K4.js";import"./chunk-KSI5RFA4.js";import"./chunk-PCFKF3RR.js";import"./chunk-LY2WH7XJ.js";import"./chunk-YHD44ZXJ.js";import"./chunk-LZU5VVW4.js";import"./chunk-4BWNO6KH.js";import"./chunk-D7BCWWSP.js";import{h as n}from"./chunk-O7FV4MLW.js";import"./chunk-U6OOUZY4.js";import"./chunk-VWDC2WDK.js";import{gb as i,ka as a,la as r}from"./chunk-UUXRTS4O.js";var s=(()=>{class t{canDeactivate(o,e,p,m){return o.canDeactivate?o.canDeactivate(m?.url):!0}static \u0275fac=function(e){return new(e||t)};static \u0275prov=a({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();var f=[{path:"",loadComponent:()=>import("./chunk-P5NUDX6Y.js").then(t=>t.PluginsComponent),canDeactivate:[s]}],l=(()=>{class t{static \u0275fac=function(e){return new(e||t)};static \u0275mod=i({type:t});static \u0275inj=r({imports:[n.forChild(f),n]})}return t})();var P=(()=>{class t{static \u0275fac=function(e){return new(e||t)};static \u0275mod=i({type:t});static \u0275inj=r({imports:[c,l]})}return t})();export{P as PluginsModule};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as C}from"./chunk-
|
|
1
|
+
import{b as C}from"./chunk-U6OOUZY4.js";import{k as I,l as y,p as S}from"./chunk-VWDC2WDK.js";import{Ab as a,Bb as p,Nb as x,Oa as _,Pb as B,Rc as E,Sa as e,ac as r,bc as d,cc as s,fb as k,oc as w,pa as g,rb as o,sb as f,tb as h,tc as i,uc as n,yb as v,zb as t}from"./chunk-UUXRTS4O.js";var F=(l,b)=>({"fa-chevron-down":l,"fa-chevron-right":b});function $(l,b){l&1&&(t(0,"ul",6)(1,"li",9)(2,"span",10),r(3),i(4,"translate"),p(5,"br"),t(6,"small",11),r(7),i(8,"translate"),a()(),t(9,"a",12),i(10,"translate"),p(11,"i",13),a()(),t(12,"li",9)(13,"span",10),r(14),i(15,"translate"),p(16,"br"),t(17,"small",11),r(18),i(19,"translate"),a()(),t(20,"a",14),i(21,"translate"),p(22,"i",13),a()(),t(23,"li",9)(24,"span",10),r(25),i(26,"translate"),p(27,"br"),t(28,"small",11),r(29),i(30,"translate"),a()(),t(31,"a",15),i(32,"translate"),p(33,"i",13),a()(),t(34,"li",9)(35,"span",10),r(36),i(37,"translate"),p(38,"br"),t(39,"small",11),r(40),i(41,"translate"),a()(),t(42,"a",16),i(43,"translate"),p(44,"i",13),a()()()),l&2&&(e(3),s(" ",n(4,12,"support.links.documentation")),e(4),d(n(8,14,"support.links.documentation_sub")),e(2),o("aria-label",n(10,16,"support.links.documentation")),e(5),s(" ",n(15,18,"support.links.issue")),e(4),d(n(19,20,"support.links.issue_sub")),e(2),o("aria-label",n(21,22,"support.links.issue")),e(5),s(" ",n(26,24,"support.links.discord")),e(4),d(n(30,26,"support.links.discord_sub")),e(2),o("aria-label",n(32,28,"support.links.discord")),e(5),s(" ",n(37,30,"support.links.reddit")),e(4),d(n(41,32,"support.links.reddit_sub")),e(2),o("aria-label",n(43,34,"support.links.reddit")))}function P(l,b){if(l&1&&(t(0,"ul",8)(1,"li",9)(2,"span",10),r(3),i(4,"translate"),p(5,"br"),t(6,"small",11),r(7),i(8,"translate"),a()(),t(9,"a",17),i(10,"translate"),p(11,"i",13),a()(),t(12,"li",9)(13,"span",10),r(14),i(15,"translate"),p(16,"br"),t(17,"small",11),r(18),i(19,"translate"),a()(),t(20,"a",18),i(21,"translate"),p(22,"i",13),a()(),t(23,"li",9)(24,"span",10),r(25),i(26,"translate"),p(27,"br"),t(28,"small",11),r(29),i(30,"translate"),a()(),t(31,"a",19),i(32,"translate"),p(33,"i",13),a()(),t(34,"li",9)(35,"span",10),r(36),i(37,"translate"),p(38,"br"),t(39,"small",11),r(40),i(41,"translate"),a()(),t(42,"a",20),i(43,"translate"),p(44,"i",13),a()(),t(45,"li",9)(46,"span",10),r(47),i(48,"translate"),p(49,"br"),t(50,"small",11),r(51),i(52,"translate"),a()(),t(53,"a",21),i(54,"translate"),p(55,"i",13),a()()()),l&2){let u=B();e(3),s(" ",n(4,16,"support.dev.item_swagger")),e(4),d(n(8,18,"support.dev.item_swagger_sub")),e(2),v("href",u.swaggerUrl,_),o("aria-label",n(10,20,"support.dev.item_swagger")),e(5),s(" ",n(15,22,"support.dev.api")),e(4),d(n(19,24,"support.dev.api_sub")),e(2),o("aria-label",n(21,26,"support.dev.api")),e(5),s(" ",n(26,28,"support.dev.api_hap")),e(4),d(n(30,30,"support.dev.api_hap_sub")),e(2),o("aria-label",n(32,32,"support.dev.api_hap")),e(5),s(" ",n(37,34,"support.dev.template")),e(4),d(n(41,36,"support.dev.template_sub")),e(2),o("aria-label",n(43,38,"support.dev.template")),e(5),s(" ",n(48,40,"support.dev.verified")),e(4),d(n(52,42,"support.dev.verified_sub")),e(2),o("aria-label",n(54,44,"support.dev.verified"))}}var z=(()=>{class l{$settings=g(C);$translate=g(I);swaggerEndpoint="/swagger";showFields={general:!0,dev:!0};ngOnInit(){let u=this.$translate.instant("support.title");this.$settings.setPageTitle(u)}get swaggerUrl(){return S.production?this.swaggerEndpoint:`${S.api.origin}${this.swaggerEndpoint}`}toggleSection(u){this.showFields[u]=!this.showFields[u]}static \u0275fac=function(c){return new(c||l)};static \u0275cmp=k({type:l,selectors:[["ng-component"]],decls:18,vars:23,consts:[[1,"d-flex","justify-content-between"],[1,"primary-text","m-0"],[1,"mb-4"],["role","button","tabindex","0",1,"mt-3","hover-pointer",3,"click"],[1,"primary-text"],[1,"fa",3,"ngClass"],["id","fieldsGeneral",1,"list-group","list-group-box","mt-2","mx-0"],[1,"pb-3"],["id","fieldsDev",1,"list-group","list-group-box","mt-2","mx-0"],[1,"list-group-item","d-flex","justify-content-between","align-items-center"],[1,"pe-2"],[1,"grey-text","pe-2"],["href","https://github.com/homebridge/homebridge/wiki","target","_blank","rel","noopener noreferrer",1,"btn","btn-primary","waves-effect","m-0",2,"min-width","50px"],[1,"fas","fa-external-link-alt"],["href","https://github.com/homebridge/homebridge-config-ui-x/issues/new/choose","target","_blank","rel","noopener noreferrer",1,"btn","btn-primary","waves-effect","m-0",2,"min-width","50px"],["href","https://discord.gg/C87Pvq3","target","_blank","rel","noopener noreferrer",1,"btn","btn-primary","waves-effect","m-0",2,"min-width","50px"],["href","https://www.reddit.com/r/homebridge/","target","_blank","rel","noopener noreferrer",1,"btn","btn-primary","waves-effect","m-0",2,"min-width","50px"],["target","_blank","rel","noopener noreferrer",1,"btn","btn-primary","waves-effect","m-0",2,"min-width","50px",3,"href"],["href","https://developers.homebridge.io/#/","target","_blank","rel","noopener noreferrer",1,"btn","btn-primary","waves-effect","m-0",2,"min-width","50px"],["href","https://developers.homebridge.io/HAP-NodeJS/","target","_blank","rel","noopener noreferrer",1,"btn","btn-primary","waves-effect","m-0",2,"min-width","50px"],["href","https://github.com/homebridge/homebridge-plugin-template","target","_blank","rel","noopener noreferrer",1,"btn","btn-primary","waves-effect","m-0",2,"min-width","50px"],["href","https://github.com/homebridge/homebridge/wiki/Verified-Plugins","target","_blank","rel","noopener noreferrer",1,"btn","btn-primary","waves-effect","m-0",2,"min-width","50px"]],template:function(c,m){c&1&&(t(0,"div",0)(1,"h3",1),r(2),i(3,"translate"),a()(),t(4,"div",2)(5,"div",3),x("click",function(){return m.toggleSection("general")}),t(6,"h5",4),p(7,"i",5),r(8),i(9,"translate"),a()(),f(10,$,45,36,"ul",6),a(),t(11,"div",7)(12,"div",3),x("click",function(){return m.toggleSection("dev")}),t(13,"h5",4),p(14,"i",5),r(15),i(16,"translate"),a()(),f(17,P,56,46,"ul",8),a()),c&2&&(e(2),d(n(3,11,"support.title")),e(3),o("aria-expanded",m.showFields.general?"true":"false")("aria-controls","fieldsGeneral"),e(2),v("ngClass",w(17,F,m.showFields.general,!m.showFields.general)),e(),s(" ",n(9,13,"support.links.title")," "),e(2),h(m.showFields.general?10:-1),e(2),o("aria-expanded",m.showFields.dev?"true":"false")("aria-controls","fieldsDev"),e(2),v("ngClass",w(20,F,m.showFields.dev,!m.showFields.dev)),e(),s(" ",n(16,15,"support.dev.title")," "),e(2),h(m.showFields.dev?17:-1))},dependencies:[E,y],encapsulation:2})}return l})();export{z as SupportComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as u,h as s}from"./chunk-O7FV4MLW.js";import{k as p,n as l,q as d}from"./chunk-
|
|
1
|
+
import{e as u,h as s}from"./chunk-O7FV4MLW.js";import{k as p,n as l,q as d}from"./chunk-VWDC2WDK.js";import{gb as n,h as f,ka as c,la as i,pa as e,z as m}from"./chunk-UUXRTS4O.js";var a=(()=>{class t{$api=e(d);$router=e(u);$toastr=e(l);$translate=e(p);resolve(){return f(this,null,function*(){try{let o=yield m(this.$api.get("/config-editor"));return JSON.stringify(o,null,4)}catch(o){console.error(o),this.$toastr.error(o.message,this.$translate.instant("toast.title_error")),this.$router.navigate(["/"])}})}static \u0275fac=function(r){return new(r||t)};static \u0275prov=c({token:t,factory:t.\u0275fac})}return t})();var y=[{path:"",loadComponent:()=>import("./chunk-ZHCPTG5R.js").then(t=>t.ConfigEditorComponent),resolve:{config:a}}],v=(()=>{class t{static \u0275fac=function(r){return new(r||t)};static \u0275mod=n({type:t});static \u0275inj=i({imports:[s.forChild(y),s]})}return t})();var T=(()=>{class t{static \u0275fac=function(r){return new(r||t)};static \u0275mod=n({type:t});static \u0275inj=i({providers:[a],imports:[v]})}return t})();export{T as ConfigEditorModule};
|