Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 uid=33(www-data) gid=33(www-data) groups=33(www-data) Safe-mode: OFF (not secure) /usr/local/lib/node_modules/homebridge-config-ui-x/public/ drwxr-xr-x | |
| Viewing file: Select action/file-type: !function(){function t(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}function n(t,n){for(var e=0;e<n.length;e++){var o=n[e];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}(self.webpackChunkui=self.webpackChunkui||[]).push([[471],{93471:function(e,o,s){"use strict";s.r(o),s.d(o,{LogsModule:function(){return x}});var i=s(38583),a=s(71271),r=s(63423),c=s(64762),l=s(79765),u=s(49457),g=s(81862),f=s(37716),d=s(92503),p=s(79274),h=s(76726),m=s(49344),b=s(95935),v=["logoutput"];function w(t,n){if(1&t){var e=f.EpF();f.TgZ(0,"div",4),f.TgZ(1,"button",5),f.NdJ("click",function(){return f.CHM(e),f.oxw().downloadLogFile()}),f._UZ(2,"i",6),f.qZA(),f.TgZ(3,"button",7),f.NdJ("click",function(){return f.CHM(e),f.oxw().truncateLogFile()}),f._UZ(4,"i",8),f.qZA(),f.qZA()}}var _,$,y=[{path:"",component:(_=function(){function e(n,o,s,i,a,r){t(this,e),this.$settings=n,this.$api=o,this.$log=s,this.$toastr=i,this.$translate=a,this.$modal=r,this.resizeEvent=new l.xQ}var o,s,i;return o=e,(s=[{key:"ngOnInit",value:function(){window.document.querySelector("body").classList.add("bg-black"),this.$log.startTerminal(this.termTarget,{},this.resizeEvent)}},{key:"onWindowResize",value:function(t){this.resizeEvent.next()}},{key:"ngOnDestroy",value:function(){window.document.querySelector("body").classList.remove("bg-black"),this.$log.destroyTerminal()}},{key:"downloadLogFile",value:function(){var t=this,n=this.$modal.open(g.X);n.componentInstance.title=this.$translate.instant("logs.title_download_log_file"),n.componentInstance.message=this.$translate.instant("logs.message_download_warning"),n.componentInstance.confirmButtonLabel=this.$translate.instant("logs.label_download"),n.result.then(function(){t.$api.get("/platform-tools/hb-service/log/download",{observe:"response",responseType:"blob"}).subscribe(function(t){(0,u.saveAs)(t.body,"homebridge.log.txt")},function(n){return(0,c.mG)(t,void 0,void 0,regeneratorRuntime.mark(function t(){var e;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.t0=JSON,t.next=4,n.error.text();case 4:t.t1=t.sent,e=t.t0.parse.call(t.t0,t.t1).message,t.next=10;break;case 8:t.prev=8,t.t2=t.catch(0);case 10:this.$toastr.error(e||"Failed to download log file",this.$translate.instant("toast.title_error"));case 11:case"end":return t.stop()}},t,this,[[0,8]])}))})}).catch(function(){})}},{key:"truncateLogFile",value:function(){var t=this,n=this.$modal.open(g.X);n.componentInstance.title=this.$translate.instant("logs.title_truncate_log_file"),n.componentInstance.message=this.$translate.instant("logs.message_truncate_log_warning"),n.componentInstance.confirmButtonLabel=this.$translate.instant("logs.label_truncate"),n.result.then(function(){t.$api.put("/platform-tools/hb-service/log/truncate",{}).subscribe(function(n){t.$toastr.success(t.$translate.instant("logs.message_log_file_truncated"),t.$translate.instant("toast.title_success")),t.$log.term.clear()},function(n){t.$toastr.error(n.error.message||"Failed to truncate log file",t.$translate.instant("toast.title_error"))})}).catch(function(){})}}])&&n(o.prototype,s),i&&n(o,i),e}(),_.\u0275fac=function(t){return new(t||_)(f.Y36(d.g),f.Y36(p.s),f.Y36(h.$),f.Y36(m._W),f.Y36(b.sK),f.Y36(a.FF))},_.\u0275cmp=f.Xpm({type:_,selectors:[["app-logs"]],viewQuery:function(t,n){var e;1&t&&f.Gf(v,7),2&t&&f.iGM(e=f.CRH())&&(n.termTarget=e.first)},hostBindings:function(t,n){1&t&&f.NdJ("resize",function(t){return n.onWindowResize(t)},!1,f.Jf7)},decls:4,vars:1,consts:[["class","log-buttons",4,"ngIf"],[1,"flex-column","d-flex","align-items-stretch","h-100"],["id","log-output",1,"terminal","align-self-end","w-100","h-100","mb-1"],["logoutput",""],[1,"log-buttons"],[1,"btn","btn-primary",3,"click"],[1,"fas","fa-download"],[1,"btn","btn-danger",3,"click"],[1,"fas","fa-trash-alt"]],template:function(t,n){1&t&&(f.YNc(0,w,5,0,"div",0),f.TgZ(1,"div",1),f._UZ(2,"div",2,3),f.qZA()),2&t&&f.Q6J("ngIf",n.$settings.env.serviceMode)},directives:[i.O5],styles:[".log-buttons[_ngcontent-%COMP%]{position:fixed;top:80px;right:10px;z-index:1000}.log-buttons[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{opacity:.4;transition:opacity .2s ease-in}@media (hover: hover){.log-buttons[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:active, .log-buttons[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:hover{opacity:1}}"]}),_)}],k=function(){var n=function n(){t(this,n)};return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=f.oAB({type:n}),n.\u0275inj=f.cJS({imports:[[r.Bz.forChild(y)],r.Bz]}),n}(),x=(($=function n(){t(this,n)}).\u0275fac=function(t){return new(t||$)},$.\u0275mod=f.oAB({type:$}),$.\u0275inj=f.cJS({imports:[[i.ez,k,a.IJ]]}),$)}}])}(); |
:: Command execute :: | |
--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0046 ]-- |