homebridge-config-ui-x 5.0.0-beta.71 → 5.0.0-beta.73
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 -1
- package/package.json +1 -1
- package/public/{chunk-JPVF3EPM.js → chunk-2RKLBKJO.js} +1 -1
- package/public/{chunk-ECZONFVO.js → chunk-3HY7J6NH.js} +1 -1
- package/public/chunk-3MZ3SGJP.js +1 -0
- package/public/chunk-5LF2PUAW.js +1 -0
- package/public/{chunk-WNGOTZ3I.js → chunk-5VAXNY3G.js} +1 -1
- package/public/{chunk-DJ7A6WCT.js → chunk-6KZY5X2O.js} +1 -1
- package/public/{chunk-IEOEU3PV.js → chunk-6OKYARP4.js} +1 -1
- package/public/{chunk-OGSVTVGE.js → chunk-7K6J2JZV.js} +1 -1
- package/public/chunk-AMX53RFJ.js +1 -0
- package/public/{chunk-QELUTKQF.js → chunk-BAFZ37NV.js} +1 -1
- package/public/{chunk-4CHNDLJI.js → chunk-CY623UQD.js} +1 -1
- package/public/{chunk-Z4W7FR2B.js → chunk-CYMQU3QM.js} +1 -1
- package/public/chunk-DFBQ6P6I.js +1 -0
- package/public/chunk-DRL5T7S2.js +1 -0
- package/public/chunk-EMSRFE2S.js +1 -0
- package/public/{chunk-AXOQXZMS.js → chunk-ETZ7KYF5.js} +1 -1
- package/public/{chunk-2SXSAYFM.js → chunk-EU7YAVHW.js} +1 -1
- package/public/chunk-F4P6I4SG.js +1 -0
- package/public/{chunk-TQNPIZF3.js → chunk-FFJ57RXM.js} +1 -1
- package/public/chunk-FMZ4TY2R.js +1 -0
- package/public/{chunk-TUHGKUZA.js → chunk-FTOJQHSN.js} +1 -1
- package/public/{chunk-JIG56QTE.js → chunk-G44UGN2Q.js} +1 -1
- package/public/{chunk-A2LWX7FC.js → chunk-G7VIWDTY.js} +1 -1
- package/public/{chunk-UOC65WET.js → chunk-GGWS5OR6.js} +1 -1
- package/public/chunk-GYHA5VGU.js +1 -0
- package/public/{chunk-CAAUHMGY.js → chunk-GYQRW76Y.js} +1 -1
- package/public/{chunk-OCZ2H4UT.js → chunk-H7R2FNPO.js} +1 -1
- package/public/{chunk-Z2BKSNSC.js → chunk-HESSYWLP.js} +1 -1
- package/public/{chunk-VISSPBAJ.js → chunk-IREZKHRG.js} +1 -1
- package/public/{chunk-TJHYTY4K.js → chunk-J5LLBW4H.js} +1 -1
- package/public/{chunk-PTJSEANH.js → chunk-JWBDXQTX.js} +1 -1
- package/public/{chunk-NKGM5COZ.js → chunk-K6Z4M6DK.js} +1 -1
- package/public/{chunk-5K7NARQK.js → chunk-KD7A3XPM.js} +1 -1
- package/public/{chunk-TCKHBFBN.js → chunk-KOEPVWAV.js} +1 -1
- package/public/{chunk-G6GTWDKY.js → chunk-LEN5ONT7.js} +1 -1
- package/public/{chunk-RHYCATQR.js → chunk-LETXT4TQ.js} +1 -1
- package/public/{chunk-VWAY3YX4.js → chunk-LGKKDS2D.js} +1 -1
- package/public/{chunk-GJEQY7FK.js → chunk-M4ZALRLO.js} +1 -1
- package/public/chunk-M6SU5QZI.js +1 -0
- package/public/chunk-ME5YO72N.js +1 -0
- package/public/{chunk-3EHBMPWY.js → chunk-MLNMRNTZ.js} +1 -1
- package/public/{chunk-M6OQT53Y.js → chunk-MSTKNHKR.js} +1 -1
- package/public/{chunk-YZMZPZB3.js → chunk-N2V5ZY2K.js} +1 -1
- package/public/{chunk-AK4S37TG.js → chunk-OC3KLIEQ.js} +1 -1
- package/public/chunk-OXFPDX4F.js +1 -0
- package/public/{chunk-YRCKAGKJ.js → chunk-PLRHRDW2.js} +1 -1
- package/public/chunk-QQUUQ47G.js +1 -0
- package/public/{chunk-ZXXOJAVC.js → chunk-R76FQMOG.js} +1 -1
- package/public/chunk-RYLGR4TD.js +1 -0
- package/public/{chunk-4WTLH2XC.js → chunk-SN7QITJV.js} +1 -1
- package/public/{chunk-EWHDFFHL.js → chunk-UKL5QAGM.js} +1 -1
- package/public/{chunk-LXATRDDS.js → chunk-UVKJJD7V.js} +1 -1
- package/public/{chunk-2OBPFCY2.js → chunk-W7INVKJK.js} +1 -1
- package/public/chunk-WEIOAID6.js +8 -0
- package/public/{chunk-CWBE5JGC.js → chunk-WIC623PI.js} +1 -1
- package/public/{chunk-5PQJRA5G.js → chunk-WSN4EOA3.js} +1 -1
- package/public/{chunk-752FLZDX.js → chunk-XMEVG75U.js} +1 -1
- package/public/{chunk-FPFW7VCW.js → chunk-YG4ZB7UL.js} +1 -1
- package/public/{chunk-JX3E4VFM.js → chunk-YO42LXJH.js} +1 -1
- package/public/{chunk-OT3IJBCR.js → chunk-Z5JCPUL4.js} +1 -1
- package/public/index.html +2 -2
- package/public/main-AEAFQN6N.js +1 -0
- package/public/{styles-RBNVUC4M.css → styles-N63CIM5W.css} +1 -1
- package/public/chunk-5T7JAJJE.js +0 -1
- package/public/chunk-AWX3JVVV.js +0 -1
- package/public/chunk-B4ZMGETB.js +0 -1
- package/public/chunk-EO357XL5.js +0 -1
- package/public/chunk-F6QHMWSD.js +0 -1
- package/public/chunk-J75SJ6HL.js +0 -1
- package/public/chunk-KUE46RRU.js +0 -1
- package/public/chunk-N4VWPJ6S.js +0 -1
- package/public/chunk-P3A42IW2.js +0 -1
- package/public/chunk-PKP4FSKB.js +0 -1
- package/public/chunk-Q5DVL6Z6.js +0 -1
- package/public/chunk-QR2DRJ5Q.js +0 -1
- package/public/chunk-S4CZRO5L.js +0 -1
- package/public/chunk-TVF7CAJN.js +0 -1
- package/public/chunk-U6XLWNAV.js +0 -1
- package/public/main-LJS4FW2X.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as V}from"./chunk-
|
|
1
|
+
import{a as V}from"./chunk-7K6J2JZV.js";import{a as q}from"./chunk-JMCN2SQV.js";import{a as _}from"./chunk-RSIXVZQ5.js";import{n as B,o as k}from"./chunk-YHABGXDF.js";import{h as D,k as F}from"./chunk-SN7QITJV.js";import{a as z,b as E}from"./chunk-DJKI5XBW.js";import{$a as m,Ac as i,Bc as r,Gb as b,Lc as S,Nb as h,Ob as s,Pb as l,Qb as p,Ub as L,Xb as d,_a as y,dc as T,ec as C,g as j,h as w,jc as x,kc as I,la as o,lb as $,n as v,ra as u,sa as f}from"./chunk-U4V4ICSI.js";var H=j(q(),1);var A=["logoutput"],X=(()=>{class c{$api=o(F);$log=o(V);$modal=o(B);$toastr=o(D);$translate=o(z);termTarget=S("logoutput");resizeEvent=new v;constructor(){}onWindowResize(){this.resizeEvent.next(void 0)}ngOnInit(){window.document.querySelector("body").classList.add("bg-black"),this.$log.startTerminal(this.termTarget(),{},this.resizeEvent)}ngOnDestroy(){window.document.querySelector("body").classList.remove("bg-black"),this.$log.destroyTerminal()}downloadLogFile(){let t=this.$modal.open(_,{size:"lg",backdrop:"static"});t.componentInstance.title=this.$translate.instant("logs.title_download_log_file"),t.componentInstance.message=this.$translate.instant("logs.download_warning"),t.componentInstance.confirmButtonLabel=this.$translate.instant("form.button_download"),t.componentInstance.faIconClass="fas fa-fw fa-user-secret primary-text",t.result.then(()=>{this.$api.get("/platform-tools/hb-service/log/download",{observe:"response",responseType:"blob"}).subscribe({next:e=>{(0,H.saveAs)(e.body,"homebridge.log.txt")},error:e=>w(this,null,function*(){let n;try{n=JSON.parse(yield e.error.text()).message}catch(a){console.error(a)}this.$toastr.error(n||this.$translate.instant("logs.download.error"),this.$translate.instant("toast.title_error"))})})}).catch(()=>{})}truncateLogFile(){let t=this.$modal.open(_,{size:"lg",backdrop:"static"});t.componentInstance.title=this.$translate.instant("logs.title_truncate_log_file"),t.componentInstance.message=this.$translate.instant("logs.truncate_log_warning"),t.componentInstance.confirmButtonLabel=this.$translate.instant("form.button_delete"),t.componentInstance.confirmButtonClass="btn-danger",t.componentInstance.faIconClass="fas fa-fw fa-circle-exclamation primary-text",t.result.then(()=>{this.$api.put("/platform-tools/hb-service/log/truncate",{}).subscribe({next:()=>{this.$toastr.success(this.$translate.instant("logs.log_file_truncated"),this.$translate.instant("toast.title_success")),this.$log.term.clear()},error:e=>{console.error(e),this.$toastr.error(e.error.message||this.$translate.instant("logs.truncate.error"),this.$translate.instant("toast.title_error"))}})}).catch(()=>{})}static \u0275fac=function(e){return new(e||c)};static \u0275cmp=$({type:c,selectors:[["ng-component"]],viewQuery:function(e,n){e&1&&T(n.termTarget,A,5),e&2&&C()},hostBindings:function(e,n){e&1&&d("resize",function(g){return n.onWindowResize(g)},y)},decls:17,vars:15,consts:[["logoutput",""],[1,"row","mb-3"],[1,"col-6"],[1,"primary-text","m-0"],[1,"col-6","text-end"],["container","body","placement","bottom","openDelay","150","triggers","hover",1,"btn","btn-elegant","my-0","me-2",3,"click","ngbTooltip"],[1,"fas","fa-fw","fa-download"],["container","body","placement","bottom","openDelay","150","triggers","hover",1,"btn","btn-elegant","my-0","me-0",3,"click","ngbTooltip"],[1,"fas","fa-fw","fa-trash-alt"],[1,"flex-column","d-flex","align-items-stretch","adjust-for-mobile"],["id","log-output",1,"align-self-end","w-100","h-100","mb-1"]],template:function(e,n){if(e&1){let a=L();s(0,"div",1)(1,"div",2)(2,"h3",3),x(3),i(4,"translate"),l()(),s(5,"div",4)(6,"button",5),i(7,"translate"),i(8,"translate"),d("click",function(){return u(a),f(n.downloadLogFile())}),p(9,"i",6),l(),s(10,"button",7),i(11,"translate"),i(12,"translate"),d("click",function(){return u(a),f(n.truncateLogFile())}),p(13,"i",8),l()()(),s(14,"div",9),p(15,"div",10,0),l()}e&2&&(m(3),I(r(4,5,"menu.linux.label_logs")),m(3),h("ngbTooltip",r(7,7,"form.button_download")),b("aria-label",r(8,9,"form.button_download")),m(4),h("ngbTooltip",r(11,11,"form.button_delete")),b("aria-label",r(12,13,"form.button_delete")))},dependencies:[k,E],encapsulation:2})}return c})();export{X as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as X}from"./chunk-UR24V3JB.js";import{a as H}from"./chunk-C53ZM5K2.js";import{a as Z}from"./chunk-LTDUXFUG.js";import{a as R}from"./chunk-RSIXVZQ5.js";import{n as L}from"./chunk-YHABGXDF.js";import"./chunk-JOBKDXBH.js";import{a as j}from"./chunk-G6GTWDKY.js";import{a as W,c as q,d as V,e as N,f as D}from"./chunk-QR7L4UUP.js";import{c as B}from"./chunk-UOC65WET.js";import{b as $}from"./chunk-OT3IJBCR.js";import{j as T}from"./chunk-4WTLH2XC.js";import"./chunk-ASBFWS7L.js";import{a as P,b as U}from"./chunk-DJKI5XBW.js";import{$a as o,Ac as d,Bc as l,Gb as u,Hb as x,Ib as y,Nb as c,Ob as n,Pb as a,Qb as p,Ub as S,Xb as _,Yb as w,bd as E,eb as F,g as Y,h as z,jc as f,kc as g,la as m,lb as O,ra as h,sa as b,sd as K,vc as v,w as A,wc as M}from"./chunk-U4V4ICSI.js";var Q=Y(Z(),1);function G(){var i;return typeof window<"u"&&(window?.matchMedia("(display-mode: standalone)").matches||((i=window.navigator)===null||i===void 0?void 0:i.standalone)||document.referrer.startsWith("android-app://")||window?.Windows||/trident.+(msapphost|webview)\//i.test(navigator.userAgent)||document.referrer.startsWith("app-info://platform/microsoft-store"))}var I=()=>["/"],te=i=>({"hamburger-icon-cross":i}),ne=i=>({expanded:i}),ie=()=>({exact:!0}),oe=()=>["/accessories"],re=()=>["/support"],ae=()=>["/power-options"],se=()=>["/plugins"],de=()=>["/logs"],le=()=>["/platform-tools/terminal"],pe=()=>["/config"],ce=()=>["/settings"];function me(i,k){if(i&1){let e=S();n(0,"div",10)(1,"div",19),d(2,"translate"),d(3,"translate"),_("click",function(){h(e);let t=w();return b(t.openUnderVoltageModal())})("keydown",function(t){h(e);let r=w();return b(r.handleKeydown(t))}),n(4,"div",12),p(5,"i",20),a(),n(6,"div",14),f(7),d(8,"translate"),a()()()}i&2&&(o(),u("aria-label",l(2,2,"rpi.throttled.undervoltage_title")+" - "+l(3,4,"rpi.throttled.undervoltage_description")),o(6),g(l(8,6,"rpi.throttled.undervoltage_title")))}function ue(i,k){if(i&1){let e=S();n(0,"div",10)(1,"div",15),d(2,"translate"),_("keydown",function(t){h(e);let r=w();return b(r.handleKeydown(t))}),n(3,"div",12),p(4,"i",21),a(),n(5,"div",14),f(6),d(7,"translate"),a()()()}i&2&&(o(),c("routerLink",v(8,se))("routerLinkActive","active"),u("aria-label",l(2,4,"menu.label_plugins")),o(5),g(l(7,6,"menu.label_plugins")))}function _e(i,k){if(i&1){let e=S();n(0,"div",10)(1,"div",15),d(2,"translate"),_("keydown",function(t){h(e);let r=w();return b(r.handleKeydown(t))}),n(3,"div",12),p(4,"i",22),a(),n(5,"div",14),f(6),d(7,"translate"),a()()()}i&2&&(o(),c("routerLink",v(8,de))("routerLinkActive","active"),u("aria-label",l(2,4,"menu.linux.label_logs")),o(5),g(l(7,6,"menu.linux.label_logs")))}function fe(i,k){if(i&1){let e=S();n(0,"div",10)(1,"div",15),d(2,"translate"),_("keydown",function(t){h(e);let r=w();return b(r.handleKeydown(t))}),n(3,"div",12),p(4,"i",23),a(),n(5,"div",14),f(6),d(7,"translate"),a()()()}i&2&&(o(),c("routerLink",v(8,le))("routerLinkActive","active"),u("aria-label",l(2,4,"menu.linux.label_terminal")),o(5),g(l(7,6,"menu.linux.label_terminal")))}function ge(i,k){if(i&1){let e=S();n(0,"div",10)(1,"div",15),d(2,"translate"),_("keydown",function(t){h(e);let r=w();return b(r.handleKeydown(t))}),n(3,"div",12),p(4,"i",24),a(),n(5,"div",14),f(6),d(7,"translate"),a()()()}i&2&&(o(),c("routerLink",v(8,pe))("routerLinkActive","active"),u("aria-label",l(2,4,"menu.config_json_editor")),o(5),g(l(7,6,"menu.config_json_editor")))}function ve(i,k){if(i&1){let e=S();n(0,"div",10)(1,"div",15),d(2,"translate"),_("keydown",function(t){h(e);let r=w();return b(r.handleKeydown(t))}),n(3,"div",12),p(4,"i",25),a(),n(5,"div",14),f(6),d(7,"translate"),a()()()}i&2&&(o(),c("routerLink",v(8,ce))("routerLinkActive","active"),u("aria-label",l(2,4,"menu.label_settings")),o(5),g(l(7,6,"menu.label_settings")))}function he(i,k){if(i&1){let e=S();n(0,"div",10)(1,"div",19),d(2,"translate"),_("click",function(){h(e);let t=w();return b(t.reloadPage())})("keydown",function(t){h(e);let r=w();return b(r.handleKeydown(t))}),n(3,"div",12),p(4,"i",26),a(),n(5,"div",14),f(6),d(7,"translate"),a()()()}i&2&&(o(),u("aria-label",l(2,2,"menu.reload")),o(5),g(l(7,4,"menu.reload")))}function be(i,k){if(i&1){let e=S();n(0,"div",10)(1,"div",19),d(2,"translate"),_("click",function(){h(e);let t=w();return b(t.$auth.logout())})("keydown",function(t){h(e);let r=w();return b(r.handleKeydown(t))}),n(3,"div",12),p(4,"i",27),a(),n(5,"div",14),f(6),d(7,"translate"),a()()()}i&2&&(o(),u("aria-label",l(2,2,"menu.tooltip_logout")),o(5),g(l(7,4,"menu.tooltip_logout")))}var J=(()=>{class i{router=m(V);translate=m(P);$auth=m(B);$settings=m($);$modal=m(L);$notification=m(X);$translate=m(P);renderer=m(F);isExpanded=!1;rPiCurrentlyUnderVoltage=!1;rPiWasUnderVoltage=!1;isMobile=!1;freezeMenu=!1;isPwa=G();constructor(){let e=this.router;this.isMobile=window.innerWidth<768;let s;window.addEventListener("resize",()=>{clearTimeout(s),s=setTimeout(()=>{this.updateListeners()},500)}),e.events.subscribe(t=>{t instanceof W&&(this.closeSidebar(),this.freezeMenu=!0,setTimeout(()=>{this.freezeMenu=!1},750))})}ngOnInit(){this.$notification.raspberryPiThrottled.subscribe(r=>{r["Under Voltage"]&&(this.rPiCurrentlyUnderVoltage=!0),r["Under-voltage has occurred"]&&(this.rPiWasUnderVoltage=!0)});let e=document.querySelector(".sidebar"),s=document.querySelector(".m-header"),t=document.querySelector(".content");this.isMobile?document.addEventListener("touchstart",r=>{if(t.contains(r.target)&&this.isExpanded){r.preventDefault(),this.toggleSidebar();return}!e.contains(r.target)&&!s.contains(r.target)&&this.isExpanded&&(r.preventDefault(),this.closeSidebar())},{passive:!1}):(this.updateListeners(),s.addEventListener("mouseenter",()=>this.openSidebar(),{passive:!1}),s.addEventListener("mouseleave",()=>this.closeSidebar(),{passive:!1}),document.addEventListener("click",r=>{e.contains(r.target)&&r.clientX>60&&this.closeSidebar()},{passive:!1})),this.updateContentStyles()}openSidebar(){this.freezeMenu||(this.isExpanded=!0,this.updateContentStyles())}closeSidebar(){this.freezeMenu||(this.isExpanded=!1,this.updateContentStyles())}toggleSidebar(){this.freezeMenu||(this.isExpanded=!this.isExpanded,this.updateContentStyles())}updateContentStyles(){let e=document.querySelector(".content");this.isExpanded?(this.renderer.setStyle(e,"opacity","20%"),this.renderer.setStyle(e,"pointer-events","none"),this.renderer.setStyle(e,"overflow","hidden")):(this.renderer.removeStyle(e,"opacity"),this.renderer.removeStyle(e,"pointer-events"),this.renderer.removeStyle(e,"overflow"))}openUnderVoltageModal(){let e=this.$modal.open(H,{size:"lg",backdrop:"static"});e.componentInstance.title=this.$translate.instant("rpi.throttled.undervoltage_title"),e.componentInstance.message=this.$translate.instant(this.rPiCurrentlyUnderVoltage?"rpi.throttled.currently_message":"rpi.throttled.previously_message"),e.componentInstance.ctaButtonLabel=this.$translate.instant("form.button_more_info"),e.componentInstance.faIconClass="fas fa-fw fa-bolt yellow-text",e.componentInstance.ctaButtonLink="https://pimylifeup.com/raspberry-pi-low-voltage-warning"}handleKeydown(e){if(e.key==="Enter"){let s=e.target;["menuitem","button"].includes(s.getAttribute("role"))&&s.click()}}reloadPage(){window.location.reload()}updateListeners(){this.isMobile=window.innerWidth<768;let e=document.querySelector(".sidebar");e.removeAllListeners(),(this.isMobile||!this.isMobile&&this.$settings.menuMode!=="freeze")&&(e.addEventListener("mouseenter",()=>this.openSidebar(),{passive:!1}),e.addEventListener("mouseleave",()=>this.closeSidebar(),{passive:!1}))}ngOnDestroy(){document.removeEventListener("touchstart",()=>{}),document.removeEventListener("click",()=>{})}static \u0275fac=function(s){return new(s||i)};static \u0275cmp=O({type:i,selectors:[["app-sidebar"]],inputs:{isExpanded:"isExpanded"},decls:61,vars:67,consts:[["tabindex","0","role","button",1,"m-header","text-end",3,"click","keydown"],[1,"me-2","d-block","d-lg-none",2,"font-size","0.9rem","color","#dddddd"],[3,"routerLink"],["ngSrc","../../../../assets/homebridge-logo.svg","alt","HB Logo","height","35","width","35",2,"height","35px","width","35px"],[1,"hb-logo-text-mobile"],[1,"hamburger-icon",3,"ngClass"],["role","navigation","id","sidebar",1,"sidebar",3,"ngClass"],["tabindex","0","role","button",1,"header",3,"click","keydown"],[1,"hb-logo-text"],[1,"link-wrapper"],[1,"link"],["role","menuitem","tabindex","0",1,"link-row",3,"keydown","routerLink","routerLinkActive","routerLinkActiveOptions"],[1,"icon"],[1,"fa","fa-fw","fa-house"],[1,"title"],["role","menuitem","tabindex","0",1,"link-row",3,"keydown","routerLink","routerLinkActive"],[1,"fa","fa-fw","fa-lightbulb"],[1,"fa","fa-fw","fa-question-circle-o"],[1,"fa","fa-fw","fa-power-off"],["role","menuitem","tabindex","0",1,"link-row",3,"click","keydown"],[1,"fas","fa-fw","fa-bolt","fa-beat","yellow-text",2,"--fa-beat-scale","1.5"],[1,"fa","fa-fw","fa-plug"],[1,"fa","fa-fw","fa-wave-square"],[1,"fa","fa-fw","fa-terminal"],[1,"fa","fa-fw","fa-code"],[1,"fa","fa-fw","fa-cog"],[1,"fa","fa-fw","fa-refresh"],[1,"fa","fa-fw","fa-right-from-bracket"]],template:function(s,t){s&1&&(n(0,"div",0),d(1,"translate"),_("click",function(){return t.toggleSidebar()})("keydown",function(C){return t.handleKeydown(C)}),p(2,"span",1),n(3,"a",2),d(4,"translate"),p(5,"img",3),n(6,"div",4),f(7,"Homebridge"),a()(),n(8,"div",5),p(9,"span")(10,"span")(11,"span")(12,"span"),a()(),n(13,"div",6)(14,"div",7),_("click",function(){return t.toggleSidebar()})("keydown",function(C){return t.handleKeydown(C)}),n(15,"a",2),d(16,"translate"),p(17,"img",3),n(18,"div",8),f(19,"Homebridge"),a()()(),n(20,"div",9)(21,"div",10)(22,"div",11),d(23,"translate"),_("keydown",function(C){return t.handleKeydown(C)}),n(24,"div",12),p(25,"i",13),a(),n(26,"div",14),f(27),d(28,"translate"),a()()(),x(29,me,9,8,"div",10),x(30,ue,8,9,"div",10),n(31,"div",10)(32,"div",15),d(33,"translate"),_("keydown",function(C){return t.handleKeydown(C)}),n(34,"div",12),p(35,"i",16),a(),n(36,"div",14),f(37),d(38,"translate"),a()()(),x(39,_e,8,9,"div",10),x(40,fe,8,9,"div",10),x(41,ge,8,9,"div",10),x(42,ve,8,9,"div",10),n(43,"div",10)(44,"div",15),d(45,"translate"),_("keydown",function(C){return t.handleKeydown(C)}),n(46,"div",12),p(47,"i",17),a(),n(48,"div",14),f(49),d(50,"translate"),a()()(),n(51,"div",10)(52,"div",15),d(53,"translate"),_("keydown",function(C){return t.handleKeydown(C)}),n(54,"div",12),p(55,"i",18),a(),n(56,"div",14),f(57),d(58,"translate"),a()()(),x(59,he,8,6,"div",10),x(60,be,8,6,"div",10),a()()),s&2&&(u("aria-expanded",t.isExpanded?"true":"false")("aria-controls","sidebar")("aria-label",l(1,34,"menu.sidebar.aria_menu")),o(3),c("routerLink",v(56,I)),u("aria-label",l(4,36,"menu.label_status")),o(5),c("ngClass",M(57,te,t.isExpanded)),o(5),c("ngClass",M(59,ne,t.isExpanded)),o(2),c("routerLink",v(61,I)),u("aria-label",l(16,38,"menu.label_status")),o(7),c("routerLink",v(62,I))("routerLinkActive","active")("routerLinkActiveOptions",v(63,ie)),u("aria-label",l(23,40,"menu.label_status")),o(5),g(l(28,42,"menu.label_status")),o(2),y(t.rPiWasUnderVoltage||t.rPiCurrentlyUnderVoltage?29:-1),o(),y(t.$auth.user.admin?30:-1),o(2),c("routerLink",v(64,oe))("routerLinkActive","active"),u("aria-label",l(33,44,"menu.label_accessories")),o(5),g(l(38,46,"menu.label_accessories")),o(2),y(t.$auth.user.admin?39:-1),o(),y(t.$settings.env.enableTerminalAccess&&t.$auth.user.admin?40:-1),o(),y(t.$auth.user.admin?41:-1),o(),y(t.$auth.user.admin?42:-1),o(2),c("routerLink",v(65,re))("routerLinkActive","active"),u("aria-label",l(45,48,"support.title")),o(5),g(l(50,50,"support.title")),o(3),c("routerLink",v(66,ae))("routerLinkActive","active"),u("aria-label",l(53,52,"menu.restart.title")),o(5),g(l(58,54,"menu.restart.title")),o(2),y(t.isPwa?59:-1),o(),y(t.$settings.formAuth?60:-1))},dependencies:[N,K,E,D,U],styles:[".m-header[_ngcontent-%COMP%]{position:fixed;top:0;left:0;width:100%;height:65px;z-index:510;display:flex;align-items:center;padding-left:3px;padding-right:3px}.m-header[_ngcontent-%COMP%]:hover{cursor:pointer}@media (min-width: 768px){.m-header[_ngcontent-%COMP%]{display:none}}.sidebar[_ngcontent-%COMP%]{position:fixed;left:0;top:0;height:100vh;transition:.3s;width:60px;z-index:500}.sidebar[_ngcontent-%COMP%] .header[_ngcontent-%COMP%]{display:flex;flex-direction:column;justify-content:center;padding:15px 10px 15px 11px;font-size:.85rem}.sidebar[_ngcontent-%COMP%] .header[_ngcontent-%COMP%]:hover{cursor:pointer}.sidebar[_ngcontent-%COMP%] .link-wrapper[_ngcontent-%COMP%]{overflow-y:auto;max-height:calc(100vh - 80px)!important}.sidebar[_ngcontent-%COMP%] .link-wrapper[_ngcontent-%COMP%] .link[_ngcontent-%COMP%] .link-row[_ngcontent-%COMP%]{display:flex;align-items:center;padding:15px 10px;cursor:pointer;transition:.2s;font-size:17px}.sidebar[_ngcontent-%COMP%] .link-wrapper[_ngcontent-%COMP%] .link[_ngcontent-%COMP%] .link-row[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]{flex:0 0 38px;display:flex;align-items:center;justify-content:center}.sidebar[_ngcontent-%COMP%] .link-wrapper[_ngcontent-%COMP%] .link[_ngcontent-%COMP%] .link-row[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{flex:1;transition:.3s;max-width:0;overflow:hidden;white-space:nowrap}@media (max-width: 767px){.sidebar[_ngcontent-%COMP%]{width:0}.sidebar[_ngcontent-%COMP%] .link-wrapper[_ngcontent-%COMP%]{display:none}}.sidebar.expanded[_ngcontent-%COMP%]{width:210px}@media (max-width: 767px){.sidebar.expanded[_ngcontent-%COMP%]{width:210px}.sidebar.expanded[_ngcontent-%COMP%] .link-wrapper[_ngcontent-%COMP%]{display:block}}.sidebar.expanded[_ngcontent-%COMP%] .link-wrapper[_ngcontent-%COMP%] .link[_ngcontent-%COMP%] .link-row[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{max-width:150px;padding-left:10px}.hamburger-icon[_ngcontent-%COMP%]{margin:-7px 0 0 25px}@media (min-width: 768px){.hb-logo-text[_ngcontent-%COMP%]{color:#fff;position:absolute;top:17px;font-size:22px;padding-left:3px}.sidebar.expanded[_ngcontent-%COMP%] .hb-logo-text[_ngcontent-%COMP%]{opacity:1;left:55px;transition:.3s}.sidebar[_ngcontent-%COMP%]:not(.expanded) .hb-logo-text[_ngcontent-%COMP%]{opacity:0;left:40px;transition:.3s}.hb-logo-text-mobile[_ngcontent-%COMP%], .hamburger-icon[_ngcontent-%COMP%]{display:none!important}}@media (max-width: 767px){.hb-logo-text[_ngcontent-%COMP%]{display:none!important}.hb-logo-text-mobile[_ngcontent-%COMP%]{color:#fff;position:absolute;top:17px;font-size:22px;padding-left:3px;opacity:1;left:55px}.hamburger-icon[_ngcontent-%COMP%]{position:absolute;right:10px;top:28px;width:30px;-webkit-transform:rotate(0deg);-moz-transform:rotate(0deg);-o-transform:rotate(0deg);transform:rotate(0);-webkit-transition:.5s ease-in-out;-moz-transition:.5s ease-in-out;-o-transition:.5s ease-in-out;transition:.5s ease-in-out;cursor:pointer}.hamburger-icon[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{display:block;position:absolute;height:2px;width:100%;background-color:#fff;border-radius:9px;opacity:1;left:0;-webkit-transform:rotate(0deg);-moz-transform:rotate(0deg);-o-transform:rotate(0deg);transform:rotate(0);-webkit-transition:.25s ease-in-out;-moz-transition:.25s ease-in-out;-o-transition:.25s ease-in-out;transition:.25s ease-in-out}.hamburger-icon[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(1){top:0}.hamburger-icon[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(2), .hamburger-icon[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(3){top:10px}.hamburger-icon[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(4){top:20px}.hamburger-icon-cross[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(1){top:10px;width:0;left:50%}.hamburger-icon-cross[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(2){-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);-o-transform:rotate(45deg);transform:rotate(45deg)}.hamburger-icon-cross[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(3){-webkit-transform:rotate(-45deg);-moz-transform:rotate(-45deg);-o-transform:rotate(-45deg);transform:rotate(-45deg)}.hamburger-icon-cross[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(4){top:10px;width:0;left:50%}}"]})}return i})();var we=i=>({sidebarExpanded:i}),Xe=(()=>{class i{$auth=m(B);$modal=m(L);$router=m(V);$settings=m($);$translate=m(P);$ws=m(j);sidebarExpanded=!1;io;constructor(){}ngOnInit(){this.io=this.$ws.connectToNamespace("app"),this.io.socket.on("reconnect",()=>{this.$auth.checkToken()}),this.compareServerUiVersion()}compareServerUiVersion(){return z(this,null,function*(){if(this.$settings.settingsLoaded||(yield A(this.$settings.onSettingsLoaded)),this.$router.url!=="/restart"&&(0,Q.lt)(this.$settings.uiVersion,T.serverTarget)){console.log(`Server restart required. UI Version: ${T.serverTarget} - Server Version: ${this.$settings.uiVersion} `);let e=this.$modal.open(R,{size:"lg",backdrop:"static"});e.componentInstance.title=this.$translate.instant("platform.version.service_restart_required"),e.componentInstance.message=this.$translate.instant("platform.version.restart_required",{serverVersion:this.$settings.uiVersion,uiVersion:T.serverTarget}),e.componentInstance.confirmButtonLabel=this.$translate.instant("menu.tooltip_restart"),e.componentInstance.faIconClass="fas fa-power-off orange-text",e.result.then(()=>this.$router.navigate(["/restart"])).catch(()=>{})}})}static \u0275fac=function(s){return new(s||i)};static \u0275cmp=O({type:i,selectors:[["app-layout"]],decls:3,vars:4,consts:[[3,"isExpanded"],[1,"content","px-3","p-md-4",3,"ngClass"]],template:function(s,t){s&1&&(p(0,"app-sidebar",0),n(1,"div",1),p(2,"router-outlet"),a()),s&2&&(c("isExpanded",t.sidebarExpanded),o(),c("ngClass",M(2,we,t.sidebarExpanded)))},dependencies:[J,E,q],styles:[".content[_ngcontent-%COMP%]{margin-left:60px;transition:.3s;height:100%}@media (max-width: 767px){.content[_ngcontent-%COMP%]{margin-left:0;padding-top:85px!important}}@media (min-width: 768px){.content[_ngcontent-%COMP%]{height:100%}}a[_ngcontent-%COMP%]:hover{text-decoration:none!important}"]})}return i})();export{Xe as LayoutComponent};
|
|
1
|
+
import{a as X}from"./chunk-UR24V3JB.js";import{a as H}from"./chunk-C53ZM5K2.js";import{a as Z}from"./chunk-LTDUXFUG.js";import{a as R}from"./chunk-RSIXVZQ5.js";import{n as L}from"./chunk-YHABGXDF.js";import"./chunk-JOBKDXBH.js";import{a as j}from"./chunk-LEN5ONT7.js";import{a as W,c as q,d as V,e as N,f as D}from"./chunk-QR7L4UUP.js";import{c as B}from"./chunk-GGWS5OR6.js";import{b as $}from"./chunk-Z5JCPUL4.js";import{j as T}from"./chunk-SN7QITJV.js";import"./chunk-ASBFWS7L.js";import{a as P,b as U}from"./chunk-DJKI5XBW.js";import{$a as o,Ac as d,Bc as l,Gb as u,Hb as x,Ib as y,Nb as c,Ob as n,Pb as a,Qb as p,Ub as S,Xb as _,Yb as w,bd as E,eb as F,g as Y,h as z,jc as f,kc as g,la as m,lb as O,ra as h,sa as b,sd as K,vc as v,w as A,wc as M}from"./chunk-U4V4ICSI.js";var Q=Y(Z(),1);function G(){var i;return typeof window<"u"&&(window?.matchMedia("(display-mode: standalone)").matches||((i=window.navigator)===null||i===void 0?void 0:i.standalone)||document.referrer.startsWith("android-app://")||window?.Windows||/trident.+(msapphost|webview)\//i.test(navigator.userAgent)||document.referrer.startsWith("app-info://platform/microsoft-store"))}var I=()=>["/"],te=i=>({"hamburger-icon-cross":i}),ne=i=>({expanded:i}),ie=()=>({exact:!0}),oe=()=>["/accessories"],re=()=>["/support"],ae=()=>["/power-options"],se=()=>["/plugins"],de=()=>["/logs"],le=()=>["/platform-tools/terminal"],pe=()=>["/config"],ce=()=>["/settings"];function me(i,k){if(i&1){let e=S();n(0,"div",10)(1,"div",19),d(2,"translate"),d(3,"translate"),_("click",function(){h(e);let t=w();return b(t.openUnderVoltageModal())})("keydown",function(t){h(e);let r=w();return b(r.handleKeydown(t))}),n(4,"div",12),p(5,"i",20),a(),n(6,"div",14),f(7),d(8,"translate"),a()()()}i&2&&(o(),u("aria-label",l(2,2,"rpi.throttled.undervoltage_title")+" - "+l(3,4,"rpi.throttled.undervoltage_description")),o(6),g(l(8,6,"rpi.throttled.undervoltage_title")))}function ue(i,k){if(i&1){let e=S();n(0,"div",10)(1,"div",15),d(2,"translate"),_("keydown",function(t){h(e);let r=w();return b(r.handleKeydown(t))}),n(3,"div",12),p(4,"i",21),a(),n(5,"div",14),f(6),d(7,"translate"),a()()()}i&2&&(o(),c("routerLink",v(8,se))("routerLinkActive","active"),u("aria-label",l(2,4,"menu.label_plugins")),o(5),g(l(7,6,"menu.label_plugins")))}function _e(i,k){if(i&1){let e=S();n(0,"div",10)(1,"div",15),d(2,"translate"),_("keydown",function(t){h(e);let r=w();return b(r.handleKeydown(t))}),n(3,"div",12),p(4,"i",22),a(),n(5,"div",14),f(6),d(7,"translate"),a()()()}i&2&&(o(),c("routerLink",v(8,de))("routerLinkActive","active"),u("aria-label",l(2,4,"menu.linux.label_logs")),o(5),g(l(7,6,"menu.linux.label_logs")))}function fe(i,k){if(i&1){let e=S();n(0,"div",10)(1,"div",15),d(2,"translate"),_("keydown",function(t){h(e);let r=w();return b(r.handleKeydown(t))}),n(3,"div",12),p(4,"i",23),a(),n(5,"div",14),f(6),d(7,"translate"),a()()()}i&2&&(o(),c("routerLink",v(8,le))("routerLinkActive","active"),u("aria-label",l(2,4,"menu.linux.label_terminal")),o(5),g(l(7,6,"menu.linux.label_terminal")))}function ge(i,k){if(i&1){let e=S();n(0,"div",10)(1,"div",15),d(2,"translate"),_("keydown",function(t){h(e);let r=w();return b(r.handleKeydown(t))}),n(3,"div",12),p(4,"i",24),a(),n(5,"div",14),f(6),d(7,"translate"),a()()()}i&2&&(o(),c("routerLink",v(8,pe))("routerLinkActive","active"),u("aria-label",l(2,4,"menu.config_json_editor")),o(5),g(l(7,6,"menu.config_json_editor")))}function ve(i,k){if(i&1){let e=S();n(0,"div",10)(1,"div",15),d(2,"translate"),_("keydown",function(t){h(e);let r=w();return b(r.handleKeydown(t))}),n(3,"div",12),p(4,"i",25),a(),n(5,"div",14),f(6),d(7,"translate"),a()()()}i&2&&(o(),c("routerLink",v(8,ce))("routerLinkActive","active"),u("aria-label",l(2,4,"menu.label_settings")),o(5),g(l(7,6,"menu.label_settings")))}function he(i,k){if(i&1){let e=S();n(0,"div",10)(1,"div",19),d(2,"translate"),_("click",function(){h(e);let t=w();return b(t.reloadPage())})("keydown",function(t){h(e);let r=w();return b(r.handleKeydown(t))}),n(3,"div",12),p(4,"i",26),a(),n(5,"div",14),f(6),d(7,"translate"),a()()()}i&2&&(o(),u("aria-label",l(2,2,"menu.reload")),o(5),g(l(7,4,"menu.reload")))}function be(i,k){if(i&1){let e=S();n(0,"div",10)(1,"div",19),d(2,"translate"),_("click",function(){h(e);let t=w();return b(t.$auth.logout())})("keydown",function(t){h(e);let r=w();return b(r.handleKeydown(t))}),n(3,"div",12),p(4,"i",27),a(),n(5,"div",14),f(6),d(7,"translate"),a()()()}i&2&&(o(),u("aria-label",l(2,2,"menu.tooltip_logout")),o(5),g(l(7,4,"menu.tooltip_logout")))}var J=(()=>{class i{router=m(V);translate=m(P);$auth=m(B);$settings=m($);$modal=m(L);$notification=m(X);$translate=m(P);renderer=m(F);isExpanded=!1;rPiCurrentlyUnderVoltage=!1;rPiWasUnderVoltage=!1;isMobile=!1;freezeMenu=!1;isPwa=G();constructor(){let e=this.router;this.isMobile=window.innerWidth<768;let s;window.addEventListener("resize",()=>{clearTimeout(s),s=setTimeout(()=>{this.updateListeners()},500)}),e.events.subscribe(t=>{t instanceof W&&(this.closeSidebar(),this.freezeMenu=!0,setTimeout(()=>{this.freezeMenu=!1},750))})}ngOnInit(){this.$notification.raspberryPiThrottled.subscribe(r=>{r["Under Voltage"]&&(this.rPiCurrentlyUnderVoltage=!0),r["Under-voltage has occurred"]&&(this.rPiWasUnderVoltage=!0)});let e=document.querySelector(".sidebar"),s=document.querySelector(".m-header"),t=document.querySelector(".content");this.isMobile?document.addEventListener("touchstart",r=>{if(t.contains(r.target)&&this.isExpanded){r.preventDefault(),this.toggleSidebar();return}!e.contains(r.target)&&!s.contains(r.target)&&this.isExpanded&&(r.preventDefault(),this.closeSidebar())},{passive:!1}):(this.updateListeners(),s.addEventListener("mouseenter",()=>this.openSidebar(),{passive:!1}),s.addEventListener("mouseleave",()=>this.closeSidebar(),{passive:!1}),document.addEventListener("click",r=>{e.contains(r.target)&&r.clientX>60&&this.closeSidebar()},{passive:!1})),this.updateContentStyles()}openSidebar(){this.freezeMenu||(this.isExpanded=!0,this.updateContentStyles())}closeSidebar(){this.freezeMenu||(this.isExpanded=!1,this.updateContentStyles())}toggleSidebar(){this.freezeMenu||(this.isExpanded=!this.isExpanded,this.updateContentStyles())}updateContentStyles(){let e=document.querySelector(".content");this.isExpanded?(this.renderer.setStyle(e,"opacity","20%"),this.renderer.setStyle(e,"pointer-events","none"),this.renderer.setStyle(e,"overflow","hidden")):(this.renderer.removeStyle(e,"opacity"),this.renderer.removeStyle(e,"pointer-events"),this.renderer.removeStyle(e,"overflow"))}openUnderVoltageModal(){let e=this.$modal.open(H,{size:"lg",backdrop:"static"});e.componentInstance.title=this.$translate.instant("rpi.throttled.undervoltage_title"),e.componentInstance.message=this.$translate.instant(this.rPiCurrentlyUnderVoltage?"rpi.throttled.currently_message":"rpi.throttled.previously_message"),e.componentInstance.ctaButtonLabel=this.$translate.instant("form.button_more_info"),e.componentInstance.faIconClass="fas fa-fw fa-bolt yellow-text",e.componentInstance.ctaButtonLink="https://pimylifeup.com/raspberry-pi-low-voltage-warning"}handleKeydown(e){if(e.key==="Enter"){let s=e.target;["menuitem","button"].includes(s.getAttribute("role"))&&s.click()}}reloadPage(){window.location.reload()}updateListeners(){this.isMobile=window.innerWidth<768;let e=document.querySelector(".sidebar");e.removeAllListeners(),(this.isMobile||!this.isMobile&&this.$settings.menuMode!=="freeze")&&(e.addEventListener("mouseenter",()=>this.openSidebar(),{passive:!1}),e.addEventListener("mouseleave",()=>this.closeSidebar(),{passive:!1}))}ngOnDestroy(){document.removeEventListener("touchstart",()=>{}),document.removeEventListener("click",()=>{})}static \u0275fac=function(s){return new(s||i)};static \u0275cmp=O({type:i,selectors:[["app-sidebar"]],inputs:{isExpanded:"isExpanded"},decls:61,vars:67,consts:[["tabindex","0","role","button",1,"m-header","text-end",3,"click","keydown"],[1,"me-2","d-block","d-lg-none",2,"font-size","0.9rem","color","#dddddd"],[3,"routerLink"],["ngSrc","../../../../assets/homebridge-logo.svg","alt","HB Logo","height","35","width","35",2,"height","35px","width","35px"],[1,"hb-logo-text-mobile"],[1,"hamburger-icon",3,"ngClass"],["role","navigation","id","sidebar",1,"sidebar",3,"ngClass"],["tabindex","0","role","button",1,"header",3,"click","keydown"],[1,"hb-logo-text"],[1,"link-wrapper"],[1,"link"],["role","menuitem","tabindex","0",1,"link-row",3,"keydown","routerLink","routerLinkActive","routerLinkActiveOptions"],[1,"icon"],[1,"fa","fa-fw","fa-house"],[1,"title"],["role","menuitem","tabindex","0",1,"link-row",3,"keydown","routerLink","routerLinkActive"],[1,"fa","fa-fw","fa-lightbulb"],[1,"fa","fa-fw","fa-question-circle-o"],[1,"fa","fa-fw","fa-power-off"],["role","menuitem","tabindex","0",1,"link-row",3,"click","keydown"],[1,"fas","fa-fw","fa-bolt","fa-beat","yellow-text",2,"--fa-beat-scale","1.5"],[1,"fa","fa-fw","fa-plug"],[1,"fa","fa-fw","fa-wave-square"],[1,"fa","fa-fw","fa-terminal"],[1,"fa","fa-fw","fa-code"],[1,"fa","fa-fw","fa-cog"],[1,"fa","fa-fw","fa-refresh"],[1,"fa","fa-fw","fa-right-from-bracket"]],template:function(s,t){s&1&&(n(0,"div",0),d(1,"translate"),_("click",function(){return t.toggleSidebar()})("keydown",function(C){return t.handleKeydown(C)}),p(2,"span",1),n(3,"a",2),d(4,"translate"),p(5,"img",3),n(6,"div",4),f(7,"Homebridge"),a()(),n(8,"div",5),p(9,"span")(10,"span")(11,"span")(12,"span"),a()(),n(13,"div",6)(14,"div",7),_("click",function(){return t.toggleSidebar()})("keydown",function(C){return t.handleKeydown(C)}),n(15,"a",2),d(16,"translate"),p(17,"img",3),n(18,"div",8),f(19,"Homebridge"),a()()(),n(20,"div",9)(21,"div",10)(22,"div",11),d(23,"translate"),_("keydown",function(C){return t.handleKeydown(C)}),n(24,"div",12),p(25,"i",13),a(),n(26,"div",14),f(27),d(28,"translate"),a()()(),x(29,me,9,8,"div",10),x(30,ue,8,9,"div",10),n(31,"div",10)(32,"div",15),d(33,"translate"),_("keydown",function(C){return t.handleKeydown(C)}),n(34,"div",12),p(35,"i",16),a(),n(36,"div",14),f(37),d(38,"translate"),a()()(),x(39,_e,8,9,"div",10),x(40,fe,8,9,"div",10),x(41,ge,8,9,"div",10),x(42,ve,8,9,"div",10),n(43,"div",10)(44,"div",15),d(45,"translate"),_("keydown",function(C){return t.handleKeydown(C)}),n(46,"div",12),p(47,"i",17),a(),n(48,"div",14),f(49),d(50,"translate"),a()()(),n(51,"div",10)(52,"div",15),d(53,"translate"),_("keydown",function(C){return t.handleKeydown(C)}),n(54,"div",12),p(55,"i",18),a(),n(56,"div",14),f(57),d(58,"translate"),a()()(),x(59,he,8,6,"div",10),x(60,be,8,6,"div",10),a()()),s&2&&(u("aria-expanded",t.isExpanded?"true":"false")("aria-controls","sidebar")("aria-label",l(1,34,"menu.sidebar.aria_menu")),o(3),c("routerLink",v(56,I)),u("aria-label",l(4,36,"menu.label_status")),o(5),c("ngClass",M(57,te,t.isExpanded)),o(5),c("ngClass",M(59,ne,t.isExpanded)),o(2),c("routerLink",v(61,I)),u("aria-label",l(16,38,"menu.label_status")),o(7),c("routerLink",v(62,I))("routerLinkActive","active")("routerLinkActiveOptions",v(63,ie)),u("aria-label",l(23,40,"menu.label_status")),o(5),g(l(28,42,"menu.label_status")),o(2),y(t.rPiWasUnderVoltage||t.rPiCurrentlyUnderVoltage?29:-1),o(),y(t.$auth.user.admin?30:-1),o(2),c("routerLink",v(64,oe))("routerLinkActive","active"),u("aria-label",l(33,44,"menu.label_accessories")),o(5),g(l(38,46,"menu.label_accessories")),o(2),y(t.$auth.user.admin?39:-1),o(),y(t.$settings.env.enableTerminalAccess&&t.$auth.user.admin?40:-1),o(),y(t.$auth.user.admin?41:-1),o(),y(t.$auth.user.admin?42:-1),o(2),c("routerLink",v(65,re))("routerLinkActive","active"),u("aria-label",l(45,48,"support.title")),o(5),g(l(50,50,"support.title")),o(3),c("routerLink",v(66,ae))("routerLinkActive","active"),u("aria-label",l(53,52,"menu.restart.title")),o(5),g(l(58,54,"menu.restart.title")),o(2),y(t.isPwa?59:-1),o(),y(t.$settings.formAuth?60:-1))},dependencies:[N,K,E,D,U],styles:[".m-header[_ngcontent-%COMP%]{position:fixed;top:0;left:0;width:100%;height:65px;z-index:510;display:flex;align-items:center;padding-left:3px;padding-right:3px}.m-header[_ngcontent-%COMP%]:hover{cursor:pointer}@media (min-width: 768px){.m-header[_ngcontent-%COMP%]{display:none}}.sidebar[_ngcontent-%COMP%]{position:fixed;left:0;top:0;height:100vh;transition:.3s;width:60px;z-index:500}.sidebar[_ngcontent-%COMP%] .header[_ngcontent-%COMP%]{display:flex;flex-direction:column;justify-content:center;padding:15px 10px 15px 11px;font-size:.85rem}.sidebar[_ngcontent-%COMP%] .header[_ngcontent-%COMP%]:hover{cursor:pointer}.sidebar[_ngcontent-%COMP%] .link-wrapper[_ngcontent-%COMP%]{overflow-y:auto;max-height:calc(100vh - 80px)!important}.sidebar[_ngcontent-%COMP%] .link-wrapper[_ngcontent-%COMP%] .link[_ngcontent-%COMP%] .link-row[_ngcontent-%COMP%]{display:flex;align-items:center;padding:15px 10px;cursor:pointer;transition:.2s;font-size:17px}.sidebar[_ngcontent-%COMP%] .link-wrapper[_ngcontent-%COMP%] .link[_ngcontent-%COMP%] .link-row[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]{flex:0 0 38px;display:flex;align-items:center;justify-content:center}.sidebar[_ngcontent-%COMP%] .link-wrapper[_ngcontent-%COMP%] .link[_ngcontent-%COMP%] .link-row[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{flex:1;transition:.3s;max-width:0;overflow:hidden;white-space:nowrap}@media (max-width: 767px){.sidebar[_ngcontent-%COMP%]{width:0}.sidebar[_ngcontent-%COMP%] .link-wrapper[_ngcontent-%COMP%]{display:none}}.sidebar.expanded[_ngcontent-%COMP%]{width:210px}@media (max-width: 767px){.sidebar.expanded[_ngcontent-%COMP%]{width:210px}.sidebar.expanded[_ngcontent-%COMP%] .link-wrapper[_ngcontent-%COMP%]{display:block}}.sidebar.expanded[_ngcontent-%COMP%] .link-wrapper[_ngcontent-%COMP%] .link[_ngcontent-%COMP%] .link-row[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{max-width:150px;padding-left:10px}.hamburger-icon[_ngcontent-%COMP%]{margin:-7px 0 0 25px}@media (min-width: 768px){.hb-logo-text[_ngcontent-%COMP%]{color:#fff;position:absolute;top:17px;font-size:22px;padding-left:3px}.sidebar.expanded[_ngcontent-%COMP%] .hb-logo-text[_ngcontent-%COMP%]{opacity:1;left:55px;transition:.3s}.sidebar[_ngcontent-%COMP%]:not(.expanded) .hb-logo-text[_ngcontent-%COMP%]{opacity:0;left:40px;transition:.3s}.hb-logo-text-mobile[_ngcontent-%COMP%], .hamburger-icon[_ngcontent-%COMP%]{display:none!important}}@media (max-width: 767px){.hb-logo-text[_ngcontent-%COMP%]{display:none!important}.hb-logo-text-mobile[_ngcontent-%COMP%]{color:#fff;position:absolute;top:17px;font-size:22px;padding-left:3px;opacity:1;left:55px}.hamburger-icon[_ngcontent-%COMP%]{position:absolute;right:10px;top:28px;width:30px;-webkit-transform:rotate(0deg);-moz-transform:rotate(0deg);-o-transform:rotate(0deg);transform:rotate(0);-webkit-transition:.5s ease-in-out;-moz-transition:.5s ease-in-out;-o-transition:.5s ease-in-out;transition:.5s ease-in-out;cursor:pointer}.hamburger-icon[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{display:block;position:absolute;height:2px;width:100%;background-color:#fff;border-radius:9px;opacity:1;left:0;-webkit-transform:rotate(0deg);-moz-transform:rotate(0deg);-o-transform:rotate(0deg);transform:rotate(0);-webkit-transition:.25s ease-in-out;-moz-transition:.25s ease-in-out;-o-transition:.25s ease-in-out;transition:.25s ease-in-out}.hamburger-icon[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(1){top:0}.hamburger-icon[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(2), .hamburger-icon[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(3){top:10px}.hamburger-icon[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(4){top:20px}.hamburger-icon-cross[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(1){top:10px;width:0;left:50%}.hamburger-icon-cross[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(2){-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);-o-transform:rotate(45deg);transform:rotate(45deg)}.hamburger-icon-cross[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(3){-webkit-transform:rotate(-45deg);-moz-transform:rotate(-45deg);-o-transform:rotate(-45deg);transform:rotate(-45deg)}.hamburger-icon-cross[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(4){top:10px;width:0;left:50%}}"]})}return i})();var we=i=>({sidebarExpanded:i}),Xe=(()=>{class i{$auth=m(B);$modal=m(L);$router=m(V);$settings=m($);$translate=m(P);$ws=m(j);sidebarExpanded=!1;io;constructor(){}ngOnInit(){this.io=this.$ws.connectToNamespace("app"),this.io.socket.on("reconnect",()=>{this.$auth.checkToken()}),this.compareServerUiVersion()}compareServerUiVersion(){return z(this,null,function*(){if(this.$settings.settingsLoaded||(yield A(this.$settings.onSettingsLoaded)),this.$router.url!=="/restart"&&(0,Q.lt)(this.$settings.uiVersion,T.serverTarget)){console.log(`Server restart required. UI Version: ${T.serverTarget} - Server Version: ${this.$settings.uiVersion} `);let e=this.$modal.open(R,{size:"lg",backdrop:"static"});e.componentInstance.title=this.$translate.instant("platform.version.service_restart_required"),e.componentInstance.message=this.$translate.instant("platform.version.restart_required",{serverVersion:this.$settings.uiVersion,uiVersion:T.serverTarget}),e.componentInstance.confirmButtonLabel=this.$translate.instant("menu.tooltip_restart"),e.componentInstance.faIconClass="fas fa-power-off orange-text",e.result.then(()=>this.$router.navigate(["/restart"])).catch(()=>{})}})}static \u0275fac=function(s){return new(s||i)};static \u0275cmp=O({type:i,selectors:[["app-layout"]],decls:3,vars:4,consts:[[3,"isExpanded"],[1,"content","px-3","p-md-4",3,"ngClass"]],template:function(s,t){s&1&&(p(0,"app-sidebar",0),n(1,"div",1),p(2,"router-outlet"),a()),s&2&&(c("isExpanded",t.sidebarExpanded),o(),c("ngClass",M(2,we,t.sidebarExpanded)))},dependencies:[J,E,q],styles:[".content[_ngcontent-%COMP%]{margin-left:60px;transition:.3s;height:100%}@media (max-width: 767px){.content[_ngcontent-%COMP%]{margin-left:0;padding-top:85px!important}}@media (min-width: 768px){.content[_ngcontent-%COMP%]{height:100%}}a[_ngcontent-%COMP%]:hover{text-decoration:none!important}"]})}return i})();export{Xe as LayoutComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./chunk-
|
|
1
|
+
import"./chunk-6OKYARP4.js";import"./chunk-IREZKHRG.js";import"./chunk-LEN5ONT7.js";import{g as n}from"./chunk-QR7L4UUP.js";import"./chunk-GGWS5OR6.js";import"./chunk-Z5JCPUL4.js";import"./chunk-SN7QITJV.js";import"./chunk-ASBFWS7L.js";import{c as m}from"./chunk-DJKI5XBW.js";import{ha as t,kd as i,mb as r}from"./chunk-U4V4ICSI.js";var d=[{path:"",redirectTo:"/",pathMatch:"full"},{path:"restart-server",loadComponent:()=>import("./chunk-GYHA5VGU.js").then(o=>o.RestartLinuxComponent)},{path:"shutdown-server",loadComponent:()=>import("./chunk-YO42LXJH.js").then(o=>o.ShutdownLinuxComponent)}],u=(()=>{class o{static \u0275fac=function(e){return new(e||o)};static \u0275mod=r({type:o});static \u0275inj=t({imports:[n.forChild(d),n]})}return o})();var g=(()=>{class o{static \u0275fac=function(e){return new(e||o)};static \u0275mod=r({type:o});static \u0275inj=t({imports:[i,m.forChild(),u]})}return o})();export{g as LinuxModule};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as b}from"./chunk-Q7VA22QV.js";import{a as p,b as w}from"./chunk-YXEV6KOV.js";import{a as c}from"./chunk-
|
|
1
|
+
import{a as b}from"./chunk-Q7VA22QV.js";import{a as p,b as w}from"./chunk-YXEV6KOV.js";import{a as c}from"./chunk-LEN5ONT7.js";import{M as i,g as o,ga as m,la as h,n}from"./chunk-U4V4ICSI.js";var d=o(p(),1),a=o(w(),1),l=o(b(),1);var v=(()=>{class e{$ws=h(c);term;io;fitAddon;webLinksAddon;resize;elementResize;constructor(){}destroyTerminal(){this.io.end(),this.term.dispose(),this.resize.complete(),this.elementResize&&this.elementResize.complete()}startTerminal(r,s={},f){this.elementResize=f,this.io=this.$ws.connectToNamespace("platform-tools/terminal"),this.term=new d.Terminal(s),setTimeout(()=>{this.term.loadAddon(this.fitAddon),this.term.loadAddon(this.webLinksAddon)}),this.fitAddon=new a.FitAddon,this.webLinksAddon=new l.WebLinksAddon,this.resize=new n,this.term.open(r.nativeElement),setTimeout(()=>{this.fitAddon.activate(this.term),this.fitAddon.fit()}),this.io.connected.pipe(i(200)).subscribe(()=>{this.startSession()}),this.io.socket.on("disconnect",()=>{this.term.write(`
|
|
2
2
|
\r
|
|
3
3
|
\rTerminal disconnected. Is the server running?
|
|
4
4
|
\r
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"./chunk-
|
|
1
|
+
import{a}from"./chunk-IREZKHRG.js";import"./chunk-SN7QITJV.js";import"./chunk-ASBFWS7L.js";import"./chunk-DJKI5XBW.js";import"./chunk-U4V4ICSI.js";export{a as ShutdownLinuxComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as et,k as it}from"./chunk-4WTLH2XC.js";import{l as X}from"./chunk-ASBFWS7L.js";import{a as tt}from"./chunk-DJKI5XBW.js";import{T as K,e as ut,g as ct,ga as R,h as Q,la as Y,n as G,w as N}from"./chunk-U4V4ICSI.js";var nt=ut((J,Z)=>{(function(M,b){typeof J=="object"&&typeof Z<"u"?Z.exports=b():typeof define=="function"&&define.amd?define(b):(M=typeof globalThis<"u"?globalThis:M||self).dayjs=b()})(J,function(){"use strict";var M=1e3,b=6e4,o=36e5,d="millisecond",$="second",L="minute",O="hour",y="day",W="week",v="month",z="quarter",S="year",_="date",B="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,v),s=t-e<0,a=i.clone().add(n+(s?-1:1),v);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:v,y:S,w:W,d:y,D:_,h:O,m:L,s:$,ms:d,Q:z}[r]||String(r||"").toLowerCase().replace(/s$/,"")},u:function(r){return r===void 0}},x="en",D={};D[x]=at;var E="$isDayjsObject",U=function(r){return r instanceof V||!(!r||!r[E])},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},f=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 f(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[E]=!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()!==B},i.isSame=function(t,n){var e=f(t);return this.startOf(n)<=e&&e<=this.endOf(n)},i.isAfter=function(t,n){return f(t)<this.startOf(n)},i.isBefore=function(t,n){return this.endOf(n)<f(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,p=this.$D,j="set"+(this.$u?"UTC":"");switch(a){case S:return s?c(1,0):c(31,11);case v: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?p-A:p+(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 $: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[v]=a+"Month",e[S]=a+"FullYear",e[O]=a+"Hours",e[L]=a+"Minutes",e[$]=a+"Seconds",e[d]=a+"Milliseconds",e)[s],h=s===y?this.$D+(n-this.$W):n;if(s===v||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 p=f(s);return u.w(p.date(p.date()+Math.round(g*t)),s)};if(a===v)return this.set(v,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[$]=M,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||B;var s=t||"YYYY-MM-DDTHH:mm:ssZ",a=u.z(this),c=this.$H,h=this.$m,l=this.$M,g=e.weekdays,p=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,p,3);case"MMMM":return T(p,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=f(t),l=(h.utcOffset()-this.utcOffset())*b,g=this-h,p=function(){return u.m(a,h)};switch(c){case S:s=p()/12;break;case v:s=p();break;case z:s=p()/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 $:s=g/M;break;default:s=g}return e?s:u.a(s)},i.daysInMonth=function(){return this.endOf(v).$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}(),P=V.prototype;return f.prototype=P,[["$ms",d],["$s",$],["$m",L],["$H",O],["$W",y],["$M",v],["$y",S],["$D",_]].forEach(function(r){P[r[1]]=function(i){return this.$g(i,r[0],r[1])}}),f.extend=function(r,i){return r.$i||(r(i,V,f),r.$i=!0),f},f.locale=I,f.isDayjs=U,f.unix=function(r){return f(1e3*r)},f.en=D[x],f.Ls=D,f.p={},f})});var q=ct(nt(),1);var vt=(()=>{class M{$api=Y(it);$title=Y(X);$toastr=Y(et);$translate=Y(tt);env={};formAuth=!0;uiVersion;theme;lightingMode;currentLightingMode;actualLightingMode;browserLightingMode;menuMode;loginWallpaper;serverTimeOffset=0;defaultTheme="orange";themeList=["orange","red","pink","purple","deep-purple","indigo","blue","blue-grey","cyan","green","teal","grey","brown"];rtl=!1;settingsLoadedSubject=new G;onSettingsLoaded=this.settingsLoadedSubject.pipe(K());settingsLoaded=!1;constructor(){this.getAppSettings()}getAppSettings(){return Q(this,null,function*(){let o=yield N(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.setMenuMode(o.menuMode),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,d){d==="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=this.defaultTheme,N(this.$api.put("/config-editor/ui",{key:"theme",value:o})).catch($=>console.error($)));let d=window.document.querySelector("body");d.classList.remove(`config-ui-x-${this.theme}`),d.classList.remove(`config-ui-x-dark-mode-${this.theme}`),this.theme=o,this.actualLightingMode==="dark"?(d.classList.add(`config-ui-x-dark-mode-${this.theme}`),d.classList.contains("dark-mode")||d.classList.add("dark-mode")):(d.classList.add(`config-ui-x-${this.theme}`),d.classList.contains("dark-mode")&&d.classList.remove("dark-mode"))}setMenuMode(o){this.menuMode=o}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,d){this.env[o]=d}checkServerTime(o){let $=(0,q.default)(o).diff((0,q.default)(),"hour");this.serverTimeOffset=$*60*60,($>=8||$<=-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(d){return new(d||M)};static \u0275prov=R({token:M,factory:M.\u0275fac,providedIn:"root"})}return M})();export{nt as a,vt as b};
|
|
1
|
+
import{h as et,k as it}from"./chunk-SN7QITJV.js";import{l as X}from"./chunk-ASBFWS7L.js";import{a as tt}from"./chunk-DJKI5XBW.js";import{T as K,e as ut,g as ct,ga as R,h as Q,la as Y,n as G,w as N}from"./chunk-U4V4ICSI.js";var nt=ut((J,Z)=>{(function(M,b){typeof J=="object"&&typeof Z<"u"?Z.exports=b():typeof define=="function"&&define.amd?define(b):(M=typeof globalThis<"u"?globalThis:M||self).dayjs=b()})(J,function(){"use strict";var M=1e3,b=6e4,o=36e5,d="millisecond",$="second",L="minute",O="hour",y="day",W="week",v="month",z="quarter",S="year",_="date",B="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,v),s=t-e<0,a=i.clone().add(n+(s?-1:1),v);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:v,y:S,w:W,d:y,D:_,h:O,m:L,s:$,ms:d,Q:z}[r]||String(r||"").toLowerCase().replace(/s$/,"")},u:function(r){return r===void 0}},x="en",D={};D[x]=at;var E="$isDayjsObject",U=function(r){return r instanceof V||!(!r||!r[E])},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},f=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 f(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[E]=!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()!==B},i.isSame=function(t,n){var e=f(t);return this.startOf(n)<=e&&e<=this.endOf(n)},i.isAfter=function(t,n){return f(t)<this.startOf(n)},i.isBefore=function(t,n){return this.endOf(n)<f(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,p=this.$D,j="set"+(this.$u?"UTC":"");switch(a){case S:return s?c(1,0):c(31,11);case v: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?p-A:p+(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 $: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[v]=a+"Month",e[S]=a+"FullYear",e[O]=a+"Hours",e[L]=a+"Minutes",e[$]=a+"Seconds",e[d]=a+"Milliseconds",e)[s],h=s===y?this.$D+(n-this.$W):n;if(s===v||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 p=f(s);return u.w(p.date(p.date()+Math.round(g*t)),s)};if(a===v)return this.set(v,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[$]=M,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||B;var s=t||"YYYY-MM-DDTHH:mm:ssZ",a=u.z(this),c=this.$H,h=this.$m,l=this.$M,g=e.weekdays,p=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,p,3);case"MMMM":return T(p,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=f(t),l=(h.utcOffset()-this.utcOffset())*b,g=this-h,p=function(){return u.m(a,h)};switch(c){case S:s=p()/12;break;case v:s=p();break;case z:s=p()/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 $:s=g/M;break;default:s=g}return e?s:u.a(s)},i.daysInMonth=function(){return this.endOf(v).$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}(),P=V.prototype;return f.prototype=P,[["$ms",d],["$s",$],["$m",L],["$H",O],["$W",y],["$M",v],["$y",S],["$D",_]].forEach(function(r){P[r[1]]=function(i){return this.$g(i,r[0],r[1])}}),f.extend=function(r,i){return r.$i||(r(i,V,f),r.$i=!0),f},f.locale=I,f.isDayjs=U,f.unix=function(r){return f(1e3*r)},f.en=D[x],f.Ls=D,f.p={},f})});var q=ct(nt(),1);var vt=(()=>{class M{$api=Y(it);$title=Y(X);$toastr=Y(et);$translate=Y(tt);env={};formAuth=!0;uiVersion;theme;lightingMode;currentLightingMode;actualLightingMode;browserLightingMode;menuMode;loginWallpaper;serverTimeOffset=0;defaultTheme="orange";themeList=["orange","red","pink","purple","deep-purple","indigo","blue","blue-grey","cyan","green","teal","grey","brown"];rtl=!1;settingsLoadedSubject=new G;onSettingsLoaded=this.settingsLoadedSubject.pipe(K());settingsLoaded=!1;constructor(){this.getAppSettings()}getAppSettings(){return Q(this,null,function*(){let o=yield N(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.setMenuMode(o.menuMode),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,d){d==="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=this.defaultTheme,N(this.$api.put("/config-editor/ui",{key:"theme",value:o})).catch($=>console.error($)));let d=window.document.querySelector("body");d.classList.remove(`config-ui-x-${this.theme}`),d.classList.remove(`config-ui-x-dark-mode-${this.theme}`),this.theme=o,this.actualLightingMode==="dark"?(d.classList.add(`config-ui-x-dark-mode-${this.theme}`),d.classList.contains("dark-mode")||d.classList.add("dark-mode")):(d.classList.add(`config-ui-x-${this.theme}`),d.classList.contains("dark-mode")&&d.classList.remove("dark-mode"))}setMenuMode(o){this.menuMode=o}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,d){this.env[o]=d}checkServerTime(o){let $=(0,q.default)(o).diff((0,q.default)(),"hour");this.serverTimeOffset=$*60*60,($>=8||$<=-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(d){return new(d||M)};static \u0275prov=R({token:M,factory:M.\u0275fac,providedIn:"root"})}return M})();export{nt as a,vt as b};
|
package/public/index.html
CHANGED
|
@@ -16,9 +16,9 @@
|
|
|
16
16
|
<link rel="manifest" href="/assets/manifest.webmanifest"/>
|
|
17
17
|
<meta name="theme-color" content="#140a33" media="(prefers-color-scheme: light)"/>
|
|
18
18
|
<meta name="theme-color" content="#0f0f0f" media="(prefers-color-scheme: dark)"/>
|
|
19
|
-
<link rel="stylesheet" href="styles-
|
|
19
|
+
<link rel="stylesheet" href="styles-N63CIM5W.css" crossorigin="use-credentials"></head>
|
|
20
20
|
|
|
21
21
|
<body>
|
|
22
22
|
<app-root></app-root>
|
|
23
|
-
<link rel="modulepreload" href="chunk-
|
|
23
|
+
<link rel="modulepreload" href="chunk-FTOJQHSN.js"><link rel="modulepreload" href="chunk-5VAXNY3G.js"><link rel="modulepreload" href="chunk-WM3ZC7RY.js"><link rel="modulepreload" href="chunk-N2V5ZY2K.js"><link rel="modulepreload" href="chunk-CY623UQD.js"><link rel="modulepreload" href="chunk-W7INVKJK.js"><link rel="modulepreload" href="chunk-MLNMRNTZ.js"><link rel="modulepreload" href="chunk-YG4ZB7UL.js"><link rel="modulepreload" href="chunk-WEIOAID6.js"><link rel="modulepreload" href="chunk-J5LLBW4H.js"><script src="polyfills-4F4B5XMZ.js" type="module" crossorigin="use-credentials"></script><script src="main-AEAFQN6N.js" type="module" crossorigin="use-credentials"></script></body>
|
|
24
24
|
</html>
|