UNPKG

homebridge-config-ui-x

Version:

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

2 lines (1 loc) 1.64 kB
import{$c as _,Ea as n,Mb as o,Nb as a,Ra as c,Yc as h,Zc as E,aa as m,cb as x,db as u,dc as d,dd as w,ec as p,mb as i,nb as e,ob as f,qa as s,zb as v}from"./chunk-LTGI3NYM.js";import"./chunk-B4AJQJMI.js";function y(t,S){if(t&1&&(i(0,"div",7),o(1),e()),t&2){let r=v();n(),a(r.error())}}function C(t,S){t&1&&(i(0,"p",8),o(1),d(2,"translate"),e()),t&2&&(n(),a(p(2,1,"platform.linux.server_will_power_down")))}var M=(()=>{class t{$api=m(w);$toastr=m(_);$translate=m(h);error=s(!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 \u0275fac=function(l){return new(l||t)};static \u0275cmp=c({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&&(i(0,"div",0)(1,"h3",1),o(2),d(3,"translate"),e()(),i(4,"div",2)(5,"div",3),f(6,"i",4),e(),i(7,"div",5)(8,"h4",6),o(9),d(10,"translate"),e(),x(11,y,2,1,"div",7)(12,C,3,3,"p",8),e()()),l&2&&(n(2),a(p(3,3,"menu.restart.title")),n(7),a(p(10,5,"platform.linux.shutting_down_server")),n(2),u(g.error()?11:12))},dependencies:[E],encapsulation:2,changeDetection:0})}return t})();export{M as ShutdownLinuxComponent};