homebridge-config-ui-x
Version:
A web based management, configuration and control platform for Homebridge.
1 lines • 1.55 kB
JavaScript
import {L}from'./chunk-MWxClZxO.js';import {O}from'./chunk-BtxeAJ3m.js';import {A}from'./chunk-BWu8OGjA.js';import {g,ag as we,z as zt,ah as si,a2 as bf,E,ai as ty,ae as C}from'./main-ONDCASUV.js';var b=(()=>{class n{injector=g(we);$terminal=g(L);$settings=g(zt);$modal=g(si);$translate=g(bf);handleBeforeUnload(r){if(!this.$settings.env.terminal?.persistence&&!this.$settings.env.terminal?.hideWarning&&this.$terminal.hasActiveSession()&&this.$terminal.hasUserTypedInSession()){let t=this.$translate.instant("platform.terminal.terminate_unload");return r.preventDefault(),r.returnValue=t,t}}canDeactivate(){return E(this,null,function*(){if(this.$settings.env.terminal?.persistence||this.$settings.env.terminal?.hideWarning||!this.$terminal.hasActiveSession()||!this.$terminal.hasUserTypedInSession())return true;let r=ty([{provide:A,useValue:{title:this.$translate.instant("platform.terminal.terminate_title"),message:this.$translate.instant("platform.terminal.terminate_message_1"),message2:this.$translate.instant("platform.terminal.terminate_message_2"),message3:this.$translate.instant("common.phrases.are_you_sure"),confirmButtonLabel:this.$translate.instant("form.button_continue"),confirmButtonClass:"btn-primary",faIconClass:"fas fa-exclamation-triangle text-warning"}}],this.injector),t=this.$modal.open(O,{size:"lg",backdrop:"static",injector:r});try{return yield t.result,!0}catch(h){return false}})}static \u0275fac=function(t){return new(t||n)};static \u0275prov=C({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();export{b};