homebridge-config-ui-x 5.0.0-beta.21 → 5.0.0-beta.22
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/CHANGELOG.md +3 -1
- package/package.json +1 -1
- package/public/chunk-2G26F2OY.js +1 -0
- package/public/{chunk-B5VI2Y6M.js → chunk-2HOZ3Y6C.js} +1 -1
- package/public/{chunk-C4QSWDVR.js → chunk-2JYMQLNI.js} +1 -1
- package/public/chunk-2Q3ZJBWD.js +1 -0
- package/public/{chunk-VR52TTMY.js → chunk-2QRN7P6W.js} +1 -1
- package/public/{chunk-SZD4AWYF.js → chunk-3VDXR5B2.js} +1 -1
- package/public/{chunk-DKO4HAIB.js → chunk-4J45MC2M.js} +1 -1
- package/public/{chunk-NQVVIP7W.js → chunk-4XUM4AAX.js} +1 -1
- package/public/{chunk-NPPEMRCU.js → chunk-5U265P7U.js} +1 -1
- package/public/{chunk-CTN2DQV5.js → chunk-66TZYBOD.js} +1 -1
- package/public/{chunk-ADKE5LJF.js → chunk-75MRNSXS.js} +1 -1
- package/public/chunk-76R6FK4N.js +1 -0
- package/public/{chunk-IDHLJZZJ.js → chunk-77MKNJZD.js} +1 -1
- package/public/{chunk-O2KNAZ5T.js → chunk-7TYZZBWX.js} +1 -1
- package/public/{chunk-FRTATUBX.js → chunk-7YINJGU5.js} +1 -1
- package/public/{chunk-ZNOZDCL3.js → chunk-A5DGQCNW.js} +1 -1
- package/public/{chunk-SEGRKPCL.js → chunk-A5ZYGUPQ.js} +1 -1
- package/public/{chunk-WDTCTPKS.js → chunk-A7JPIFDI.js} +1 -1
- package/public/chunk-AOMI4P34.js +1 -0
- package/public/{chunk-XKJ6VGZO.js → chunk-AWR7QC6L.js} +1 -1
- package/public/{chunk-FWQXO3EP.js → chunk-BGVO4RUG.js} +1 -1
- package/public/{chunk-3TJ2GE2Y.js → chunk-BPBMT7G5.js} +1 -1
- package/public/{chunk-3O26TYAX.js → chunk-CATV74VT.js} +1 -1
- package/public/chunk-CCREQ443.js +1 -0
- package/public/{chunk-NNKBGNWL.js → chunk-DQ6WFEV3.js} +1 -1
- package/public/{chunk-MDOAXUID.js → chunk-EH7W2CXP.js} +1 -1
- package/public/{chunk-BIXO3U6C.js → chunk-F37DFFAF.js} +1 -1
- package/public/{chunk-E5FZHVEC.js → chunk-G4YIZM2X.js} +1 -1
- package/public/{chunk-6VXGO53S.js → chunk-GG777Z5B.js} +1 -1
- package/public/{chunk-ZQQS75SA.js → chunk-GGXW7MGP.js} +1 -1
- package/public/chunk-GZ4RCRCW.js +1 -0
- package/public/chunk-HCPQDE4Y.js +1 -0
- package/public/{chunk-UIX722MQ.js → chunk-HGKURYNB.js} +1 -1
- package/public/chunk-HH7AWBSM.js +1 -0
- package/public/{chunk-EA6RKP5G.js → chunk-HMGLHQQM.js} +1 -1
- package/public/{chunk-5LT65NDZ.js → chunk-IQ2VQFLN.js} +1 -1
- package/public/{chunk-QAG66PLL.js → chunk-JN3IG5XN.js} +1 -1
- package/public/chunk-JXLK34BL.js +1 -0
- package/public/{chunk-3TW227A7.js → chunk-KJTNT2RS.js} +1 -1
- package/public/chunk-LAYV53FZ.js +1 -0
- package/public/{chunk-UC6G6EJI.js → chunk-LRBNS4GA.js} +1 -1
- package/public/{chunk-I5SM3GCQ.js → chunk-LY2KRV55.js} +1 -1
- package/public/{chunk-2DAPKUN5.js → chunk-NHYJBJ7V.js} +1 -1
- package/public/{chunk-O2BHQ2WA.js → chunk-NSDKR2DD.js} +1 -1
- package/public/{chunk-4JS645EV.js → chunk-OAKLLAD6.js} +1 -1
- package/public/{chunk-3Z6U5O5M.js → chunk-PFCIYPDO.js} +1 -1
- package/public/{chunk-P4FORPUA.js → chunk-Q5X32EHZ.js} +1 -1
- package/public/chunk-QCBEADHI.js +1 -0
- package/public/chunk-R5PFZZHR.js +1 -0
- package/public/{chunk-DCVY3IA2.js → chunk-RSUIRNXB.js} +1 -1
- package/public/{chunk-XK4344ZY.js → chunk-RUC7TPCB.js} +1 -1
- package/public/{chunk-62UMOIOG.js → chunk-SHFHQWOE.js} +1 -1
- package/public/{chunk-N2HZUJ5D.js → chunk-TC25IMJX.js} +1 -1
- package/public/{chunk-VPMXTLP5.js → chunk-UZZFYFXN.js} +1 -1
- package/public/chunk-VQ5OLP5R.js +1 -0
- package/public/{chunk-GMU4IJBT.js → chunk-W463PPSI.js} +1 -1
- package/public/{chunk-3HQDWIYS.js → chunk-W5XD4G3A.js} +1 -1
- package/public/{chunk-XB3CBRQE.js → chunk-XIOY5AEA.js} +1 -1
- package/public/{chunk-KMGDOXVO.js → chunk-ZXAV3M77.js} +1 -1
- package/public/index.html +1 -1
- package/public/main-JEWXJ5EM.js +1 -0
- package/public/chunk-32ESUCGF.js +0 -1
- package/public/chunk-3U5HE6LL.js +0 -1
- package/public/chunk-6UMPRFLK.js +0 -1
- package/public/chunk-EAYDVYFZ.js +0 -1
- package/public/chunk-JZGR3WU5.js +0 -1
- package/public/chunk-KUG6OIB5.js +0 -1
- package/public/chunk-MVS2OMCO.js +0 -1
- package/public/chunk-MXPZGRWK.js +0 -1
- package/public/chunk-OVGWWGKD.js +0 -1
- package/public/chunk-REILQUGC.js +0 -1
- package/public/chunk-TFLT3S56.js +0 -1
- package/public/chunk-Z2EXMZJ3.js +0 -1
- package/public/chunk-ZA2VSVJA.js +0 -1
- package/public/main-XV4IWRJF.js +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -25,6 +25,7 @@ If you have a plugin which can be configured multiple times, then an icon will b
|
|
|
25
25
|
|
|
26
26
|
For custom UIs developed using the `@homebridge/plugin-ui-utils` package, the `Save` button will be enabled at all times by default.
|
|
27
27
|
In `@homebridge/plugin-ui-utils@v2.0.0`, two new methods have been added which allow you to disable and enable the `Save` button:
|
|
28
|
+
|
|
28
29
|
- `homebridge.disableSaveButton()`
|
|
29
30
|
- `homebridge.enableSaveButton()`
|
|
30
31
|
|
|
@@ -57,7 +58,6 @@ Plugin developers:
|
|
|
57
58
|
- update node pty beta `v0.12.0-beta`
|
|
58
59
|
- update angular from `v18` to `v19`
|
|
59
60
|
- improvements to GH actions and build processes (@NorthernMan54)
|
|
60
|
-
- fix attach artifacts to release workflow
|
|
61
61
|
|
|
62
62
|
### Homebridge Dependencies
|
|
63
63
|
|
|
@@ -70,11 +70,13 @@ Plugin developers:
|
|
|
70
70
|
### UI Changes
|
|
71
71
|
|
|
72
72
|
- updates to the `th.json` language file (#2271) (@tomzt)
|
|
73
|
+
- updates to the `de.json` language file (#2250) (@Staubgeborener)
|
|
73
74
|
- Remove unrelated plugins from search (#2272) (@justjam2013)
|
|
74
75
|
|
|
75
76
|
### Other Changes
|
|
76
77
|
|
|
77
78
|
- fix types + update dependencies
|
|
79
|
+
- fix attach artifacts to release workflow
|
|
78
80
|
|
|
79
81
|
### Homebridge Dependencies
|
|
80
82
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "homebridge-config-ui-x",
|
|
3
3
|
"displayName": "Homebridge UI",
|
|
4
|
-
"version": "5.0.0-beta.
|
|
4
|
+
"version": "5.0.0-beta.22",
|
|
5
5
|
"description": "A web based management, configuration and control platform for Homebridge.",
|
|
6
6
|
"author": "oznu <dev@oz.nu>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{e as a}from"./chunk-GGXW7MGP.js";import"./chunk-P5WCYSBI.js";import"./chunk-F5SS6TN7.js";import"./chunk-Z4CHNCHA.js";import"./chunk-HMOW3VNR.js";import"./chunk-3VDXR5B2.js";import"./chunk-4J45MC2M.js";import"./chunk-OAKLLAD6.js";import"./chunk-QHHRJOCD.js";import"./chunk-H3E4T6KH.js";import"./chunk-KDJPDALB.js";export{a as UsersComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as V}from"./chunk-F5SS6TN7.js";import{d as O}from"./chunk-HMOW3VNR.js";import{b as P}from"./chunk-
|
|
1
|
+
import{o as V}from"./chunk-F5SS6TN7.js";import{d as O}from"./chunk-HMOW3VNR.js";import{b as P}from"./chunk-4J45MC2M.js";import{b as k,j as T}from"./chunk-OAKLLAD6.js";import{a as y,b as $}from"./chunk-H3E4T6KH.js";import{$b as v,Bb as g,Bc as a,Cc as s,Mb as C,Rb as f,Wb as o,Xb as r,Yb as h,cc as m,dc as b,ib as i,na as c,nc as l,oc as S,pc as d,ub as w,xa as u,ya as _}from"./chunk-KDJPDALB.js";function B(t,x){if(t&1){let n=v();o(0,"p",5)(1,"button",6),m("click",function(){u(n);let e=b();return _(e.restartServer())}),l(2),a(3,"translate"),r()()}t&2&&(i(2),d(" ",s(3,1,"menu.linux.label_restart_server")," "))}function I(t,x){if(t&1){let n=v();o(0,"p",5)(1,"button",6),m("click",function(){u(n);let e=b();return _(e.shutdownServer())}),l(2),a(3,"translate"),r()()}t&2&&(i(2),d(" ",s(3,1,"menu.linux.label_shutdown_server")," "))}function H(t,x){if(t&1){let n=v();o(0,"p",5)(1,"button",6),m("click",function(){u(n);let e=b();return _(e.dockerRestartContainer())}),l(2),a(3,"translate"),r()()}t&2&&(i(2),d(" ",s(3,1,"menu.docker.restart_container")," "))}var G=(()=>{class t{$api=c(k);$router=c(O);$settings=c(P);$toastr=c(T);$translate=c(y);restartHomebridge(){this.$router.navigate(["/restart"])}restartHomebridgeService(){this.$api.put("/platform-tools/hb-service/set-full-service-restart-flag",{}).subscribe({next:()=>{this.$router.navigate(["/restart"])},error:n=>{console.error(n),this.$toastr.error(n.message,this.$translate.instant("toast.title_error"))}})}restartServer(){this.$router.navigate(["/platform-tools/linux/restart-server"])}shutdownServer(){this.$router.navigate(["/platform-tools/linux/shutdown-server"])}dockerRestartContainer(){this.$router.navigate(["/platform-tools/docker/restart-container"])}static \u0275fac=function(p){return new(p||t)};static \u0275cmp=w({type:t,selectors:[["ng-component"]],decls:19,vars:15,consts:[[1,"d-flex","justify-content-between"],[1,"primary-text","m-0"],[1,"my-4","align-items-center",2,"max-width","1000px","margin","auto"],[1,"w-100","text-center","primary-text","mb-5"],[1,"fas","fa-fw","fa-power-off",2,"font-size","75px"],[1,"w-100","text-center","my-5"],["type","button",1,"btn","btn-primary","p-3","my-0",2,"width","85%",3,"click"],["type","button","container","body","openDelay","150","triggers","hover",1,"btn","btn-primary","p-3","my-0",2,"width","85%",3,"click","ngbTooltip"]],template:function(p,e){p&1&&(o(0,"div",0)(1,"h3",1),l(2),a(3,"translate"),r()(),o(4,"div",2)(5,"div",3),h(6,"i",4),r(),o(7,"p",5)(8,"button",6),m("click",function(){return e.restartHomebridge()}),l(9),a(10,"translate"),r()(),o(11,"p",5)(12,"button",7),a(13,"translate"),m("click",function(){return e.restartHomebridgeService()}),l(14),a(15,"translate"),r()(),g(16,B,4,3,"p",5)(17,I,4,3,"p",5)(18,H,4,3,"p",5),r()),p&2&&(i(2),S(s(3,7,"menu.restart.title")),i(7),d(" ",s(10,9,"menu.hbrestart.confirm_hb")," "),i(3),C("ngbTooltip",s(13,11,"reset.force_restart_hb_help_text")),i(2),d(" ",s(15,13,"menu.hbrestart.confirm_ui")," "),i(2),f(e.$settings.env.canShutdownRestartHost?16:-1),i(),f(e.$settings.env.canShutdownRestartHost?17:-1),i(),f(e.$settings.env.runningInDocker?18:-1))},dependencies:[V,$],encapsulation:2})}return t})();export{G as a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as U}from"./chunk-T6FYP7FJ.js";import{a as S,b as O}from"./chunk-F4QKTMKG.js";import{a as g}from"./chunk-
|
|
1
|
+
import{a as U}from"./chunk-T6FYP7FJ.js";import{a as S,b as O}from"./chunk-F4QKTMKG.js";import{a as g}from"./chunk-LY2KRV55.js";import{M as w,e as x,g as h,ha as E,n as R,na as L}from"./chunk-KDJPDALB.js";var F=x((v,b)=>{(function(a,l){typeof define=="function"&&define.amd?define([],l):typeof v<"u"?l():(l(),a.FileSaver={})})(v,function(){"use strict";function a(e,t){return typeof t>"u"?t={autoBom:!1}:typeof t!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),t={autoBom:!t}),t.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob(["\uFEFF",e],{type:e.type}):e}function l(e,t,n){var i=new XMLHttpRequest;i.open("GET",e),i.responseType="blob",i.onload=function(){r(i.response,t,n)},i.onerror=function(){console.error("could not download file")},i.send()}function d(e){var t=new XMLHttpRequest;t.open("HEAD",e,!1);try{t.send()}catch{}return 200<=t.status&&299>=t.status}function c(e){try{e.dispatchEvent(new MouseEvent("click"))}catch{var t=document.createEvent("MouseEvents");t.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(t)}}var s=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof global=="object"&&global.global===global?global:void 0,m=s.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),r=s.saveAs||(typeof window!="object"||window!==s?function(){}:"download"in HTMLAnchorElement.prototype&&!m?function(e,t,n){var i=s.URL||s.webkitURL,o=document.createElement("a");t=t||e.name||"download",o.download=t,o.rel="noopener",typeof e=="string"?(o.href=e,o.origin===location.origin?c(o):d(o.href)?l(e,t,n):c(o,o.target="_blank")):(o.href=i.createObjectURL(e),setTimeout(function(){i.revokeObjectURL(o.href)},4e4),setTimeout(function(){c(o)},0))}:"msSaveOrOpenBlob"in navigator?function(e,t,n){if(t=t||e.name||"download",typeof e!="string")navigator.msSaveOrOpenBlob(a(e,n),t);else if(d(e))l(e,t,n);else{var i=document.createElement("a");i.href=e,i.target="_blank",setTimeout(function(){c(i)})}}:function(e,t,n,i){if(i=i||open("","_blank"),i&&(i.document.title=i.document.body.innerText="downloading..."),typeof e=="string")return l(e,t,n);var o=e.type==="application/octet-stream",z=/constructor/i.test(s.HTMLElement)||s.safari,y=/CriOS\/[\d]+/.test(navigator.userAgent);if((y||o&&z||m)&&typeof FileReader<"u"){var u=new FileReader;u.onloadend=function(){var f=u.result;f=y?f:f.replace(/^data:[^;]*;/,"data:attachment/file;"),i?i.location.href=f:location=f,i=null},u.readAsDataURL(e)}else{var A=s.URL||s.webkitURL,p=A.createObjectURL(e);i?i.location=p:location.href=p,i=null,setTimeout(function(){A.revokeObjectURL(p)},4e4)}});s.saveAs=r.saveAs=r,typeof b<"u"&&(b.exports=r)})});var k=h(S(),1),j=h(O(),1),T=h(U(),1);var W=(()=>{class a{$ws=L(g);term;io;fitAddon;webLinksAddon;resize;elementResize;pluginName;startTerminal(d,c={},s,m){this.pluginName=m,this.elementResize=s,this.io=this.$ws.connectToNamespace("log"),this.term=new k.Terminal(c),setTimeout(()=>{this.term.loadAddon(this.fitAddon),this.term.loadAddon(this.webLinksAddon)}),this.fitAddon=new j.FitAddon,this.webLinksAddon=new T.WebLinksAddon,this.resize=new R,this.term.open(d.nativeElement),setTimeout(()=>{this.fitAddon.activate(this.term),this.fitAddon.fit()}),this.io.connected.subscribe(()=>{this.term.reset(),this.io.socket.emit("tail-log",{cols:this.term.cols,rows:this.term.rows})}),this.io.socket.on("disconnect",()=>{this.term.write(`
|
|
2
2
|
\r
|
|
3
3
|
\rWebsocket failed to connect. Is the server running?
|
|
4
4
|
\r
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a}from"./chunk-2QRN7P6W.js";import"./chunk-MMPQXC6H.js";import"./chunk-BZVO3JIQ.js";import"./chunk-Z4CHNCHA.js";import"./chunk-HMOW3VNR.js";import"./chunk-4J45MC2M.js";import"./chunk-OAKLLAD6.js";import"./chunk-QHHRJOCD.js";import"./chunk-H3E4T6KH.js";import"./chunk-KDJPDALB.js";export{a as StartupScriptComponent};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as O}from"./chunk-MMPQXC6H.js";import{a as L}from"./chunk-BZVO3JIQ.js";import{c as P,e as I,l as D,y as H}from"./chunk-Z4CHNCHA.js";import{b as T}from"./chunk-HMOW3VNR.js";import{b as $}from"./chunk-
|
|
1
|
+
import{a as O}from"./chunk-MMPQXC6H.js";import{a as L}from"./chunk-BZVO3JIQ.js";import{c as P,e as I,l as D,y as H}from"./chunk-Z4CHNCHA.js";import{b as T}from"./chunk-HMOW3VNR.js";import{b as $}from"./chunk-4J45MC2M.js";import{b as y,j as k}from"./chunk-OAKLLAD6.js";import{a as E}from"./chunk-H3E4T6KH.js";import{$b as g,Bb as h,Mb as f,Rb as d,Wb as m,Xb as l,Yb as w,cc as _,dc as a,h as S,ib as s,na as r,nc as v,sc as b,tc as M,ub as x,uc as V,w as C,xa as c,ya as p}from"./chunk-KDJPDALB.js";function z(i,u){i&1&&w(0,"i",6)}function A(i,u){i&1&&w(0,"i",7)}function F(i,u){if(i&1){let t=g();m(0,"ngx-monaco-editor",10),_("onInit",function(e){c(t);let o=a();return p(o.onEditorInit(e))})("keydown.control.s",function(e){c(t);let o=a();return e.preventDefault(),p(o.onSave())})("keydown.meta.s",function(e){c(t);let o=a();return e.preventDefault(),p(o.onSave())}),l()}if(i&2){let t=a();f("options",t.editorOptions)("model",t.monacoEditorModel)}}function W(i,u){if(i&1){let t=g();m(0,"textarea",11),V("ngModelChange",function(e){c(t);let o=a();return M(o.startupScript,e)||(o.startupScript=e),p(e)}),v(1," "),l()}if(i&2){let t=a();b("ngModel",t.startupScript)}}var tt=(()=>{class i{$api=r(y);$md=r(L);$route=r(T);$settings=r($);$toastr=r(k);$translate=r(E);startupScript;saveInProgress;isMobile=!1;options={printMargin:!1};monacoEditor;editorOptions;monacoEditorModel;lastHeight;visualViewPortEventCallback;constructor(){this.isMobile=this.$md.detect.mobile()}ngOnInit(){this.editorOptions={language:"shell",theme:this.$settings.actualLightingMode==="dark"?"vs-dark":"vs-light",automaticLayout:!0},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(t=>{this.startupScript=t.startupScript.script}),this.monacoEditorModel={value:"",language:"shell"}}onEditorInit(t){this.monacoEditor=t,this.monacoEditor.getModel().setValue(this.startupScript)}onSave(){return S(this,null,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(`
|
|
2
2
|
`)[0].trim())){this.$toastr.error(this.$translate.instant("platform.docker.must_use_hashbang"),this.$translate.instant("toast.title_error")),this.startupScript=`#!/bin/sh
|
|
3
3
|
|
|
4
4
|
${this.startupScript}`,this.isMobile||this.monacoEditor.getModel().setValue(this.startupScript),this.saveInProgress=!1;return}try{yield C(this.$api.put("/platform-tools/docker/startup-script",{script:this.startupScript})),this.$toastr.success(this.$translate.instant("platform.docker.restart_required"),this.$translate.instant("platform.docker.script_saved"))}catch(t){console.error(t),this.$toastr.error(t.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()}static \u0275fac=function(n){return new(n||i)};static \u0275cmp=x({type:i,selectors:[["ng-component"]],decls:11,vars:5,consts:[[1,"flex-column","d-flex","align-items-stretch","h-100"],[1,"row","mb-3"],[1,"col-6"],[1,"primary-text","m-0","text-monospace"],[1,"col-6","text-right"],[1,"btn","btn-primary","waves-effect","m-0",3,"click","disabled"],[1,"fas","fa-fw","fa-floppy-disk"],[1,"fas","fa-fw","fa-spinner","fa-pulse"],[1,"flex-grow-1","h-100","w-100","my-2",3,"options","model"],["wrap","off","autocomplete","off","autocorrect","off","autocapitalize","off","spellcheck","false",1,"hb-plain-text-editor","align-self-end","h-100","w-100","my-2",3,"ngModel"],[1,"flex-grow-1","h-100","w-100","my-2",3,"onInit","keydown.control.s","keydown.meta.s","options","model"],["wrap","off","autocomplete","off","autocorrect","off","autocapitalize","off","spellcheck","false",1,"hb-plain-text-editor","align-self-end","h-100","w-100","my-2",3,"ngModelChange","ngModel"]],template:function(n,e){n&1&&(m(0,"div",0)(1,"div",1)(2,"div",2)(3,"h3",3),v(4,"startup.sh"),l()(),m(5,"div",4)(6,"button",5),_("click",function(){return e.onSave()}),h(7,z,1,0,"i",6)(8,A,1,0,"i",7),l()()(),h(9,F,1,2,"ngx-monaco-editor",8)(10,W,2,1,"textarea",9),l()),n&2&&(s(6),f("disabled",e.saveInProgress),s(),d(e.saveInProgress?-1:7),s(),d(e.saveInProgress?8:-1),s(),d(e.isMobile?-1:9),s(),d(e.isMobile?10:-1))},dependencies:[O,H,P,I,D],encapsulation:2})}return i})();export{tt as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as _,b as D}from"./chunk-
|
|
1
|
+
import{a as _,b as D}from"./chunk-4J45MC2M.js";import{a as l,b as S}from"./chunk-OAKLLAD6.js";import{f as x}from"./chunk-QHHRJOCD.js";import{C as v,Sc as I,g as O,h as a,ha as h,ia as E,ka as y,ma as c,na as f,r as p,vb as j,w as d,x as T,z as w}from"./chunk-KDJPDALB.js";var g=new y("JWT_OPTIONS"),m=(()=>{class r{constructor(e=null){this.tokenGetter=e&&e.tokenGetter||function(){}}urlBase64Decode(e){let t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:{t+="==";break}case 3:{t+="=";break}default:throw new Error("Illegal base64url string!")}return this.b64DecodeUnicode(t)}b64decode(e){let t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",o="";if(e=String(e).replace(/=+$/,""),e.length%4===1)throw new Error("'atob' failed: The string to be decoded is not correctly encoded.");for(let i=0,s,n,b=0;n=e.charAt(b++);~n&&(s=i%4?s*64+n:n,i++%4)?o+=String.fromCharCode(255&s>>(-2*i&6)):0)n=t.indexOf(n);return o}b64DecodeUnicode(e){return decodeURIComponent(Array.prototype.map.call(this.b64decode(e),t=>"%"+("00"+t.charCodeAt(0).toString(16)).slice(-2)).join(""))}decodeToken(e=this.tokenGetter()){return e instanceof Promise?e.then(t=>this._decodeToken(t)):this._decodeToken(e)}_decodeToken(e){if(!e||e==="")return null;let t=e.split(".");if(t.length!==3)throw new Error("The inspected token doesn't appear to be a JWT. Check to make sure it has three parts and see https://jwt.io for more.");let o=this.urlBase64Decode(t[1]);if(!o)throw new Error("Cannot decode the token.");return JSON.parse(o)}getTokenExpirationDate(e=this.tokenGetter()){return e instanceof Promise?e.then(t=>this._getTokenExpirationDate(t)):this._getTokenExpirationDate(e)}_getTokenExpirationDate(e){let t;if(t=this.decodeToken(e),!t||!t.hasOwnProperty("exp"))return null;let o=new Date(0);return o.setUTCSeconds(t.exp),o}isTokenExpired(e=this.tokenGetter(),t){return e instanceof Promise?e.then(o=>this._isTokenExpired(o,t)):this._isTokenExpired(e,t)}_isTokenExpired(e,t){if(!e||e==="")return!0;let o=this.getTokenExpirationDate(e);return t=t||0,o===null?!1:!(o.valueOf()>new Date().valueOf()+t*1e3)}getAuthScheme(e,t){return typeof e=="function"?e(t):e}}return r.\u0275fac=function(e){return new(e||r)(c(g))},r.\u0275prov=h({token:r,factory:r.\u0275fac}),r})(),$=r=>r instanceof Promise?v(()=>r):p(r),R=(()=>{class r{constructor(e,t,o){this.jwtHelper=t,this.document=o,this.standardPorts=["80","443"],this.tokenGetter=e.tokenGetter,this.headerName=e.headerName||"Authorization",this.authScheme=e.authScheme||e.authScheme===""?e.authScheme:"Bearer ",this.allowedDomains=e.allowedDomains||[],this.disallowedRoutes=e.disallowedRoutes||[],this.throwNoTokenError=e.throwNoTokenError||!1,this.skipWhenExpired=e.skipWhenExpired}isAllowedDomain(e){let t=new URL(e.url,this.document.location.origin);if(t.host===this.document.location.host)return!0;let o=`${t.hostname}${t.port&&!this.standardPorts.includes(t.port)?":"+t.port:""}`;return this.allowedDomains.findIndex(i=>typeof i=="string"?i===o:i instanceof RegExp?i.test(o):!1)>-1}isDisallowedRoute(e){let t=new URL(e.url,this.document.location.origin);return this.disallowedRoutes.findIndex(o=>{if(typeof o=="string"){let i=new URL(o,this.document.location.origin);return i.hostname===t.hostname&&i.pathname===t.pathname}return o instanceof RegExp?o.test(e.url):!1})>-1}handleInterception(e,t,o){let i=this.jwtHelper.getAuthScheme(this.authScheme,t);if(!e&&this.throwNoTokenError)throw new Error("Could not get token from tokenGetter function.");let s=p(!1);return this.skipWhenExpired&&(s=e?$(this.jwtHelper.isTokenExpired(e)):p(!0)),e?s.pipe(T(n=>n&&this.skipWhenExpired?t.clone():t.clone({setHeaders:{[this.headerName]:`${i}${e}`}})),w(n=>o.handle(n))):o.handle(t)}intercept(e,t){if(!this.isAllowedDomain(e)||this.isDisallowedRoute(e))return t.handle(e);let o=this.tokenGetter(e);return $(o).pipe(w(i=>this.handleInterception(i,e,t)))}}return r.\u0275fac=function(e){return new(e||r)(c(g),c(m),c(I))},r.\u0275prov=h({token:r,factory:r.\u0275fac}),r})(),F=(()=>{class r{constructor(e){if(e)throw new Error("JwtModule is already loaded. It should only be imported in your application's main module.")}static forRoot(e){return{ngModule:r,providers:[{provide:x,useClass:R,multi:!0},e.jwtOptionsProvider||{provide:g,useValue:e.config},m]}}}return r.\u0275fac=function(e){return new(e||r)(c(r,12))},r.\u0275mod=j({type:r}),r.\u0275inj=E({}),r})();var k=O(_(),1);var q=(()=>{class r{$api=f(S);$jwtHelper=f(m);$settings=f(D);token;user={};logoutTimer;constructor(){this.loadToken()}login(e){return a(this,null,function*(){let t=yield d(this.$api.post("/auth/login",e));if(!this.validateToken(t.access_token))throw new Error("Invalid username or password.");window.localStorage.setItem(l.jwt.tokenKey,t.access_token),yield this.$settings.getAppSettings()})}noauth(){return a(this,null,function*(){let e=yield d(this.$api.post("/auth/noauth",{}));if(this.validateToken(e.access_token))window.localStorage.setItem(l.jwt.tokenKey,e.access_token),yield this.$settings.getAppSettings();else throw new Error("Invalid username or password.")})}logout(){this.user=null,this.token=null,window.localStorage.removeItem(l.jwt.tokenKey),window.location.reload()}loadToken(){return a(this,null,function*(){this.$settings.settingsLoaded||(yield d(this.$settings.onSettingsLoaded));let e=window.localStorage.getItem(l.jwt.tokenKey);e&&this.validateToken(e)})}validateToken(e){try{return this.$jwtHelper.isTokenExpired(e,this.$settings.serverTimeOffset)&&this.logout(),this.user=this.$jwtHelper.decodeToken(e),this.token=e,this.setLogoutTimer(),!0}catch{return window.localStorage.removeItem(l.jwt.tokenKey),this.token=null,!1}}checkToken(){return a(this,null,function*(){try{return yield d(this.$api.get("/auth/check"))}catch(e){e.status===401&&(console.error("Current token is not valid"),this.logout())}})}setLogoutTimer(){if(clearTimeout(this.logoutTimer),!this.$jwtHelper.isTokenExpired(this.token,this.$settings.serverTimeOffset)){let t=(0,k.default)(this.$jwtHelper.getTokenExpirationDate(this.token)).diff((0,k.default)().add(this.$settings.serverTimeOffset,"s"),"millisecond");t<=2147483647&&(this.logoutTimer=setTimeout(()=>a(this,null,function*(){this.$settings.formAuth===!1?(yield this.noauth(),window.location.reload()):this.logout()}),t))}}isLoggedIn(){return this.$settings.env.instanceId!==this.user.instanceId?(console.error("Token does not match instance"),!1):this.user&&this.token&&!this.$jwtHelper.isTokenExpired(this.token,this.$settings.serverTimeOffset)}static \u0275fac=function(t){return new(t||r)};static \u0275prov=h({token:r,factory:r.\u0275fac})}return r})();export{m as a,F as b,q as c};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as X,j as it}from"./chunk-
|
|
1
|
+
import{b as X,j as it}from"./chunk-OAKLLAD6.js";import{l as tt}from"./chunk-QHHRJOCD.js";import{a as et}from"./chunk-H3E4T6KH.js";import{U as K,e as ut,g as ct,h as P,ha as R,n as Q,na as Y,w as G}from"./chunk-KDJPDALB.js";var nt=ut((N,J)=>{(function(p,b){typeof N=="object"&&typeof J<"u"?J.exports=b():typeof define=="function"&&define.amd?define(b):(p=typeof globalThis<"u"?globalThis:p||self).dayjs=b()})(N,function(){"use strict";var p=1e3,b=6e4,o=36e5,f="millisecond",v="second",L="minute",O="hour",y="day",W="week",M="month",q="quarter",S="year",_="date",z="Invalid Date",rt=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,st=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,at={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(r){var i=["th","st","nd","rd"],t=r%100;return"["+r+(i[(t-20)%10]||i[t]||i[0])+"]"}},F=function(r,i,t){var n=String(r);return!n||n.length>=i?r:""+Array(i+1-n.length).join(t)+r},ot={s:F,z:function(r){var i=-r.utcOffset(),t=Math.abs(i),n=Math.floor(t/60),e=t%60;return(i<=0?"+":"-")+F(n,2,"0")+":"+F(e,2,"0")},m:function r(i,t){if(i.date()<t.date())return-r(t,i);var n=12*(t.year()-i.year())+(t.month()-i.month()),e=i.clone().add(n,M),s=t-e<0,a=i.clone().add(n+(s?-1:1),M);return+(-(n+(t-e)/(s?e-a:a-e))||0)},a:function(r){return r<0?Math.ceil(r)||0:Math.floor(r)},p:function(r){return{M,y:S,w:W,d:y,D:_,h:O,m:L,s:v,ms:f,Q:q}[r]||String(r||"").toLowerCase().replace(/s$/,"")},u:function(r){return r===void 0}},x="en",D={};D[x]=at;var B="$isDayjsObject",U=function(r){return r instanceof V||!(!r||!r[B])},I=function r(i,t,n){var e;if(!i)return x;if(typeof i=="string"){var s=i.toLowerCase();D[s]&&(e=s),t&&(D[s]=t,e=s);var a=i.split("-");if(!e&&a.length>1)return r(a[0])}else{var c=i.name;D[c]=i,e=c}return!n&&e&&(x=e),e||!n&&x},d=function(r,i){if(U(r))return r.clone();var t=typeof i=="object"?i:{};return t.date=r,t.args=arguments,new V(t)},u=ot;u.l=I,u.i=U,u.w=function(r,i){return d(r,{locale:i.$L,utc:i.$u,x:i.$x,$offset:i.$offset})};var V=function(){function r(t){this.$L=I(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[B]=!0}var i=r.prototype;return i.parse=function(t){this.$d=function(n){var e=n.date,s=n.utc;if(e===null)return new Date(NaN);if(u.u(e))return new Date;if(e instanceof Date)return new Date(e);if(typeof e=="string"&&!/Z$/i.test(e)){var a=e.match(rt);if(a){var c=a[2]-1||0,h=(a[7]||"0").substring(0,3);return s?new Date(Date.UTC(a[1],c,a[3]||1,a[4]||0,a[5]||0,a[6]||0,h)):new Date(a[1],c,a[3]||1,a[4]||0,a[5]||0,a[6]||0,h)}}return new Date(e)}(t),this.init()},i.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},i.$utils=function(){return u},i.isValid=function(){return this.$d.toString()!==z},i.isSame=function(t,n){var e=d(t);return this.startOf(n)<=e&&e<=this.endOf(n)},i.isAfter=function(t,n){return d(t)<this.startOf(n)},i.isBefore=function(t,n){return this.endOf(n)<d(t)},i.$g=function(t,n,e){return u.u(t)?this[n]:this.set(e,t)},i.unix=function(){return Math.floor(this.valueOf()/1e3)},i.valueOf=function(){return this.$d.getTime()},i.startOf=function(t,n){var e=this,s=!!u.u(n)||n,a=u.p(t),c=function(k,m){var w=u.w(e.$u?Date.UTC(e.$y,m,k):new Date(e.$y,m,k),e);return s?w:w.endOf(y)},h=function(k,m){return u.w(e.toDate()[k].apply(e.toDate("s"),(s?[0,0,0,0]:[23,59,59,999]).slice(m)),e)},l=this.$W,g=this.$M,$=this.$D,j="set"+(this.$u?"UTC":"");switch(a){case S:return s?c(1,0):c(31,11);case M:return s?c(1,g):c(0,g+1);case W:var T=this.$locale().weekStart||0,A=(l<T?l+7:l)-T;return c(s?$-A:$+(6-A),g);case y:case _:return h(j+"Hours",0);case O:return h(j+"Minutes",1);case L:return h(j+"Seconds",2);case v:return h(j+"Milliseconds",3);default:return this.clone()}},i.endOf=function(t){return this.startOf(t,!1)},i.$set=function(t,n){var e,s=u.p(t),a="set"+(this.$u?"UTC":""),c=(e={},e[y]=a+"Date",e[_]=a+"Date",e[M]=a+"Month",e[S]=a+"FullYear",e[O]=a+"Hours",e[L]=a+"Minutes",e[v]=a+"Seconds",e[f]=a+"Milliseconds",e)[s],h=s===y?this.$D+(n-this.$W):n;if(s===M||s===S){var l=this.clone().set(_,1);l.$d[c](h),l.init(),this.$d=l.set(_,Math.min(this.$D,l.daysInMonth())).$d}else c&&this.$d[c](h);return this.init(),this},i.set=function(t,n){return this.clone().$set(t,n)},i.get=function(t){return this[u.p(t)]()},i.add=function(t,n){var e,s=this;t=Number(t);var a=u.p(n),c=function(g){var $=d(s);return u.w($.date($.date()+Math.round(g*t)),s)};if(a===M)return this.set(M,this.$M+t);if(a===S)return this.set(S,this.$y+t);if(a===y)return c(1);if(a===W)return c(7);var h=(e={},e[L]=b,e[O]=o,e[v]=p,e)[a]||1,l=this.$d.getTime()+t*h;return u.w(l,this)},i.subtract=function(t,n){return this.add(-1*t,n)},i.format=function(t){var n=this,e=this.$locale();if(!this.isValid())return e.invalidDate||z;var s=t||"YYYY-MM-DDTHH:mm:ssZ",a=u.z(this),c=this.$H,h=this.$m,l=this.$M,g=e.weekdays,$=e.months,j=e.meridiem,T=function(m,w,H,C){return m&&(m[w]||m(n,s))||H[w].slice(0,C)},A=function(m){return u.s(c%12||12,m,"0")},k=j||function(m,w,H){var C=m<12?"AM":"PM";return H?C.toLowerCase():C};return s.replace(st,function(m,w){return w||function(H){switch(H){case"YY":return String(n.$y).slice(-2);case"YYYY":return u.s(n.$y,4,"0");case"M":return l+1;case"MM":return u.s(l+1,2,"0");case"MMM":return T(e.monthsShort,l,$,3);case"MMMM":return T($,l);case"D":return n.$D;case"DD":return u.s(n.$D,2,"0");case"d":return String(n.$W);case"dd":return T(e.weekdaysMin,n.$W,g,2);case"ddd":return T(e.weekdaysShort,n.$W,g,3);case"dddd":return g[n.$W];case"H":return String(c);case"HH":return u.s(c,2,"0");case"h":return A(1);case"hh":return A(2);case"a":return k(c,h,!0);case"A":return k(c,h,!1);case"m":return String(h);case"mm":return u.s(h,2,"0");case"s":return String(n.$s);case"ss":return u.s(n.$s,2,"0");case"SSS":return u.s(n.$ms,3,"0");case"Z":return a}return null}(m)||a.replace(":","")})},i.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},i.diff=function(t,n,e){var s,a=this,c=u.p(n),h=d(t),l=(h.utcOffset()-this.utcOffset())*b,g=this-h,$=function(){return u.m(a,h)};switch(c){case S:s=$()/12;break;case M:s=$();break;case q:s=$()/3;break;case W:s=(g-l)/6048e5;break;case y:s=(g-l)/864e5;break;case O:s=g/o;break;case L:s=g/b;break;case v:s=g/p;break;default:s=g}return e?s:u.a(s)},i.daysInMonth=function(){return this.endOf(M).$D},i.$locale=function(){return D[this.$L]},i.locale=function(t,n){if(!t)return this.$L;var e=this.clone(),s=I(t,n,!0);return s&&(e.$L=s),e},i.clone=function(){return u.w(this.$d,this)},i.toDate=function(){return new Date(this.valueOf())},i.toJSON=function(){return this.isValid()?this.toISOString():null},i.toISOString=function(){return this.$d.toISOString()},i.toString=function(){return this.$d.toUTCString()},r}(),E=V.prototype;return d.prototype=E,[["$ms",f],["$s",v],["$m",L],["$H",O],["$W",y],["$M",M],["$y",S],["$D",_]].forEach(function(r){E[r[1]]=function(i){return this.$g(i,r[0],r[1])}}),d.extend=function(r,i){return r.$i||(r(i,V,d),r.$i=!0),d},d.locale=I,d.isDayjs=U,d.unix=function(r){return d(1e3*r)},d.en=D[x],d.Ls=D,d.p={},d})});var Z=ct(nt(),1);var vt=(()=>{class p{$api=Y(X);$title=Y(tt);$toastr=Y(it);$translate=Y(et);env={};formAuth=!0;uiVersion;theme;lightingMode;currentLightingMode;actualLightingMode;browserLightingMode;loginWallpaper;serverTimeOffset=0;themeList=["orange","red","pink","purple","deep-purple","indigo","blue","blue-grey","cyan","green","teal","grey","brown"];rtl=!1;settingsLoadedSubject=new Q;onSettingsLoaded=this.settingsLoadedSubject.pipe(K());settingsLoaded=!1;constructor(){this.getAppSettings()}getAppSettings(){return P(this,null,function*(){let o=yield G(this.$api.get("/auth/settings"));this.formAuth=o.formAuth,this.env=o.env,this.lightingMode=o.lightingMode,this.loginWallpaper=o.loginWallpaper,this.setLightingMode(this.lightingMode,"user"),this.setTheme(o.theme),this.setTitle(this.env.homebridgeInstanceName),this.checkServerTime(o.serverTimestamp),this.setUiVersion(o.env.packageVersion),this.setLang(this.env.lang),this.settingsLoaded=!0,this.settingsLoadedSubject.next(void 0)})}setBrowserLightingMode(o){this.browserLightingMode=o,this.lightingMode==="auto"&&this.setLightingMode(o,"browser")}setLightingMode(o,f){f==="user"&&(this.lightingMode=o),this.currentLightingMode=o,this.actualLightingMode=this.currentLightingMode==="auto"?this.browserLightingMode:this.currentLightingMode,this.theme&&this.setTheme(this.theme)}setTheme(o){(!o||!this.themeList.includes(o))&&(o="orange");let f=window.document.querySelector("body");f.classList.remove(`config-ui-x-${this.theme}`),f.classList.remove(`config-ui-x-dark-mode-${this.theme}`),this.theme=o,this.actualLightingMode==="dark"?(f.classList.add(`config-ui-x-dark-mode-${this.theme}`),f.classList.contains("dark-mode")||f.classList.add("dark-mode")):(f.classList.add(`config-ui-x-${this.theme}`),f.classList.contains("dark-mode")&&f.classList.remove("dark-mode"))}setTitle(o){this.$title.setTitle(o||"Homebridge")}setUiVersion(o){this.uiVersion||(this.uiVersion=o)}setLang(o){o?this.$translate.use(o):o="auto",this.env.lang=o}setEnvItem(o,f){this.env[o]=f}checkServerTime(o){let v=(0,Z.default)(o).diff((0,Z.default)(),"hour");this.serverTimeOffset=v*60*60,(v>=8||v<=-8)&&this.$toastr.warning(this.$translate.instant("settings.datetime.incorrect"),this.$translate.instant("toast.title_warning"),{timeOut:2e4,tapToDismiss:!1}).onTap.subscribe(()=>{window.open("https://homebridge.io/w/JqTFs","_blank")})}static \u0275fac=function(f){return new(f||p)};static \u0275prov=R({token:p,factory:p.\u0275fac,providedIn:"root"})}return p})();export{nt as a,vt as b};
|