homebridge-config-ui-x
Version:
A web based management, configuration and control platform for Homebridge
1 lines • 8.91 kB
JavaScript
(window.webpackJsonp=window.webpackJsonp||[]).push([[13],{Yv9t:function(t,l,n){"use strict";n.r(l);var e=n("8Y7J");class s{}var r=n("pMnS"),u=n("GFsM"),i=n("vAZj"),a=n("TSSN"),o=n("SVse"),c=n("O2so"),h=n("HyEY"),d=n("+WIb"),p=n("Vurf");class m{constructor(t,l,n,e,s,r){this.$api=t,this.$ws=l,this.$auth=n,this.$toastr=e,this.translate=s,this.$router=r,this.io=this.$ws.connectToNamespace("status"),this.resp={},this.timeout=!1,this.error=!1}ngOnInit(){this.io.connected.subscribe(()=>{this.io.socket.emit("monitor-server-status"),this.$auth.getAppSettings().catch()}),this.$api.put("/platform-tools/linux/restart-host",{}).subscribe(t=>{this.resp=t,this.checkIfServerUp()},t=>{this.error=this.translate.instant("platform.linux.restart.toast_server_restart_error"),this.$toastr.error(`${this.error}: ${t.message}`,this.translate.instant("toast.title_error"))})}checkIfServerUp(){this.checkDelay=c.a.create(3e4).subscribe(()=>{this.io.socket.on("homebridge-status",t=>{"up"===t.status&&(this.$toastr.success(this.translate.instant("platform.linux.restart.toast_server_restarted"),this.translate.instant("toast.title_success")),this.$router.navigate(["/"]))})}),this.checkTimeout=c.a.create(12e4).subscribe(()=>{this.$toastr.warning(this.translate.instant("platform.linux.restart.toast_server_taking_long_time_to_come_online"),this.translate.instant("toast.title_warning"),{timeOut:1e4}),this.timeout=!0})}ngOnDestroy(){this.io.end(),this.checkDelay&&this.checkDelay.unsubscribe(),this.checkTimeout&&this.checkTimeout.unsubscribe()}}var f=n("EApP"),g=n("iInd"),v=e["\u0275crt"]({encapsulation:0,styles:[[""]],data:{}});function _(t){return e["\u0275vid"](0,[(t()(),e["\u0275eld"](0,0,null,null,1,"app-spinner",[],null,null,null,u.b,u.a)),e["\u0275did"](1,114688,null,0,i.a,[],null,null)],(function(t,l){t(l,1,0)}),null)}function w(t){return e["\u0275vid"](0,[(t()(),e["\u0275eld"](0,0,null,null,2,"p",[["class","grey-text"]],null,null,null,null,null)),e["\u0275did"](1,8536064,null,0,a.e,[a.l,e.ElementRef,e.ChangeDetectorRef],{translate:[0,"translate"]},null),(t()(),e["\u0275ted"](-1,null,["Please wait, this page will automatically redirect when the Homebridge is back online."]))],(function(t,l){t(l,1,0,"platform.linux.restart.message_please_wait_while_server_restarts")}),null)}function b(t){return e["\u0275vid"](0,[(t()(),e["\u0275eld"](0,0,null,null,1,"p",[["class","grey-text"]],null,null,null,null,null)),(t()(),e["\u0275ted"](1,null,["",""]))],null,(function(t,l){t(l,1,0,l.component.error)}))}function k(t){return e["\u0275vid"](0,[(t()(),e["\u0275eld"](0,0,null,null,3,"div",[],null,null,null,null,null)),(t()(),e["\u0275eld"](1,0,null,null,2,"p",[["class","grey-text"]],null,null,null,null,null)),e["\u0275did"](2,8536064,null,0,a.e,[a.l,e.ElementRef,e.ChangeDetectorRef],{translate:[0,"translate"]},null),(t()(),e["\u0275ted"](-1,null,["Server restart is taking a long time. You may need to bring up the server back up manually."]))],(function(t,l){t(l,2,0,"platform.linux.restart.message_server_taking_long_time_to_restart")}),null)}function $(t){return e["\u0275vid"](0,[(t()(),e["\u0275and"](16777216,null,null,1,null,_)),e["\u0275did"](1,16384,null,0,o.NgIf,[e.ViewContainerRef,e.TemplateRef],{ngIf:[0,"ngIf"]},null),(t()(),e["\u0275eld"](2,0,null,null,10,"div",[["class","row"]],null,null,null,null,null)),(t()(),e["\u0275eld"](3,0,null,null,9,"div",[["class","col-md-12 text-center"]],null,null,null,null,null)),(t()(),e["\u0275eld"](4,0,null,null,2,"h3",[["class","primary-text"]],null,null,null,null,null)),e["\u0275did"](5,8536064,null,0,a.e,[a.l,e.ElementRef,e.ChangeDetectorRef],{translate:[0,"translate"]},null),(t()(),e["\u0275ted"](-1,null,["Restarting Server"])),(t()(),e["\u0275and"](16777216,null,null,1,null,w)),e["\u0275did"](8,16384,null,0,o.NgIf,[e.ViewContainerRef,e.TemplateRef],{ngIf:[0,"ngIf"]},null),(t()(),e["\u0275and"](16777216,null,null,1,null,b)),e["\u0275did"](10,16384,null,0,o.NgIf,[e.ViewContainerRef,e.TemplateRef],{ngIf:[0,"ngIf"]},null),(t()(),e["\u0275and"](16777216,null,null,1,null,k)),e["\u0275did"](12,16384,null,0,o.NgIf,[e.ViewContainerRef,e.TemplateRef],{ngIf:[0,"ngIf"]},null)],(function(t,l){var n=l.component;t(l,1,0,!n.error),t(l,5,0,"platform.linux.restart.title_restarting_server"),t(l,8,0,!n.timeout&&!n.error),t(l,10,0,n.error),t(l,12,0,n.timeout)}),null)}function x(t){return e["\u0275vid"](0,[(t()(),e["\u0275eld"](0,0,null,null,1,"app-restart-linux",[],null,null,null,$,v)),e["\u0275did"](1,245760,null,0,m,[h.a,d.a,p.a,f.j,a.l,g.l],null,null)],(function(t,l){t(l,1,0)}),null)}var I=e["\u0275ccf"]("app-restart-linux",m,x,{},{},[]);class R{constructor(t,l,n,e,s,r){this.$api=t,this.$ws=l,this.$auth=n,this.$toastr=e,this.translate=s,this.$router=r,this.io=this.$ws.connectToNamespace("status"),this.resp={},this.timeout=!1,this.error=!1}ngOnInit(){this.io.connected.subscribe(()=>{this.io.socket.emit("monitor-server-status"),this.$auth.getAppSettings().catch()}),this.$api.put("/platform-tools/linux/shutdown-host",{}).subscribe(t=>{this.resp=t,this.checkIfServerUp()},t=>{this.error=this.translate.instant("platform.linux.restart.toast_server_restart_error"),this.$toastr.error(`${this.error}: ${t.message}`,this.translate.instant("toast.title_error"))})}checkIfServerUp(){this.checkDelay=c.a.create(3e4).subscribe(()=>{this.io.socket.on("homebridge-status",t=>{"up"===t.status&&(this.$toastr.success(this.translate.instant("platform.linux.restart.toast_server_restarted"),this.translate.instant("toast.title_success")),this.$router.navigate(["/"]))})}),this.checkTimeout=c.a.create(12e4).subscribe(()=>{this.$toastr.warning(this.translate.instant("platform.linux.restart.toast_server_taking_long_time_to_come_online"),this.translate.instant("toast.title_warning"),{timeOut:1e4}),this.timeout=!0})}ngOnDestroy(){this.io.end(),this.checkDelay&&this.checkDelay.unsubscribe(),this.checkTimeout&&this.checkTimeout.unsubscribe()}}var y=e["\u0275crt"]({encapsulation:0,styles:[[""]],data:{}});function C(t){return e["\u0275vid"](0,[(t()(),e["\u0275eld"](0,0,null,null,2,"p",[["class","grey-text"]],null,null,null,null,null)),e["\u0275did"](1,8536064,null,0,a.e,[a.l,e.ElementRef,e.ChangeDetectorRef],{translate:[0,"translate"]},null),(t()(),e["\u0275ted"](-1,null,["The server will power down shortly."]))],(function(t,l){t(l,1,0,"platform.linux.shutdown.message_server_will_power_down")}),null)}function T(t){return e["\u0275vid"](0,[(t()(),e["\u0275eld"](0,0,null,null,1,"p",[["class","grey-text"]],null,null,null,null,null)),(t()(),e["\u0275ted"](1,null,["",""]))],null,(function(t,l){t(l,1,0,l.component.error)}))}function D(t){return e["\u0275vid"](0,[(t()(),e["\u0275eld"](0,0,null,null,8,"div",[["class","row"]],null,null,null,null,null)),(t()(),e["\u0275eld"](1,0,null,null,7,"div",[["class","col-md-12 text-center"]],null,null,null,null,null)),(t()(),e["\u0275eld"](2,0,null,null,2,"h3",[["class","primary-text"]],null,null,null,null,null)),e["\u0275did"](3,8536064,null,0,a.e,[a.l,e.ElementRef,e.ChangeDetectorRef],{translate:[0,"translate"]},null),(t()(),e["\u0275ted"](-1,null,["Shutting Down Server "])),(t()(),e["\u0275and"](16777216,null,null,1,null,C)),e["\u0275did"](6,16384,null,0,o.NgIf,[e.ViewContainerRef,e.TemplateRef],{ngIf:[0,"ngIf"]},null),(t()(),e["\u0275and"](16777216,null,null,1,null,T)),e["\u0275did"](8,16384,null,0,o.NgIf,[e.ViewContainerRef,e.TemplateRef],{ngIf:[0,"ngIf"]},null)],(function(t,l){var n=l.component;t(l,3,0,"platform.linux.shutdown.title_shutting_down_server"),t(l,6,0,!n.timeout&&!n.error),t(l,8,0,n.error)}),null)}function S(t){return e["\u0275vid"](0,[(t()(),e["\u0275eld"](0,0,null,null,1,"app-shutdown-linux",[],null,null,null,D,y)),e["\u0275did"](1,245760,null,0,R,[h.a,d.a,p.a,f.j,a.l,g.l],null,null)],(function(t,l){t(l,1,0)}),null)}var N=e["\u0275ccf"]("app-shutdown-linux",R,S,{},{},[]),E=n("pKmL");class O{}n.d(l,"LinuxModuleNgFactory",(function(){return V}));var V=e["\u0275cmf"](s,[],(function(t){return e["\u0275mod"]([e["\u0275mpd"](512,e.ComponentFactoryResolver,e["\u0275CodegenComponentFactoryResolver"],[[8,[r.a,I,N]],[3,e.ComponentFactoryResolver],e.NgModuleRef]),e["\u0275mpd"](4608,o.NgLocalization,o.NgLocaleLocalization,[e.LOCALE_ID,[2,o["\u0275angular_packages_common_common_a"]]]),e["\u0275mpd"](4608,a.h,a.g,[]),e["\u0275mpd"](4608,a.c,a.f,[]),e["\u0275mpd"](4608,a.j,a.d,[]),e["\u0275mpd"](4608,a.b,a.a,[]),e["\u0275mpd"](4608,a.l,a.l,[a.m,a.h,a.c,a.j,a.b,a.n,a.o]),e["\u0275mpd"](1073742336,o.CommonModule,o.CommonModule,[]),e["\u0275mpd"](1073742336,a.i,a.i,[]),e["\u0275mpd"](1073742336,E.a,E.a,[]),e["\u0275mpd"](1073742336,g.p,g.p,[[2,g.u],[2,g.l]]),e["\u0275mpd"](1073742336,O,O,[]),e["\u0275mpd"](1073742336,s,s,[]),e["\u0275mpd"](1024,g.j,(function(){return[[{path:"",redirectTo:"/",pathMatch:"full"},{path:"restart-server",component:m},{path:"shutdown-server",component:R}]]}),[]),e["\u0275mpd"](256,a.o,void 0,[]),e["\u0275mpd"](256,a.n,void 0,[])])}))}}]);