homebridge-config-ui-x 4.44.2-test.2 → 4.44.2-test.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "homebridge-config-ui-x",
3
3
  "displayName": "Homebridge UI",
4
- "version": "4.44.2-test.2",
4
+ "version": "4.44.2-test.3",
5
5
  "description": "A web based management, configuration and control platform for Homebridge",
6
6
  "license": "MIT",
7
7
  "author": "oznu <dev@oz.nu>",
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkui=self.webpackChunkui||[]).push([[135],{92135:(Q,f,o)=>{o.r(f),o.d(f,{DockerModule:()=>V});var u=o(69808),l=o(93075),x=o(8192),c=o(29285),v=o(72501),S=o(40294),p=o(6741),C=o(70655),t=o(5e3),_=o(92503),h=o(79274),k=o(58605),y=o(64959),m=o(22290);function T(e,i){1&e&&t._UZ(0,"i",13)}function M(e,i){if(1&e){const r=t.EpF();t.TgZ(0,"ngx-monaco-editor",14),t.NdJ("onInit",function(n){return t.CHM(r),t.oxw().onEditorInit(n)})("keydown.control.s",function(n){t.CHM(r);const a=t.oxw();return n.preventDefault(),a.onSave()})("keydown.meta.s",function(n){t.CHM(r);const a=t.oxw();return n.preventDefault(),a.onSave()}),t.qZA()}if(2&e){const r=t.oxw();t.Q6J("options",r.editorOptions)("model",r.monacoEditorModel)}}function $(e,i){if(1&e){const r=t.EpF();t.TgZ(0,"textarea",15),t.NdJ("ngModelChange",function(n){return t.CHM(r),t.oxw().startupScript=n}),t._uU(1," "),t.qZA()}if(2&e){const r=t.oxw();t.Q6J("ngModel",r.startupScript)}}let b=(()=>{class e{constructor(r,s,n,a,d,g,R){this.$settings=r,this.$api=s,this.$md=n,this.$monacoEditor=a,this.$toastr=d,this.translate=g,this.$route=R,this.isMobile=!1,this.options={printMargin:!1},this.editorOptions={language:"shell",theme:this.$settings.theme.startsWith("dark-mode")?"vs-dark":"vs-light",automaticLayout:!0},this.isMobile=this.$md.detect.mobile()}ngOnInit(){this.visualViewPortEventCallback=()=>this.visualViewPortChanged(),this.lastHeight=window.innerHeight,window.visualViewport&&!this.isMobile&&(window.visualViewport.addEventListener("resize",this.visualViewPortEventCallback,!0),this.$md.disableTouchMove()),this.$route.data.subscribe(r=>{this.startupScript=r.startupScript.script}),this.monacoEditorModel={value:"",language:"shell"}}onEditorInit(r){this.monacoEditor=r,this.monacoEditor.getModel().setValue(this.startupScript)}onSave(){return(0,C.mG)(this,void 0,void 0,function*(){if(!this.saveInProgress){if(this.saveInProgress=!0,this.isMobile||(yield this.monacoEditor.getAction("editor.action.formatDocument").run(),this.startupScript=this.monacoEditor.getModel().getValue()),!["#!/bin/sh","#!/bin/bash"].includes(this.startupScript.split("\n")[0].trim()))return this.$toastr.error(this.translate.instant("platform.docker.startup_script.toast_script_must_use_hashbang"),this.translate.instant("platform.docker.startup_script.toast_title_script_error")),this.startupScript="#!/bin/sh\n\n"+this.startupScript,this.isMobile||this.monacoEditor.getModel().setValue(this.startupScript),void(this.saveInProgress=!1);try{yield this.$api.put("/platform-tools/docker/startup-script",{script:this.startupScript}).toPromise(),this.$toastr.success(this.translate.instant("platform.docker.startup_script.toast_restart_required"),this.translate.instant("platform.docker.startup_script.toast_title_script_saved"))}catch(r){this.$toastr.error(r.message,this.translate.instant("toast.title_error"))}this.saveInProgress=!1}})}visualViewPortChanged(){this.lastHeight<window.visualViewport.height&&document.activeElement.blur(),window.visualViewport.height<window.innerHeight?(this.$md.enableTouchMove(),this.lastHeight=window.visualViewport.height):window.visualViewport.height===window.innerHeight&&(this.$md.disableTouchMove(),this.lastHeight=window.visualViewport.height)}ngOnDestroy(){window.visualViewport&&(window.visualViewport.removeEventListener("resize",this.visualViewPortEventCallback,!0),this.$md.enableTouchMove()),this.monacoEditor&&this.monacoEditor.dispose()}}return e.\u0275fac=function(r){return new(r||e)(t.Y36(_.g),t.Y36(h.s),t.Y36(k.L),t.Y36(y.L),t.Y36(m._W),t.Y36(c.sK),t.Y36(p.gz))},e.\u0275cmp=t.Xpm({type:e,selectors:[["app-startup-script"]],decls:18,vars:8,consts:[[1,"flex-column","d-flex","align-items-stretch","h-100"],[1,"row"],[1,"col-sm-8","d-none","d-sm-block"],[1,"primary-text","m-0"],[1,"d-none","d-md-inline"],[1,"col-sm-4","text-right"],[1,"btn","btn-primary","waves-effect","m-0",3,"disabled","click"],["class","fas fa-spinner fa-pulse",4,"ngIf"],[1,"row","mt-3"],[1,"col-md-12"],["role","alert",1,"alert","alert-warning",3,"translate"],["class","flex-grow-1 h-100 w-100 mb-3 mt-3",3,"options","model","onInit","keydown.control.s","keydown.meta.s",4,"ngIf"],["wrap","off","class","hb-plain-text-editor align-self-end h-100 w-100 mb-3 mt-3","autocomplete","off","autocorrect","off","autocapitalize","off","spellcheck","false",3,"ngModel","ngModelChange",4,"ngIf"],[1,"fas","fa-spinner","fa-pulse"],[1,"flex-grow-1","h-100","w-100","mb-3","mt-3",3,"options","model","onInit","keydown.control.s","keydown.meta.s"],["wrap","off","autocomplete","off","autocorrect","off","autocapitalize","off","spellcheck","false",1,"hb-plain-text-editor","align-self-end","h-100","w-100","mb-3","mt-3",3,"ngModel","ngModelChange"]],template:function(r,s){1&r&&(t.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"h3",3)(4,"span",4),t._uU(5,"Docker Container"),t.qZA(),t._uU(6," startup.sh"),t.qZA()(),t.TgZ(7,"div",5)(8,"button",6),t.NdJ("click",function(){return s.onSave()}),t._uU(9),t.ALo(10,"translate"),t.YNc(11,T,1,0,"i",7),t.qZA()()(),t.TgZ(12,"div",8)(13,"div",9)(14,"div",10),t._uU(15," This script will be executed each time the docker container starts. You can use this to install any extra packages your plugins may need such as ffmpeg or libpcap-dev. "),t.qZA()()(),t.YNc(16,M,1,2,"ngx-monaco-editor",11),t.YNc(17,$,2,1,"textarea",12),t.qZA()),2&r&&(t.xp6(8),t.Q6J("disabled",s.saveInProgress),t.xp6(1),t.hij(" ",t.lcZ(10,6,"form.button_save")," "),t.xp6(2),t.Q6J("ngIf",s.saveInProgress),t.xp6(3),t.Q6J("translate","platform.docker.startup_script.message_script_help"),t.xp6(2),t.Q6J("ngIf",!s.isMobile),t.xp6(1),t.Q6J("ngIf",s.isMobile))},directives:[u.O5,c.Pi,v.PG,l.Fj,l.JJ,l.On],pipes:[c.X$],styles:[""]}),e})();var I=o(45417),Z=o(48703);function J(e,i){1&e&&t._UZ(0,"app-spinner")}function Y(e,i){1&e&&(t.TgZ(0,"p",8),t._uU(1," Please wait, this page will automatically redirect when the Homebridge is back online."),t.qZA()),2&e&&t.Q6J("translate","restart.message_please_wait_while_server_restarts")}function E(e,i){if(1&e&&(t.TgZ(0,"p",9),t._uU(1),t.qZA()),2&e){const r=t.oxw();t.xp6(1),t.Oqu(r.error)}}function A(e,i){1&e&&(t.TgZ(0,"div")(1,"p",8),t._uU(2," Server restart is taking a long time. You may need to bring up the Docker container manually."),t.qZA(),t.TgZ(3,"p",10),t.ALo(4,"translate"),t._uU(5,"Make sure you're running the Docker container with "),t.TgZ(6,"strong"),t._uU(7,"--restart=always"),t.qZA()()()),2&e&&(t.xp6(1),t.Q6J("translate","platform.docker.restart_container.message_server_taking_long_time_to_restart"),t.xp6(2),t.Q6J("innerHTML",t.lcZ(4,2,"platform.docker.restart_container.message_run_with_restart_always"),t.oJD))}let D=(()=>{class e{constructor(r,s,n,a,d,g){this.$api=r,this.$ws=s,this.$settings=n,this.$toastr=a,this.translate=d,this.$router=g,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.$settings.getAppSettings().catch()}),this.$api.put("/platform-tools/docker/restart-container",{}).subscribe(r=>{this.resp=r,this.checkIfServerUp()},r=>{const s=this.translate.instant("restart.toast_server_restart_error");this.error=s+".",this.$toastr.error(`${s}: ${r.message}`,this.translate.instant("toast.title_error"))})}checkIfServerUp(){this.checkDelay=setTimeout(()=>{this.io.socket.on("homebridge-status",r=>{("up"===r.status||"pending"===r.status)&&(this.$toastr.success(this.translate.instant("platform.docker.restart_container.toast_container_restarted"),this.translate.instant("toast.title_success")),this.$router.navigate(["/"]))})},1e4),this.checkTimeout=setTimeout(()=>{this.$toastr.warning(this.translate.instant("restart.toast_sever_restart_timeout"),this.translate.instant("toast.title_warning"),{timeOut:1e4}),this.timeout=!0},6e4)}ngOnDestroy(){this.io.end(),clearTimeout(this.checkDelay),clearTimeout(this.checkTimeout)}}return e.\u0275fac=function(r){return new(r||e)(t.Y36(h.s),t.Y36(I.r),t.Y36(_.g),t.Y36(m._W),t.Y36(c.sK),t.Y36(p.F0))},e.\u0275cmp=t.Xpm({type:e,selectors:[["app-container-restart"]],decls:10,vars:5,consts:[[4,"ngIf"],[1,"row"],[1,"col-md-12","text-center"],[1,"primary-text"],[1,"fab","fa-docker"],[1,"primary-text",3,"translate"],["class","grey-text",3,"translate",4,"ngIf"],["class","grey-text",4,"ngIf"],[1,"grey-text",3,"translate"],[1,"grey-text"],[1,"primary-text",3,"innerHTML"]],template:function(r,s){1&r&&(t.YNc(0,J,1,0,"app-spinner",0),t.TgZ(1,"div",1)(2,"div",2)(3,"h1",3),t._UZ(4,"i",4),t.qZA(),t.TgZ(5,"h3",5),t._uU(6,"Restarting Docker Container"),t.qZA(),t.YNc(7,Y,2,1,"p",6),t.YNc(8,E,2,1,"p",7),t.YNc(9,A,8,4,"div",0),t.qZA()()),2&r&&(t.Q6J("ngIf",!s.error),t.xp6(5),t.Q6J("translate","platform.docker.restart_container.title_restarting"),t.xp6(2),t.Q6J("ngIf",!s.timeout&&!s.error),t.xp6(1),t.Q6J("ngIf",s.error),t.xp6(1),t.Q6J("ngIf",s.timeout))},directives:[u.O5,Z.O,c.Pi],pipes:[c.X$],encapsulation:2}),e})(),w=(()=>{class e{constructor(r,s,n){this.$api=r,this.$toastr=s,this.$router=n}resolve(r,s){return this.$api.get("/platform-tools/docker/startup-script").toPromise().catch(n=>{this.$toastr.error(n.message,"Failed to Load Startup Script"),this.$router.navigate(["/"])})}}return e.\u0275fac=function(r){return new(r||e)(t.LFG(h.s),t.LFG(m._W),t.LFG(p.F0))},e.\u0275prov=t.Yz7({token:e,factory:e.\u0275fac}),e})();const P=[{path:"",redirectTo:"/",pathMatch:"full"},{path:"startup-script",component:b,resolve:{startupScript:w}},{path:"restart-container",component:D}];let U=(()=>{class e{}return e.\u0275fac=function(r){return new(r||e)},e.\u0275mod=t.oAB({type:e}),e.\u0275inj=t.cJS({imports:[[p.Bz.forChild(P)],p.Bz]}),e})(),V=(()=>{class e{}return e.\u0275fac=function(r){return new(r||e)},e.\u0275mod=t.oAB({type:e}),e.\u0275inj=t.cJS({providers:[w],imports:[[u.ez,l.u5,l.UX,v.nm,x.IJ,c.aw.forChild(),S.I,U]]}),e})()}}]);
package/public/index.html CHANGED
@@ -19,6 +19,6 @@
19
19
 
20
20
  <body class="body-top-padding">
21
21
  <app-root></app-root>
22
- <script src="runtime.6de2d37dcefdbb14.js" type="module" crossorigin="use-credentials"></script><script src="polyfills.d9ad7e29a50a82c7.js" type="module" crossorigin="use-credentials"></script><script src="scripts.1468d9526efd03e7.js" defer crossorigin="use-credentials"></script><script src="main.6210cf0d23d7d81f.js" type="module" crossorigin="use-credentials"></script>
22
+ <script src="runtime.b5c73a698613bf4a.js" type="module" crossorigin="use-credentials"></script><script src="polyfills.d9ad7e29a50a82c7.js" type="module" crossorigin="use-credentials"></script><script src="scripts.1468d9526efd03e7.js" defer crossorigin="use-credentials"></script><script src="main.a482f9c8800b8be6.js" type="module" crossorigin="use-credentials"></script>
23
23
 
24
24
  </body></html>