UNPKG

homebridge-config-ui-x

Version:

A web based management, configuration and control platform for Homebridge.

1 lines 1.64 kB
import{$ as Le,Fr as se,Jr as ve,Kr as v3,M as Fe,Un as g,Vt as U3,Y as Je,dt as Nf,gt as Pe,hr as nc,jt as S_,kn as br,pt as Ot,ui as z0,ut as N_,vt as Py,wr as q}from"./chunk-D96TCRAL.js";function y(t,S){if(t&1&&(Pe(0,`div`,7),Ot(1),Je()),t&2){let r=ve();se(),Py(r.error())}}function C(t,S){t&1&&(Pe(0,`p`,8),Ot(1),S_(2,`translate`),Je()),t&2&&(se(),Py(N_(2,1,`platform.linux.server_will_power_down`)))}var M=(()=>{class t{$api=g(U3);$toastr=g(z0);$translate=g(Nf);error=q(!1);ngOnInit(){this.$api.put(`/platform-tools/linux/shutdown-host`,{}).catch(r=>{console.error(r),this.error.set(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`))})}static ɵfac=function(l){return new(l||t)};static ɵcmp=nc({type:t,selectors:[[`app-shutdown-linux`]],decls:13,vars:7,consts:[[1,`d-flex`,`justify-content-between`],[1,`primary-text`,`m-0`],[1,`my-4`,`align-items-center`,`container-narrow`],[1,`w-100`,`text-center`,`primary-text`,`mb-5`],[1,`fas`,`fa-power-off`,`icon-xl`],[1,`text-center`],[1,`primary-text`,`mb-4`],[1,`alert`,`alert-error`,`my-4`],[1,`grey-text`]],template:function(l,g){l&1&&(Pe(0,`div`,0)(1,`h3`,1),Ot(2),S_(3,`translate`),Je()(),Pe(4,`div`,2)(5,`div`,3),br(6,`i`,4),Je(),Pe(7,`div`,5)(8,`h4`,6),Ot(9),S_(10,`translate`),Je(),Fe(11,y,2,1,`div`,7)(12,C,3,3,`p`,8),Je()()),l&2&&(se(2),Py(N_(3,3,`menu.restart.title`)),se(7),Py(N_(10,5,`platform.linux.shutting_down_server`)),se(2),Le(g.error()?11:12))},dependencies:[v3],encapsulation:2})}return t})();export{M as ShutdownLinuxComponent};