Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 uid=33(www-data) gid=33(www-data) groups=33(www-data) Safe-mode: OFF (not secure) /usr/local/lib/node_modules/homebridge-config-ui-x/public/ drwxr-xr-x | |
| Viewing file: Select action/file-type: !function(){function t(t,i){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,i){if(!t)return;if("string"==typeof t)return e(t,i);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return e(t,i)}(t))||i&&t&&"number"==typeof t.length){n&&(t=n);var o=0,r=function(){};return{s:r,n:function(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,c=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return s=t.done,t},e:function(t){c=!0,a=t},f:function(){try{s||null==n.return||n.return()}finally{if(c)throw a}}}}function e(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function n(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function o(t,e,i){return e&&n(t.prototype,e),i&&n(t,i),t}(self.webpackChunkui=self.webpackChunkui||[]).push([[909],{18909:function(e,n,r){"use strict";r.r(n),r.d(n,{ConfigEditorModule:function(){return P}});var a=r(38583),s=r(3679),c=r(95935),l=r(36592),d=r(63423),u=r(64762),f=r(88701),g=r(37716),m=r(71271),h=r(49344),p=r(79274),b=["class","restore-backup"];function v(t,e){1&t&&(g.TgZ(0,"div",12),g._UZ(1,"i",13),g.qZA())}function y(t,e){if(1&t){var i=g.EpF();g.TgZ(0,"tr"),g.TgZ(1,"td",16),g._uU(2),g.ALo(3,"date"),g.qZA(),g.TgZ(4,"td",17),g.TgZ(5,"a",18),g.NdJ("click",function(){var t=g.CHM(i).$implicit;return g.oxw(2).restore(t.id)}),g._uU(6),g.ALo(7,"translate"),g._UZ(8,"i",19),g.qZA(),g.qZA(),g.qZA()}if(2&t){var n=e.$implicit;g.xp6(2),g.Oqu(g.xi3(3,2,n.timestamp,"medium")),g.xp6(4),g.hij("",g.lcZ(7,5,"config.restore.message_copy_to_editor")," ")}}function w(t,e){if(1&t&&(g.TgZ(0,"table",14),g.TgZ(1,"tbody"),g.YNc(2,y,9,7,"tr",15),g.qZA(),g.qZA()),2&t){var i=g.oxw();g.xp6(2),g.Q6J("ngForOf",i.backupList)}}function k(t,e){1&t&&(g.TgZ(0,"div"),g.TgZ(1,"h3",20),g._uU(2,"No Backups"),g.qZA(),g.qZA()),2&t&&(g.xp6(1),g.Q6J("translate","config.restore.message_no_backups"))}function _(t,e){if(1&t){var i=g.EpF();g.TgZ(0,"button",21),g.NdJ("click",function(){return g.CHM(i),g.oxw().deleteAllBackups()}),g._uU(1,"Remove All Backups"),g.qZA()}2&t&&g.Q6J("translate","config.restore.button_remote_all_backups")}var x=function(){var t=function(){function t(e,n,o,r){i(this,t),this.activeModal=e,this.translate=n,this.$toastr=o,this.$api=r,this.loading=!0,this.backupList=[]}return o(t,[{key:"ngOnInit",value:function(){var t=this;this.$api.get("/config-editor/backups").subscribe(function(e){t.loading=!1,t.backupList=e},function(e){t.loading=!1,t.$toastr.error(e.error.message,t.translate.instant("config.restore.toast_failed_to_load_backups"))})}},{key:"restore",value:function(t){return this.activeModal.close(t)}},{key:"deleteAllBackups",value:function(){var t=this;return this.$api.delete("/config-editor/backups").subscribe(function(e){t.activeModal.dismiss(),t.$toastr.success(t.translate.instant("config.restore.toast_backups_deleted"),t.translate.instant("toast.title_success"))},function(e){return t.$toastr.error(e.error.message,t.translate.instant("config.restore.toast_failed_to_delete_backups"))})}}]),t}();return t.\u0275fac=function(e){return new(e||t)(g.Y36(m.Kz),g.Y36(c.sK),g.Y36(h._W),g.Y36(p.s))},t.\u0275cmp=g.Xpm({type:t,selectors:[["app-config",8,"restore-backup"]],attrs:b,decls:15,vars:6,consts:[[1,"modal-content"],[1,"modal-header"],[1,"modal-title",3,"translate"],["type","button","data-dismiss","modal","aria-label","Close",1,"close",3,"click"],["aria-hidden","true"],[1,"modal-body"],["class","text-center primary-text",4,"ngIf"],["class","table table-borderless table-hover table-sm",4,"ngIf"],[4,"ngIf"],[1,"modal-footer"],["type","button","class","btn btn-elegant mr-auto",3,"translate","click",4,"ngIf"],["type","button","data-dismiss","modal",1,"btn","btn-primary",3,"translate","click"],[1,"text-center","primary-text"],[1,"fa","fa-cog","fa-spin",2,"font-size","72px"],[1,"table","table-borderless","table-hover","table-sm"],[4,"ngFor","ngForOf"],[1,"w-100"],["nowrap",""],[1,"card-link",3,"click"],[1,"fas","fa-arrow-right"],[1,"text-center",3,"translate"],["type","button",1,"btn","btn-elegant","mr-auto",3,"translate","click"]],template:function(t,e){1&t&&(g.TgZ(0,"div",0),g.TgZ(1,"div",1),g.TgZ(2,"h5",2),g._uU(3," Restore Homebridge Config Backup "),g.qZA(),g.TgZ(4,"button",3),g.NdJ("click",function(){return e.activeModal.dismiss("Cross click")}),g.TgZ(5,"span",4),g._uU(6,"\xd7"),g.qZA(),g.qZA(),g.qZA(),g.TgZ(7,"div",5),g.YNc(8,v,2,0,"div",6),g.YNc(9,w,3,1,"table",7),g.YNc(10,k,3,1,"div",8),g.qZA(),g.TgZ(11,"div",9),g.YNc(12,_,2,1,"button",10),g.TgZ(13,"button",11),g.NdJ("click",function(){return e.activeModal.dismiss("Cross click")}),g._uU(14,"Cancel"),g.qZA(),g.qZA(),g.qZA()),2&t&&(g.xp6(2),g.Q6J("translate","config.restore.title_restore_homebridge_backup"),g.xp6(6),g.Q6J("ngIf",e.loading),g.xp6(1),g.Q6J("ngIf",!e.loading&&e.backupList&&e.backupList.length),g.xp6(1),g.Q6J("ngIf",!(e.loading||e.backupList&&e.backupList.length)),g.xp6(2),g.Q6J("ngIf",!e.loading&&e.backupList.length),g.xp6(1),g.Q6J("translate","form.button_cancel"))},directives:[c.Pi,a.O5,a.sg],pipes:[a.uU,c.X$],encapsulation:2}),t}(),A=r(92503),C=r(58605),Z=r(64959),E=r(37319);function M(t,e){if(1&t){var i=g.EpF();g.TgZ(0,"button",15),g.NdJ("click",function(){return g.CHM(i),g.oxw().onCancelRestore()}),g.qZA()}if(2&t){var n=g.oxw();g.Q6J("disabled",n.saveInProgress)}}function T(t,e){1&t&&g._UZ(0,"i",16)}function $(t,e){if(1&t){var i=g.EpF();g.TgZ(0,"ngx-monaco-editor",17),g.NdJ("onInit",function(t){return g.CHM(i),g.oxw().onEditorInit(t)})("keydown.control.s",function(t){g.CHM(i);var e=g.oxw();return t.preventDefault(),e.onSave()})("keydown.meta.s",function(t){g.CHM(i);var e=g.oxw();return t.preventDefault(),e.onSave()}),g.qZA()}if(2&t){var n=g.oxw();g.Q6J("options",n.editorOptions)("model",n.monacoEditorModel)}}function I(t,e){if(1&t){var i=g.EpF();g.TgZ(0,"ngx-monaco-diff-editor",18),g.NdJ("onInit",function(t){return g.CHM(i),g.oxw().onInitDiffEditor(t)})("keydown.control.s",function(t){g.CHM(i);var e=g.oxw();return t.preventDefault(),e.onSave()})("keydown.meta.s",function(t){g.CHM(i);var e=g.oxw();return t.preventDefault(),e.onSave()}),g.qZA()}if(2&t){var n=g.oxw();g.Q6J("options",n.editorOptions)("originalModel",n.monacoEditorModel)("modifiedModel",n.monacoEditorModel)}}function J(t,e){if(1&t){var i=g.EpF();g.TgZ(0,"textarea",19),g.NdJ("ngModelChange",function(t){return g.CHM(i),g.oxw().homebridgeConfig=t}),g._uU(1," "),g.qZA()}if(2&t){var n=g.oxw();g.Q6J("ngModel",n.homebridgeConfig)}}var q,H=function(){var e=function(){function e(t,n,o,r,a,s,c,l,d){i(this,e),this.$settings=t,this.$api=n,this.$md=o,this.$monacoEditor=r,this.$notification=a,this.$toastr=s,this.$route=c,this.translate=l,this.modalService=d,this.isMobile=!1,this.editorOptions={language:"json",theme:this.$settings.theme.startsWith("dark-mode")?"vs-dark":"vs-light",automaticLayout:!0},this.editorDecoractions=[],this.isMobile=this.$md.detect.mobile()}return o(e,[{key:"ngOnInit",value:function(){var t=this;this.visualViewPortEventCallback=function(){return t.visualViewPortChanged()},this.lastHeight=window.innerHeight,window.visualViewport&&!this.isMobile&&(window.visualViewport.addEventListener("resize",this.visualViewPortEventCallback,!0),this.$md.disableTouchMove()),this.$route.data.subscribe(function(e){t.homebridgeConfig=e.config}),this.monacoEditorModel={value:"{}",language:"json",uri:window.monaco?window.monaco.Uri.parse("a://homebridge/config.json"):void 0},window.monaco?this.setMonacoEditorModel():this.$monacoEditor.readyEvent.subscribe({next:function(){t.setMonacoEditorModel()}})}},{key:"onEditorInit",value:function(t){this.monacoEditor=t,this.monacoEditor.getModel().setValue(this.homebridgeConfig),window.editor=t}},{key:"onInitDiffEditor",value:function(t){this.monacoEditor=t.modifiedEditor,t.getModel().original.setValue(this.originalConfig),t.getModel().modified.setValue(this.homebridgeConfig),window.editor=t}},{key:"onSave",value:function(){return(0,u.mG)(this,void 0,void 0,regeneratorRuntime.mark(function e(){var i,n,o,r;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(this.saveInProgress){e.next=54;break}if(this.monacoEditor&&(this.editorDecoractions=this.monacoEditor.deltaDecorations(this.editorDecoractions,[])),this.saveInProgress=!0,e.prev=2,this.isMobile){e.next=25;break}return e.next=6,this.monacoEditor.getAction("editor.action.formatDocument").run();case 6:i=window.monaco.editor.getModelMarkers({owner:"json"}),n=t(i),e.prev=8,n.s();case 10:if((o=n.n()).done){e.next=16;break}if("Duplicate object key"!==o.value.message){e.next=14;break}return e.abrupt("return",(this.saveInProgress=!1,void this.$toastr.error(this.translate.instant("config.toast_config_invalid_json"),this.translate.instant("config.toast_title_config_syntax_error"))));case 14:e.next=10;break;case 16:e.next=21;break;case 18:e.prev=18,e.t0=e.catch(8),n.e(e.t0);case 21:return e.prev=21,n.f(),e.finish(21);case 24:this.homebridgeConfig=this.monacoEditor.getModel().getValue();case 25:if(r=this.parseConfigFromEditor(),this.homebridgeConfig=JSON.stringify(r,null,4),"object"==typeof r.bridge){e.next=31;break}this.$toastr.error(this.translate.instant("config.toast_config_bridge_missing"),this.translate.instant("config.toast_title_config_error")),e.next=48;break;case 31:if(!/^([0-9A-Fa-f]{2}[:]){5}([0-9A-Fa-f]{2})$/.test(r.bridge.username)){e.next=47;break}if(!r.accessories||Array.isArray(r.accessories)){e.next=36;break}this.$toastr.error(this.translate.instant("config.toast_config_accessory_must_be_array"),this.translate.instant("config.toast_title_config_error")),e.next=45;break;case 36:if(!r.platforms||Array.isArray(r.platforms)){e.next=40;break}this.$toastr.error(this.translate.instant("config.toast_config_platform_must_be_array"),this.translate.instant("config.toast_title_config_error")),e.next=45;break;case 40:if(e.t1=r.platforms&&Array.isArray(r.platforms)&&!this.validateSection(r.platforms,"platform")||r.accessories&&Array.isArray(r.accessories)&&!this.validateSection(r.accessories,"accessory")||r.plugins&&Array.isArray(r.plugins)&&!this.validatePlugins(r.plugins,"plugins")||r.disabledPlugins&&Array.isArray(r.disabledPlugins)&&!this.validatePlugins(r.disabledPlugins,"disabledPlugins"),e.t1){e.next=45;break}return e.next=44,this.saveConfig(r);case 44:this.originalConfig="";case 45:e.next=48;break;case 47:this.$toastr.error(this.translate.instant("config.toast_config_username_format_error"),this.translate.instant("config.toast_title_config_error"));case 48:e.next=53;break;case 50:e.prev=50,e.t2=e.catch(2),this.$toastr.error(this.translate.instant("config.toast_config_invalid_json"),this.translate.instant("config.toast_title_config_syntax_error"));case 53:this.saveInProgress=!1;case 54:case"end":return e.stop()}},e,this,[[2,50],[8,18,21,24]])}))}},{key:"parseConfigFromEditor",value:function(){try{return JSON.parse(this.homebridgeConfig)}catch(e){var t=f.parse(this.homebridgeConfig);return this.homebridgeConfig=JSON.stringify(t,null,4),this.monacoEditor&&this.monacoEditor.getModel().setValue(this.homebridgeConfig),t}}},{key:"saveConfig",value:function(t){var e=this;return this.$api.post("/config-editor",t).toPromise().then(function(t){e.$notification.configUpdated.next(),e.$toastr.success(e.translate.instant("config.toast_config_saved"),e.translate.instant("toast.title_success")),e.homebridgeConfig=JSON.stringify(t,null,4)}).catch(function(t){e.$toastr.error(e.translate.instant("config.toast_failed_to_save_config"),e.translate.instant("toast.title_error"))})}},{key:"onRestore",value:function(){var t=this;this.modalService.open(x,{size:"lg"}).result.then(function(e){t.originalConfig||(t.originalConfig=t.homebridgeConfig),t.$api.get("/config-editor/backups/".concat(e)).subscribe(function(e){t.$toastr.warning(t.translate.instant("config.toast_click_save_to_confirm_backup_restore"),t.translate.instant("config.toast_title_backup_loaded")),t.homebridgeConfig=JSON.stringify(e,null,4),t.monacoEditor&&window.editor.modifiedEditor&&(t.editorDecoractions=t.monacoEditor.deltaDecorations(t.editorDecoractions,[]),t.monacoEditor.executeEdits("beautifier",[{identifier:"delete",range:new monaco.Range(1,1,t.monacoEditor.getModel().getLineCount()+10,1),text:"",forceMoveMarkers:!0}]),t.monacoEditor.executeEdits("beautifier",[{identifier:"insert",range:new monaco.Range(1,1,1,1),text:t.homebridgeConfig,forceMoveMarkers:!0}]))},function(e){return t.$toastr.error(e.error.message||"Failed to load config backup",t.translate.instant("toast.title_error"))})}).catch(function(){})}},{key:"onExportConfig",value:function(){var t="data:text/json;charset=utf-8,"+encodeURIComponent(this.homebridgeConfig),e=document.createElement("a");e.setAttribute("href",t),e.setAttribute("download","config.json"),document.body.appendChild(e),e.click(),e.remove()}},{key:"onCancelRestore",value:function(){this.homebridgeConfig=this.originalConfig,this.originalConfig=""}},{key:"validateSection",value:function(e,i){var n,o=t(e);try{for(o.s();!(n=o.n()).done;){var r=n.value;if("object"!=typeof r||Array.isArray(r))return this.$toastr.error("All ".concat(i," blocks must be objects.")),this.highlightOffendingArrayItem(r),!1;if(!r[i])return this.$toastr.error("All ".concat(i,' blocks must contain the "').concat(i,'" attribute.')),this.highlightOffendingArrayItem(r),!1;if("string"!=typeof r[i])return this.$toastr.error('The "'.concat(i,'" attribute must be a string.')),this.highlightOffendingArrayItem(r),!1}}catch(a){o.e(a)}finally{o.f()}return!0}},{key:"validatePlugins",value:function(e,i){var n,o=t(e);try{for(o.s();!(n=o.n()).done;){if("string"!=typeof n.value)return this.$toastr.error("Each item in the ".concat(i," array must be a string.")),!1}}catch(r){o.e(r)}finally{o.f()}return!0}},{key:"highlightOffendingArrayItem",value:function(t){var e=this;this.monacoEditor&&(t=JSON.stringify(t,null,4).split("\n").map(function(t){return" "+t}).join("\n"),setTimeout(function(){var i=e.monacoEditor.getModel().findMatches(t);if(i.length){var n=i[0].range,o=new monaco.Range(n.startLineNumber,n.startColumn,n.endLineNumber,n.endColumn);e.editorDecoractions=e.monacoEditor.deltaDecorations(e.editorDecoractions,[{range:o,options:{isWholeLine:!0,linesDecorationsClassName:"hb-monaco-editor-line-error"}}])}},200))}},{key:"setMonacoEditorModel",value:function(){if(!window.monaco.languages.json.jsonDefaults.diagnosticsOptions.schemas.some(function(t){return"http://homebridge/config.json"===t.uri})){var t=monaco.Uri.parse("a://homebridge/config.json");window.monaco.languages.json.jsonDefaults.setDiagnosticsOptions({allowComments:!1,validate:!0,schemas:[{uri:"http://homebridge/config.json",fileMatch:[t.toString()],schema:{type:"object",required:["bridge"],properties:{bridge:{type:"object",required:["name","username","port","pin"],properties:{name:{type:"string",description:"The Homebridge instance name.\nThis should be unique if you are running multiple instances of Homebridge.",default:"Homebridge"},username:{type:"string",description:"Homebridge username must be 6 pairs of colon-separated hexadecimal characters (A-F 0-9).\nYou should change this pin if you need to re-pair your instance with HomeKit.\nExample: 0E:89:49:64:91:86",default:"0E:89:49:64:91:86",pattern:"^([A-Fa-f0-9]{2}:){5}[A-Fa-f0-9]{2}$"},port:{type:"number",description:"The port Homebridge listens on.\nIf running more than one instance of Homebridge on the same server make sure each instance is given a unique port.",default:51173,minimum:1025,maximum:65534},pin:{type:"string",description:"The Homebridge instance pin.\nThis is used when pairing Homebridge to HomeKit.\nExample: 630-27-655",default:"630-27-655",pattern:"^([0-9]{3}-[0-9]{2}-[0-9]{3})$"},manufacturer:{type:"string",description:"The bridge manufacturer to be displayed in HomeKit"},model:{type:"string",description:"The bridge model to be displayed in HomeKit"},bind:{description:"A string or an array of strings with the name(s) of the network interface(s) Homebridge should bind to.\n\nRequires Homebridge v1.3 or later.",type:["string","array"],items:{type:"string",description:"Network Interface name that Homebridge should bind to."}}},default:{name:"Homebridge",username:"0E:89:49:64:91:86",port:51173,pin:"630-27-655"}},mdns:{type:"object",properties:{interface:{type:"string",description:"The interface or IP address of the interface you want Homebridge to listen on. This is useful if your server has multiple interfaces. \n\nDepreciated as of Homebridge v1.3.0 - use bridge.bind instead."},legacyAdvertiser:{type:"boolean",description:"Set to `false` to use the new mdns library, ciao."}},default:{legacyAdvertiser:!1}},plugins:{type:"array",description:"An array of plugins that should be selectively enabled. Remove this array to enable all plugins.",items:{type:"string",description:"The full plugin npm package name.\nExample: homebridge-dummy"},default:["homebridge-config-ui-x"]},disabledPlugins:{type:"array",description:"An array of plugins that should be disabled.\n\nRequires Homebridge v1.3 or later.",items:{type:"string",description:"The full plugin npm package name.\nExample: homebridge-dummy"},default:[]},ports:{type:"object",description:"The range of ports that should be used for certain accessories like Cameras and TVs",required:["start","end"],properties:{start:{type:"number",default:52100,minimum:1025,maximum:65534},end:{type:"number",default:52150,minimum:1025,maximum:65534}},default:{start:52100,end:52150}},platforms:{type:"array",description:'Plugins that expose a "Platform" should have there config entered in this array.\nSeperate each plugin config block using a comma.',items:{type:"object",required:["platform"],anyOf:[{type:"object",required:["platform"],properties:{platform:{type:"string",description:"This is used by Homebridge to identify which plugin this platform belongs to.",not:{enum:["config"]}},name:{type:"string",description:"The name of the platform."}}},{type:"object",properties:{platform:{type:"string",description:'Homebridge Config UI X platform name must be set to "config".\nDo Not Change!',oneOf:[{enum:"config"}]},name:{type:"string",description:"The name used in the Homebridge log"}}}]}},accessories:{type:"array",description:'Plugins that expose a "Accessory" should have there config entered in this array.\nSeperate each plugin config block using a comma.',items:{type:"object",required:["accessory","name"],properties:{accessory:{type:"string",description:"This is used by Homebridge to identify which plugin this accessory belongs to."},name:{type:"string",description:"The name of the accessory."}}}}}}}]}),this.monacoEditorModel.uri=monaco.Uri.parse("a://homebridge/config.json")}}},{key:"visualViewPortChanged",value:function(){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)}},{key:"ngOnDestroy",value:function(){window.visualViewport&&(window.visualViewport.removeEventListener("resize",this.visualViewPortEventCallback,!0),this.$md.enableTouchMove()),this.monacoEditor&&this.monacoEditor.dispose()}}]),e}();return e.\u0275fac=function(t){return new(t||e)(g.Y36(A.g),g.Y36(p.s),g.Y36(C.L),g.Y36(Z.L),g.Y36(E.g),g.Y36(h._W),g.Y36(d.gz),g.Y36(c.sK),g.Y36(m.FF))},e.\u0275cmp=g.Xpm({type:e,selectors:[["app-config"]],decls:21,vars:16,consts:[[1,"flex-column","d-flex","align-items-stretch","h-100"],[1,"row"],[1,"col-sm-6","d-none","d-sm-block"],[1,"primary-text","m-0"],[1,"d-none","d-md-inline"],[1,"col-sm-6","text-right"],[1,"btn","btn-elegant","waves-effect",3,"translate","click"],["container","body",1,"btn","btn-elegant","waves-effect",3,"ngbTooltip","click"],[1,"fas","fa-download"],["class","btn btn-danger waves-effect","translate","form.button_cancel",3,"disabled","click",4,"ngIf"],[1,"btn","btn-primary","waves-effect",3,"disabled","click"],["class","fas fa-spinner fa-pulse",4,"ngIf"],["class","flex-grow-1 h-100 w-100 mb-3 mt-3",3,"options","model","onInit","keydown.control.s","keydown.meta.s",4,"ngIf"],["class","flex-grow-1 h-100 w-100 mb-3 mt-3",3,"options","originalModel","modifiedModel","onInit","keydown.control.s","keydown.meta.s",4,"ngIf"],["wrap","off","class","hb-plain-text-editor align-self-end h-100 w-100 mb-3 mt-3","autocomplete","off","autocorrect","off","autocapitalize","off","spellcheck","false",3,"ngModel","ngModelChange",4,"ngIf"],["translate","form.button_cancel",1,"btn","btn-danger","waves-effect",3,"disabled","click"],[1,"fas","fa-spinner","fa-pulse"],[1,"flex-grow-1","h-100","w-100","mb-3","mt-3",3,"options","model","onInit","keydown.control.s","keydown.meta.s"],[1,"flex-grow-1","h-100","w-100","mb-3","mt-3",3,"options","originalModel","modifiedModel","onInit","keydown.control.s","keydown.meta.s"],["wrap","off","autocomplete","off","autocorrect","off","autocapitalize","off","spellcheck","false",1,"hb-plain-text-editor","align-self-end","h-100","w-100","mb-3","mt-3",3,"ngModel","ngModelChange"]],template:function(t,e){1&t&&(g.TgZ(0,"div",0),g.TgZ(1,"div",1),g.TgZ(2,"div",2),g.TgZ(3,"h3",3),g.TgZ(4,"span",4),g._uU(5,"Homebridge"),g.qZA(),g._uU(6),g.ALo(7,"translate"),g.qZA(),g.qZA(),g.TgZ(8,"div",5),g.TgZ(9,"button",6),g.NdJ("click",function(){return e.onRestore()}),g.qZA(),g.TgZ(10,"button",7),g.NdJ("click",function(){return e.onExportConfig()}),g.ALo(11,"translate"),g._UZ(12,"i",8),g.qZA(),g.YNc(13,M,1,1,"button",9),g.TgZ(14,"button",10),g.NdJ("click",function(){return e.onSave()}),g._uU(15),g.ALo(16,"translate"),g.YNc(17,T,1,0,"i",11),g.qZA(),g.qZA(),g.qZA(),g.YNc(18,$,1,2,"ngx-monaco-editor",12),g.YNc(19,I,1,3,"ngx-monaco-diff-editor",13),g.YNc(20,J,2,1,"textarea",14),g.qZA()),2&t&&(g.xp6(6),g.hij(" ",g.lcZ(7,10,"config.title_config")," "),g.xp6(3),g.Q6J("translate","config.button_restore"),g.xp6(1),g.s9C("ngbTooltip",g.lcZ(11,12,"logs.label_download")),g.xp6(3),g.Q6J("ngIf",e.originalConfig),g.xp6(1),g.Q6J("disabled",e.saveInProgress),g.xp6(1),g.hij(" ",g.lcZ(16,14,"form.button_save")," "),g.xp6(2),g.Q6J("ngIf",e.saveInProgress),g.xp6(1),g.Q6J("ngIf",!e.isMobile&&!e.originalConfig),g.xp6(1),g.Q6J("ngIf",!e.isMobile&&e.originalConfig),g.xp6(1),g.Q6J("ngIf",e.isMobile))},directives:[c.Pi,m._L,a.O5,l.PG,l.Jj,s.Fj,s.JJ,s.On],pipes:[c.X$],encapsulation:2}),e}(),j=function(){var t=function(){function t(e,n,o){i(this,t),this.$api=e,this.$toastr=n,this.$router=o}return o(t,[{key:"resolve",value:function(t,e){var i=this;return this.$api.get("/config-editor").toPromise().then(function(t){return JSON.stringify(t,null,4)}).catch(function(t){i.$toastr.error(t.message,"Failed to Load Config"),i.$router.navigate(["/"])})}}]),t}();return t.\u0275fac=function(e){return new(e||t)(g.LFG(p.s),g.LFG(h._W),g.LFG(d.F0))},t.\u0275prov=g.Yz7({token:t,factory:t.\u0275fac}),t}(),N=[{path:"",component:H,resolve:{config:j}}],O=function(){var t=function t(){i(this,t)};return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=g.oAB({type:t}),t.\u0275inj=g.cJS({imports:[[d.Bz.forChild(N)],d.Bz]}),t}(),P=((q=function t(){i(this,t)}).\u0275fac=function(t){return new(t||q)},q.\u0275mod=g.oAB({type:q}),q.\u0275inj=g.cJS({providers:[j],imports:[[a.ez,s.u5,s.UX,l.nm,m.IJ,c.aw.forChild(),O]]}),q)}}])}(); |
:: Command execute :: | |
--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0067 ]-- |