homebridge-config-ui-x 5.3.1-beta.3 → 5.3.1-beta.4
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 +1 -0
- package/package.json +2 -2
- package/public/{chunk-DYUM33EN.js → chunk-2ASTUC2A.js} +1 -1
- package/public/{chunk-U5XYL2BO.js → chunk-2HWQ6KHG.js} +1 -1
- package/public/{chunk-VKDJRHZY.js → chunk-4A6CSL44.js} +1 -1
- package/public/{chunk-SYGK6EHI.js → chunk-4BT5P3S7.js} +1 -1
- package/public/{chunk-FNX45IZH.js → chunk-5IPBGNDT.js} +1 -1
- package/public/{chunk-CGDUBD6J.js → chunk-5TBYRNZA.js} +1 -1
- package/public/{chunk-SF5D6YSG.js → chunk-6CY62H2P.js} +1 -1
- package/public/{chunk-ZRCXKKMZ.js → chunk-6EUBYKAI.js} +1 -1
- package/public/{chunk-YI4QATPW.js → chunk-7S6NJPZX.js} +1 -1
- package/public/{chunk-FB6PETJA.js → chunk-AYVCO42T.js} +1 -1
- package/public/{chunk-74QIVJ2V.js → chunk-BRUCYG2A.js} +1 -1
- package/public/{chunk-DHMKGNYS.js → chunk-CKNC2W6H.js} +1 -1
- package/public/{chunk-IEIXQ4U6.js → chunk-CVHFTW22.js} +1 -1
- package/public/{chunk-Y6UXZKQQ.js → chunk-CVPELF37.js} +1 -1
- package/public/{chunk-ROQZGOEV.js → chunk-D4D2Q75G.js} +1 -1
- package/public/{chunk-47WYGTQW.js → chunk-DJNIOQBD.js} +1 -1
- package/public/{chunk-6RMEND2E.js → chunk-EP3VWHAS.js} +1 -1
- package/public/{chunk-SDJFKSDH.js → chunk-EQU6N7DX.js} +1 -1
- package/public/{chunk-D2TGAILK.js → chunk-G5E3635E.js} +1 -1
- package/public/{chunk-FEFJYQDU.js → chunk-I54LK3RD.js} +1 -1
- package/public/{chunk-A4GLYPYV.js → chunk-ICIDM6VK.js} +1 -1
- package/public/{chunk-KYMUO6SS.js → chunk-IMMVMDI5.js} +1 -1
- package/public/{chunk-ONQKUUPK.js → chunk-JHAV43H4.js} +1 -1
- package/public/{chunk-YFCMRIO6.js → chunk-K47XJRH6.js} +1 -1
- package/public/{chunk-4XNWH322.js → chunk-KJJ3NDBI.js} +1 -1
- package/public/{chunk-YPCFX3Y4.js → chunk-KKFRJVVW.js} +1 -1
- package/public/{chunk-NBT55JQ7.js → chunk-LSB7AK6L.js} +1 -1
- package/public/{chunk-WWIN4YJF.js → chunk-M46HRPAE.js} +1 -1
- package/public/{chunk-CVMGTG2D.js → chunk-MJX7JEFB.js} +1 -1
- package/public/{chunk-ITMK5LQY.js → chunk-MMQQ4QC6.js} +1 -1
- package/public/{chunk-RFVWVOQH.js → chunk-MSD72HAO.js} +1 -1
- package/public/{chunk-MHP5QBF7.js → chunk-N4463S2N.js} +1 -1
- package/public/{chunk-5TNYW3WP.js → chunk-NRIJDIAG.js} +1 -1
- package/public/{chunk-DXEG5YSR.js → chunk-OLEYYRXK.js} +1 -1
- package/public/{chunk-2QXV46X3.js → chunk-ONXM2HKU.js} +1 -1
- package/public/{chunk-DE2C3YJM.js → chunk-QUEVYPDC.js} +1 -1
- package/public/{chunk-S7O2I2GS.js → chunk-SAV5QYWS.js} +1 -1
- package/public/{chunk-RUYZ7VX6.js → chunk-TOTCACPH.js} +1 -1
- package/public/{chunk-VZN7HL52.js → chunk-UIEQEFJD.js} +1 -1
- package/public/{chunk-ZPJNPTQD.js → chunk-ULKIQVJV.js} +2 -2
- package/public/{chunk-ORPE3LDX.js → chunk-V5BFAMW2.js} +1 -1
- package/public/chunk-VKNQ2GJV.js +4 -0
- package/public/chunk-VZCAAS2X.js +1 -0
- package/public/{chunk-OQ3ROJBY.js → chunk-X2DAYGMB.js} +1 -1
- package/public/{chunk-JIHXFZYU.js → chunk-XW7XVGOY.js} +1 -1
- package/public/{chunk-7O7CXQC4.js → chunk-YHQD7CVV.js} +1 -1
- package/public/{chunk-WXUXTKSA.js → chunk-YRUIIXOW.js} +1 -1
- package/public/index.html +1 -1
- package/public/main-N6VJJRX6.js +1 -0
- package/public/chunk-B2KYKLOZ.js +0 -4
- package/public/chunk-T7YV3RO6.js +0 -1
- package/public/main-TN5RETI4.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{k as et,n as it}from"./chunk-T7YV3RO6.js";import{a as tt}from"./chunk-CPAHENLQ.js";import{m as X}from"./chunk-RJOGO4M5.js";import{T as G,e as ut,g as ct,ga as R,h as P,la as Y,n as Q,w as N}from"./chunk-WEVBEUAJ.js";var st=ut((J,K)=>{(function(L,k){typeof J=="object"&&typeof K<"u"?K.exports=k():typeof define=="function"&&define.amd?define(k):(L=typeof globalThis<"u"?globalThis:L||self).dayjs=k()})(J,function(){"use strict";var L=1e3,k=6e4,n=36e5,h="millisecond",d="second",l="minute",p="hour",v="day",y="week",S="month",E="quarter",b="year",x="date",Z="Invalid Date",nt=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,rt=/\[([^\]]+)]|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 s=String(r);return!s||s.length>=i?r:""+Array(i+1-s.length).join(t)+r},ot={s:F,z:function(r){var i=-r.utcOffset(),t=Math.abs(i),s=Math.floor(t/60),e=t%60;return(i<=0?"+":"-")+F(s,2,"0")+":"+F(e,2,"0")},m:function r(i,t){if(i.date()<t.date())return-r(t,i);var s=12*(t.year()-i.year())+(t.month()-i.month()),e=i.clone().add(s,S),a=t-e<0,o=i.clone().add(s+(a?-1:1),S);return+(-(s+(t-e)/(a?e-o:o-e))||0)},a:function(r){return r<0?Math.ceil(r)||0:Math.floor(r)},p:function(r){return{M:S,y:b,w:y,d:v,D:x,h:p,m:l,s:d,ms:h,Q:E}[r]||String(r||"").toLowerCase().replace(/s$/,"")},u:function(r){return r===void 0}},A="en",T={};T[A]=at;var z="$isDayjsObject",U=function(r){return r instanceof W||!(!r||!r[z])},V=function r(i,t,s){var e;if(!i)return A;if(typeof i=="string"){var a=i.toLowerCase();T[a]&&(e=a),t&&(T[a]=t,e=a);var o=i.split("-");if(!e&&o.length>1)return r(o[0])}else{var c=i.name;T[c]=i,e=c}return!s&&e&&(A=e),e||!s&&A},m=function(r,i){if(U(r))return r.clone();var t=typeof i=="object"?i:{};return t.date=r,t.args=arguments,new W(t)},u=ot;u.l=V,u.i=U,u.w=function(r,i){return m(r,{locale:i.$L,utc:i.$u,x:i.$x,$offset:i.$offset})};var W=function(){function r(t){this.$L=V(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[z]=!0}var i=r.prototype;return i.parse=function(t){this.$d=function(s){var e=s.date,a=s.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 o=e.match(nt);if(o){var c=o[2]-1||0,f=(o[7]||"0").substring(0,3);return a?new Date(Date.UTC(o[1],c,o[3]||1,o[4]||0,o[5]||0,o[6]||0,f)):new Date(o[1],c,o[3]||1,o[4]||0,o[5]||0,o[6]||0,f)}}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,s){var e=m(t);return this.startOf(s)<=e&&e<=this.endOf(s)},i.isAfter=function(t,s){return m(t)<this.startOf(s)},i.isBefore=function(t,s){return this.endOf(s)<m(t)},i.$g=function(t,s,e){return u.u(t)?this[s]:this.set(e,t)},i.unix=function(){return Math.floor(this.valueOf()/1e3)},i.valueOf=function(){return this.$d.getTime()},i.startOf=function(t,s){var e=this,a=!!u.u(s)||s,o=u.p(t),c=function(_,M){var D=u.w(e.$u?Date.UTC(e.$y,M,_):new Date(e.$y,M,_),e);return a?D:D.endOf(v)},f=function(_,M){return u.w(e.toDate()[_].apply(e.toDate("s"),(a?[0,0,0,0]:[23,59,59,999]).slice(M)),e)},g=this.$W,$=this.$M,w=this.$D,j="set"+(this.$u?"UTC":"");switch(o){case b:return a?c(1,0):c(31,11);case S:return a?c(1,$):c(0,$+1);case y:var O=this.$locale().weekStart||0,H=(g<O?g+7:g)-O;return c(a?w-H:w+(6-H),$);case v:case x:return f(j+"Hours",0);case p:return f(j+"Minutes",1);case l:return f(j+"Seconds",2);case d:return f(j+"Milliseconds",3);default:return this.clone()}},i.endOf=function(t){return this.startOf(t,!1)},i.$set=function(t,s){var e,a=u.p(t),o="set"+(this.$u?"UTC":""),c=(e={},e[v]=o+"Date",e[x]=o+"Date",e[S]=o+"Month",e[b]=o+"FullYear",e[p]=o+"Hours",e[l]=o+"Minutes",e[d]=o+"Seconds",e[h]=o+"Milliseconds",e)[a],f=a===v?this.$D+(s-this.$W):s;if(a===S||a===b){var g=this.clone().set(x,1);g.$d[c](f),g.init(),this.$d=g.set(x,Math.min(this.$D,g.daysInMonth())).$d}else c&&this.$d[c](f);return this.init(),this},i.set=function(t,s){return this.clone().$set(t,s)},i.get=function(t){return this[u.p(t)]()},i.add=function(t,s){var e,a=this;t=Number(t);var o=u.p(s),c=function($){var w=m(a);return u.w(w.date(w.date()+Math.round($*t)),a)};if(o===S)return this.set(S,this.$M+t);if(o===b)return this.set(b,this.$y+t);if(o===v)return c(1);if(o===y)return c(7);var f=(e={},e[l]=k,e[p]=n,e[d]=L,e)[o]||1,g=this.$d.getTime()+t*f;return u.w(g,this)},i.subtract=function(t,s){return this.add(-1*t,s)},i.format=function(t){var s=this,e=this.$locale();if(!this.isValid())return e.invalidDate||Z;var a=t||"YYYY-MM-DDTHH:mm:ssZ",o=u.z(this),c=this.$H,f=this.$m,g=this.$M,$=e.weekdays,w=e.months,j=e.meridiem,O=function(M,D,I,C){return M&&(M[D]||M(s,a))||I[D].slice(0,C)},H=function(M){return u.s(c%12||12,M,"0")},_=j||function(M,D,I){var C=M<12?"AM":"PM";return I?C.toLowerCase():C};return a.replace(rt,function(M,D){return D||function(I){switch(I){case"YY":return String(s.$y).slice(-2);case"YYYY":return u.s(s.$y,4,"0");case"M":return g+1;case"MM":return u.s(g+1,2,"0");case"MMM":return O(e.monthsShort,g,w,3);case"MMMM":return O(w,g);case"D":return s.$D;case"DD":return u.s(s.$D,2,"0");case"d":return String(s.$W);case"dd":return O(e.weekdaysMin,s.$W,$,2);case"ddd":return O(e.weekdaysShort,s.$W,$,3);case"dddd":return $[s.$W];case"H":return String(c);case"HH":return u.s(c,2,"0");case"h":return H(1);case"hh":return H(2);case"a":return _(c,f,!0);case"A":return _(c,f,!1);case"m":return String(f);case"mm":return u.s(f,2,"0");case"s":return String(s.$s);case"ss":return u.s(s.$s,2,"0");case"SSS":return u.s(s.$ms,3,"0");case"Z":return o}return null}(M)||o.replace(":","")})},i.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},i.diff=function(t,s,e){var a,o=this,c=u.p(s),f=m(t),g=(f.utcOffset()-this.utcOffset())*k,$=this-f,w=function(){return u.m(o,f)};switch(c){case b:a=w()/12;break;case S:a=w();break;case E:a=w()/3;break;case y:a=($-g)/6048e5;break;case v:a=($-g)/864e5;break;case p:a=$/n;break;case l:a=$/k;break;case d:a=$/L;break;default:a=$}return e?a:u.a(a)},i.daysInMonth=function(){return this.endOf(S).$D},i.$locale=function(){return T[this.$L]},i.locale=function(t,s){if(!t)return this.$L;var e=this.clone(),a=V(t,s,!0);return a&&(e.$L=a),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}(),B=W.prototype;return m.prototype=B,[["$ms",h],["$s",d],["$m",l],["$H",p],["$W",v],["$M",S],["$y",b],["$D",x]].forEach(function(r){B[r[1]]=function(i){return this.$g(i,r[0],r[1])}}),m.extend=function(r,i){return r.$i||(r(i,W,m),r.$i=!0),m},m.locale=V,m.isDayjs=U,m.unix=function(r){return m(1e3*r)},m.en=T[A],m.Ls=T,m.p={},m})});var q=ct(st(),1);var vt=(()=>{class L{$api=Y(it);$title=Y(X);$toastr=Y(et);$translate=Y(tt);settingsLoadedSubject=new Q;defaultTheme="deep-purple";forbiddenKeys=["__proto__","constructor","prototype"];env={};formAuth=!0;sessionTimeout=28800;uiVersion;theme;lightingMode;currentLightingMode;actualLightingMode;browserLightingMode;menuMode;keepOrphans;wallpaper;serverTimeOffset=0;rtl=!1;onSettingsLoaded=this.settingsLoadedSubject.pipe(G());settingsLoaded=!1;themeList=["orange","red","pink","purple","deep-purple","indigo","blue","blue-grey","cyan","green","teal","grey","brown"];constructor(){this.getAppSettings()}getAppSettings(){return P(this,null,function*(){let n=yield N(this.$api.get("/auth/settings"));this.formAuth=n.formAuth,this.sessionTimeout=n.sessionTimeout,this.env=n.env,this.lightingMode=n.lightingMode,this.wallpaper=n.wallpaper,this.setLightingMode(this.lightingMode,"user"),this.setTheme(n.theme),this.setMenuMode(n.menuMode),this.setKeepOrphans(n.keepOrphans),this.setTitle(this.env.homebridgeInstanceName),this.checkServerTime(n.serverTimestamp),this.setUiVersion(n.env.packageVersion),this.setLang(this.env.lang),this.settingsLoaded=!0,this.settingsLoadedSubject.next(void 0)})}setBrowserLightingMode(n){this.browserLightingMode=n,this.lightingMode==="auto"&&this.setLightingMode(n,"browser")}setLightingMode(n,h){h==="user"&&(this.lightingMode=n),this.currentLightingMode=n,this.actualLightingMode=this.currentLightingMode==="auto"?this.browserLightingMode:this.currentLightingMode,this.theme&&this.setTheme(this.theme)}setTheme(n){(!n||!this.themeList.includes(n))&&(n=this.defaultTheme,N(this.$api.put("/config-editor/ui",{key:"theme",value:n})).catch(l=>console.error("Error saving setTheme:",l)));let h=window.document.querySelector("body");h.classList.remove(`config-ui-x-${this.theme}`),h.classList.remove(`config-ui-x-dark-mode-${this.theme}`),this.theme=n,this.actualLightingMode==="dark"?(h.classList.add(`config-ui-x-dark-mode-${this.theme}`),h.classList.contains("dark-mode")||h.classList.add("dark-mode")):(h.classList.add(`config-ui-x-${this.theme}`),h.classList.contains("dark-mode")&&h.classList.remove("dark-mode")),window.document.querySelectorAll("iframe").forEach((l,p)=>{try{let v=l.contentDocument;if(v){let y=v.body;y.classList.remove(`config-ui-x-${this.theme}`),y.classList.remove(`config-ui-x-dark-mode-${this.theme}`),this.actualLightingMode==="dark"?(y.classList.add(`config-ui-x-dark-mode-${this.theme}`),y.classList.contains("dark-mode")||y.classList.add("dark-mode")):(y.classList.add(`config-ui-x-${this.theme}`),y.classList.contains("dark-mode")&&y.classList.remove("dark-mode")),l.contentWindow.postMessage({type:"theme-update",isDark:this.actualLightingMode==="dark",theme:n},window.location.origin)}}catch(v){console.warn(`Iframe ${p}: Access denied (cross-origin?)`,{error:v,src:l.src})}})}setMenuMode(n){this.menuMode=n}setKeepOrphans(n){this.keepOrphans=n}setLang(n){n?this.$translate.use(n):n="auto",this.env.lang=n}setItem(n,h){this[n]=h}setEnvItem(n,h){if(n.includes(".")){let d=n.split("."),l=this.env;for(let p=0;p<d.length-1;p++){if(this.forbiddenKeys.includes(d[p]))return;l[d[p]]||(l[d[p]]={}),l=l[d[p]]}this.forbiddenKeys.includes(d[d.length-1])||(l[d[d.length-1]]=h)}else this.env[n]=h}checkServerTime(n){let d=(0,q.default)(n).diff((0,q.default)(),"hour");this.serverTimeOffset=d*60*60,(d>=8||d<=-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")})}setUiVersion(n){this.uiVersion||(this.uiVersion=n)}setTitle(n){this.$title.setTitle(n||"Homebridge")}static \u0275fac=function(h){return new(h||L)};static \u0275prov=R({token:L,factory:L.\u0275fac,providedIn:"root"})}return L})();export{st as a,vt as b};
|
|
1
|
+
import{k as et,n as it}from"./chunk-VZCAAS2X.js";import{a as tt}from"./chunk-CPAHENLQ.js";import{m as X}from"./chunk-RJOGO4M5.js";import{T as G,e as ut,g as ct,ga as R,h as P,la as Y,n as Q,w as N}from"./chunk-WEVBEUAJ.js";var st=ut((J,K)=>{(function(L,k){typeof J=="object"&&typeof K<"u"?K.exports=k():typeof define=="function"&&define.amd?define(k):(L=typeof globalThis<"u"?globalThis:L||self).dayjs=k()})(J,function(){"use strict";var L=1e3,k=6e4,n=36e5,h="millisecond",d="second",l="minute",p="hour",v="day",y="week",S="month",E="quarter",b="year",x="date",Z="Invalid Date",nt=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,rt=/\[([^\]]+)]|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 s=String(r);return!s||s.length>=i?r:""+Array(i+1-s.length).join(t)+r},ot={s:F,z:function(r){var i=-r.utcOffset(),t=Math.abs(i),s=Math.floor(t/60),e=t%60;return(i<=0?"+":"-")+F(s,2,"0")+":"+F(e,2,"0")},m:function r(i,t){if(i.date()<t.date())return-r(t,i);var s=12*(t.year()-i.year())+(t.month()-i.month()),e=i.clone().add(s,S),a=t-e<0,o=i.clone().add(s+(a?-1:1),S);return+(-(s+(t-e)/(a?e-o:o-e))||0)},a:function(r){return r<0?Math.ceil(r)||0:Math.floor(r)},p:function(r){return{M:S,y:b,w:y,d:v,D:x,h:p,m:l,s:d,ms:h,Q:E}[r]||String(r||"").toLowerCase().replace(/s$/,"")},u:function(r){return r===void 0}},A="en",T={};T[A]=at;var z="$isDayjsObject",U=function(r){return r instanceof W||!(!r||!r[z])},V=function r(i,t,s){var e;if(!i)return A;if(typeof i=="string"){var a=i.toLowerCase();T[a]&&(e=a),t&&(T[a]=t,e=a);var o=i.split("-");if(!e&&o.length>1)return r(o[0])}else{var c=i.name;T[c]=i,e=c}return!s&&e&&(A=e),e||!s&&A},m=function(r,i){if(U(r))return r.clone();var t=typeof i=="object"?i:{};return t.date=r,t.args=arguments,new W(t)},u=ot;u.l=V,u.i=U,u.w=function(r,i){return m(r,{locale:i.$L,utc:i.$u,x:i.$x,$offset:i.$offset})};var W=function(){function r(t){this.$L=V(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[z]=!0}var i=r.prototype;return i.parse=function(t){this.$d=function(s){var e=s.date,a=s.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 o=e.match(nt);if(o){var c=o[2]-1||0,f=(o[7]||"0").substring(0,3);return a?new Date(Date.UTC(o[1],c,o[3]||1,o[4]||0,o[5]||0,o[6]||0,f)):new Date(o[1],c,o[3]||1,o[4]||0,o[5]||0,o[6]||0,f)}}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,s){var e=m(t);return this.startOf(s)<=e&&e<=this.endOf(s)},i.isAfter=function(t,s){return m(t)<this.startOf(s)},i.isBefore=function(t,s){return this.endOf(s)<m(t)},i.$g=function(t,s,e){return u.u(t)?this[s]:this.set(e,t)},i.unix=function(){return Math.floor(this.valueOf()/1e3)},i.valueOf=function(){return this.$d.getTime()},i.startOf=function(t,s){var e=this,a=!!u.u(s)||s,o=u.p(t),c=function(_,M){var D=u.w(e.$u?Date.UTC(e.$y,M,_):new Date(e.$y,M,_),e);return a?D:D.endOf(v)},f=function(_,M){return u.w(e.toDate()[_].apply(e.toDate("s"),(a?[0,0,0,0]:[23,59,59,999]).slice(M)),e)},g=this.$W,$=this.$M,w=this.$D,j="set"+(this.$u?"UTC":"");switch(o){case b:return a?c(1,0):c(31,11);case S:return a?c(1,$):c(0,$+1);case y:var O=this.$locale().weekStart||0,H=(g<O?g+7:g)-O;return c(a?w-H:w+(6-H),$);case v:case x:return f(j+"Hours",0);case p:return f(j+"Minutes",1);case l:return f(j+"Seconds",2);case d:return f(j+"Milliseconds",3);default:return this.clone()}},i.endOf=function(t){return this.startOf(t,!1)},i.$set=function(t,s){var e,a=u.p(t),o="set"+(this.$u?"UTC":""),c=(e={},e[v]=o+"Date",e[x]=o+"Date",e[S]=o+"Month",e[b]=o+"FullYear",e[p]=o+"Hours",e[l]=o+"Minutes",e[d]=o+"Seconds",e[h]=o+"Milliseconds",e)[a],f=a===v?this.$D+(s-this.$W):s;if(a===S||a===b){var g=this.clone().set(x,1);g.$d[c](f),g.init(),this.$d=g.set(x,Math.min(this.$D,g.daysInMonth())).$d}else c&&this.$d[c](f);return this.init(),this},i.set=function(t,s){return this.clone().$set(t,s)},i.get=function(t){return this[u.p(t)]()},i.add=function(t,s){var e,a=this;t=Number(t);var o=u.p(s),c=function($){var w=m(a);return u.w(w.date(w.date()+Math.round($*t)),a)};if(o===S)return this.set(S,this.$M+t);if(o===b)return this.set(b,this.$y+t);if(o===v)return c(1);if(o===y)return c(7);var f=(e={},e[l]=k,e[p]=n,e[d]=L,e)[o]||1,g=this.$d.getTime()+t*f;return u.w(g,this)},i.subtract=function(t,s){return this.add(-1*t,s)},i.format=function(t){var s=this,e=this.$locale();if(!this.isValid())return e.invalidDate||Z;var a=t||"YYYY-MM-DDTHH:mm:ssZ",o=u.z(this),c=this.$H,f=this.$m,g=this.$M,$=e.weekdays,w=e.months,j=e.meridiem,O=function(M,D,I,C){return M&&(M[D]||M(s,a))||I[D].slice(0,C)},H=function(M){return u.s(c%12||12,M,"0")},_=j||function(M,D,I){var C=M<12?"AM":"PM";return I?C.toLowerCase():C};return a.replace(rt,function(M,D){return D||function(I){switch(I){case"YY":return String(s.$y).slice(-2);case"YYYY":return u.s(s.$y,4,"0");case"M":return g+1;case"MM":return u.s(g+1,2,"0");case"MMM":return O(e.monthsShort,g,w,3);case"MMMM":return O(w,g);case"D":return s.$D;case"DD":return u.s(s.$D,2,"0");case"d":return String(s.$W);case"dd":return O(e.weekdaysMin,s.$W,$,2);case"ddd":return O(e.weekdaysShort,s.$W,$,3);case"dddd":return $[s.$W];case"H":return String(c);case"HH":return u.s(c,2,"0");case"h":return H(1);case"hh":return H(2);case"a":return _(c,f,!0);case"A":return _(c,f,!1);case"m":return String(f);case"mm":return u.s(f,2,"0");case"s":return String(s.$s);case"ss":return u.s(s.$s,2,"0");case"SSS":return u.s(s.$ms,3,"0");case"Z":return o}return null}(M)||o.replace(":","")})},i.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},i.diff=function(t,s,e){var a,o=this,c=u.p(s),f=m(t),g=(f.utcOffset()-this.utcOffset())*k,$=this-f,w=function(){return u.m(o,f)};switch(c){case b:a=w()/12;break;case S:a=w();break;case E:a=w()/3;break;case y:a=($-g)/6048e5;break;case v:a=($-g)/864e5;break;case p:a=$/n;break;case l:a=$/k;break;case d:a=$/L;break;default:a=$}return e?a:u.a(a)},i.daysInMonth=function(){return this.endOf(S).$D},i.$locale=function(){return T[this.$L]},i.locale=function(t,s){if(!t)return this.$L;var e=this.clone(),a=V(t,s,!0);return a&&(e.$L=a),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}(),B=W.prototype;return m.prototype=B,[["$ms",h],["$s",d],["$m",l],["$H",p],["$W",v],["$M",S],["$y",b],["$D",x]].forEach(function(r){B[r[1]]=function(i){return this.$g(i,r[0],r[1])}}),m.extend=function(r,i){return r.$i||(r(i,W,m),r.$i=!0),m},m.locale=V,m.isDayjs=U,m.unix=function(r){return m(1e3*r)},m.en=T[A],m.Ls=T,m.p={},m})});var q=ct(st(),1);var vt=(()=>{class L{$api=Y(it);$title=Y(X);$toastr=Y(et);$translate=Y(tt);settingsLoadedSubject=new Q;defaultTheme="deep-purple";forbiddenKeys=["__proto__","constructor","prototype"];env={};formAuth=!0;sessionTimeout=28800;uiVersion;theme;lightingMode;currentLightingMode;actualLightingMode;browserLightingMode;menuMode;keepOrphans;wallpaper;serverTimeOffset=0;rtl=!1;onSettingsLoaded=this.settingsLoadedSubject.pipe(G());settingsLoaded=!1;themeList=["orange","red","pink","purple","deep-purple","indigo","blue","blue-grey","cyan","green","teal","grey","brown"];constructor(){this.getAppSettings()}getAppSettings(){return P(this,null,function*(){let n=yield N(this.$api.get("/auth/settings"));this.formAuth=n.formAuth,this.sessionTimeout=n.sessionTimeout,this.env=n.env,this.lightingMode=n.lightingMode,this.wallpaper=n.wallpaper,this.setLightingMode(this.lightingMode,"user"),this.setTheme(n.theme),this.setMenuMode(n.menuMode),this.setKeepOrphans(n.keepOrphans),this.setTitle(this.env.homebridgeInstanceName),this.checkServerTime(n.serverTimestamp),this.setUiVersion(n.env.packageVersion),this.setLang(this.env.lang),this.settingsLoaded=!0,this.settingsLoadedSubject.next(void 0)})}setBrowserLightingMode(n){this.browserLightingMode=n,this.lightingMode==="auto"&&this.setLightingMode(n,"browser")}setLightingMode(n,h){h==="user"&&(this.lightingMode=n),this.currentLightingMode=n,this.actualLightingMode=this.currentLightingMode==="auto"?this.browserLightingMode:this.currentLightingMode,this.theme&&this.setTheme(this.theme)}setTheme(n){(!n||!this.themeList.includes(n))&&(n=this.defaultTheme,N(this.$api.put("/config-editor/ui",{key:"theme",value:n})).catch(l=>console.error("Error saving setTheme:",l)));let h=window.document.querySelector("body");h.classList.remove(`config-ui-x-${this.theme}`),h.classList.remove(`config-ui-x-dark-mode-${this.theme}`),this.theme=n,this.actualLightingMode==="dark"?(h.classList.add(`config-ui-x-dark-mode-${this.theme}`),h.classList.contains("dark-mode")||h.classList.add("dark-mode")):(h.classList.add(`config-ui-x-${this.theme}`),h.classList.contains("dark-mode")&&h.classList.remove("dark-mode")),window.document.querySelectorAll("iframe").forEach((l,p)=>{try{let v=l.contentDocument;if(v){let y=v.body;y.classList.remove(`config-ui-x-${this.theme}`),y.classList.remove(`config-ui-x-dark-mode-${this.theme}`),this.actualLightingMode==="dark"?(y.classList.add(`config-ui-x-dark-mode-${this.theme}`),y.classList.contains("dark-mode")||y.classList.add("dark-mode")):(y.classList.add(`config-ui-x-${this.theme}`),y.classList.contains("dark-mode")&&y.classList.remove("dark-mode")),l.contentWindow.postMessage({type:"theme-update",isDark:this.actualLightingMode==="dark",theme:n},window.location.origin)}}catch(v){console.warn(`Iframe ${p}: Access denied (cross-origin?)`,{error:v,src:l.src})}})}setMenuMode(n){this.menuMode=n}setKeepOrphans(n){this.keepOrphans=n}setLang(n){n?this.$translate.use(n):n="auto",this.env.lang=n}setItem(n,h){this[n]=h}setEnvItem(n,h){if(n.includes(".")){let d=n.split("."),l=this.env;for(let p=0;p<d.length-1;p++){if(this.forbiddenKeys.includes(d[p]))return;l[d[p]]||(l[d[p]]={}),l=l[d[p]]}this.forbiddenKeys.includes(d[d.length-1])||(l[d[d.length-1]]=h)}else this.env[n]=h}checkServerTime(n){let d=(0,q.default)(n).diff((0,q.default)(),"hour");this.serverTimeOffset=d*60*60,(d>=8||d<=-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")})}setUiVersion(n){this.uiVersion||(this.uiVersion=n)}setTitle(n){this.$title.setTitle(n||"Homebridge")}static \u0275fac=function(h){return new(h||L)};static \u0275prov=R({token:L,factory:L.\u0275fac,providedIn:"root"})}return L})();export{st as a,vt as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as u,g as s}from"./chunk-25NXLXGL.js";import{k as l,n as d}from"./chunk-
|
|
1
|
+
import{d as u,g as s}from"./chunk-25NXLXGL.js";import{k as l,n as d}from"./chunk-VZCAAS2X.js";import{a as p}from"./chunk-CPAHENLQ.js";import"./chunk-RJOGO4M5.js";import{ga as c,h as f,ha as i,la as e,nb as n,w as m}from"./chunk-WEVBEUAJ.js";var a=(()=>{class t{$api=e(d);$router=e(u);$toastr=e(l);$translate=e(p);resolve(){return f(this,null,function*(){try{let o=yield m(this.$api.get("/config-editor"));return JSON.stringify(o,null,4)}catch(o){console.error(o),this.$toastr.error(o.message,this.$translate.instant("toast.title_error")),this.$router.navigate(["/"])}})}static \u0275fac=function(r){return new(r||t)};static \u0275prov=c({token:t,factory:t.\u0275fac})}return t})();var y=[{path:"",loadComponent:()=>import("./chunk-N4463S2N.js").then(t=>t.ConfigEditorComponent),resolve:{config:a}}],v=(()=>{class t{static \u0275fac=function(r){return new(r||t)};static \u0275mod=n({type:t});static \u0275inj=i({imports:[s.forChild(y),s]})}return t})();var T=(()=>{class t{static \u0275fac=function(r){return new(r||t)};static \u0275mod=n({type:t});static \u0275inj=i({providers:[a],imports:[v]})}return t})();export{T as ConfigEditorModule};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as P}from"./chunk-F3MG6UU6.js";import{a as O}from"./chunk-AKD24HZC.js";import{c as y,e as E,l as k,z as $}from"./chunk-VPU5FNT3.js";import{b as D}from"./chunk-25NXLXGL.js";import{b as L}from"./chunk-
|
|
1
|
+
import{a as P}from"./chunk-F3MG6UU6.js";import{a as O}from"./chunk-AKD24HZC.js";import{c as y,e as E,l as k,z as $}from"./chunk-VPU5FNT3.js";import{b as D}from"./chunk-25NXLXGL.js";import{b as L}from"./chunk-2HWQ6KHG.js";import{k as I,n as H}from"./chunk-VZCAAS2X.js";import{a as T}from"./chunk-CPAHENLQ.js";import"./chunk-RJOGO4M5.js";import{Ib as m,Jb as u,Ob as f,Pb as d,Qb as s,Rb as w,_b as g,ab as p,bc as _,dc as a,h as S,la as r,mb as x,qc as v,ra as l,sa as c,w as C,xc as b,yc as M,zc as V}from"./chunk-WEVBEUAJ.js";function z(i,h){i&1&&w(0,"i",6)}function A(i,h){i&1&&w(0,"i",7)}function F(i,h){if(i&1){let t=g();d(0,"ngx-monaco-editor",10),_("onInit",function(e){l(t);let o=a();return c(o.onEditorInit(e))})("keydown.control.s",function(e){l(t);let o=a();return e.preventDefault(),c(o.onSave())})("keydown.meta.s",function(e){l(t);let o=a();return e.preventDefault(),c(o.onSave())}),s()}if(i&2){let t=a();f("options",t.editorOptions)("model",t.monacoEditorModel)}}function W(i,h){if(i&1){let t=g();d(0,"textarea",11),V("ngModelChange",function(e){l(t);let o=a();return M(o.startupScript,e)||(o.startupScript=e),c(e)}),v(1," "),s()}if(i&2){let t=a();b("ngModel",t.startupScript)}}var tt=(()=>{class i{$api=r(H);$md=r(O);$route=r(D);$settings=r(L);$toastr=r(I);$translate=r(T);lastHeight;visualViewPortEventCallback;startupScript;saveInProgress;isMobile=!1;options={printMargin:!1};monacoEditor;editorOptions;monacoEditorModel;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}})}ngOnDestroy(){window.visualViewport&&(window.visualViewport.removeEventListener("resize",this.visualViewPortEventCallback,!0),this.$md.enableTouchMove()),this.monacoEditor&&this.monacoEditor.dispose()}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)}static \u0275fac=function(n){return new(n||i)};static \u0275cmp=x({type:i,selectors:[["ng-component"]],decls:11,vars:4,consts:[[1,"flex-column","d-flex","align-items-stretch","h-100"],[1,"row","mb-3"],[1,"col-6"],[1,"primary-text","m-0","font-monospace"],[1,"col-6","text-end"],[1,"btn","btn-primary","waves-effect","m-0",3,"click","disabled"],[1,"fas","fa-fw","fa-spinner","fa-pulse"],[1,"fas","fa-fw","fa-floppy-disk"],[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&&(d(0,"div",0)(1,"div",1)(2,"div",2)(3,"h3",3),v(4,"startup.sh"),s()(),d(5,"div",4)(6,"button",5),_("click",function(){return e.onSave()}),m(7,z,1,0,"i",6)(8,A,1,0,"i",7),s()()(),m(9,F,1,2,"ngx-monaco-editor",8),m(10,W,2,1,"textarea",9),s()),n&2&&(p(6),f("disabled",e.saveInProgress),p(),u(e.saveInProgress?7:8),p(2),u(e.isMobile?-1:9),p(),u(e.isMobile?10:-1))},dependencies:[P,$,y,E,k],encapsulation:2})}return i})();export{tt as StartupScriptComponent};
|