homebridge-config-ui-x
Version:
A web based management, configuration and control platform for Homebridge
1 lines • 28.7 kB
JavaScript
(window.webpackJsonp=window.webpackJsonp||[]).push([[10],{RG6s:function(e,l){ace.define("ace/mode/sh_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],(function(e,l,n){"use strict";var t=e("../lib/oop"),r=e("./text_highlight_rules").TextHighlightRules,a=l.reservedKeywords="!|{|}|case|do|done|elif|else|esac|fi|for|if|in|then|until|while|&|;|export|local|read|typeset|unset|elif|select|set|function|declare|readonly",i=l.languageConstructs="[|]|alias|bg|bind|break|builtin|cd|command|compgen|complete|continue|dirs|disown|echo|enable|eval|exec|exit|fc|fg|getopts|hash|help|history|jobs|kill|let|logout|popd|printf|pushd|pwd|return|set|shift|shopt|source|suspend|test|times|trap|type|ulimit|umask|unalias|wait",u=function(){var e=this.createKeywordMapper({keyword:a,"support.function.builtin":i,"invalid.deprecated":"debugger"},"identifier");this.$rules={start:[{token:"constant",regex:/\\./},{token:["text","comment"],regex:/(^|\s)(#.*)$/},{token:"string.start",regex:'"',push:[{token:"constant.language.escape",regex:/\\(?:[$`"\\]|$)/},{include:"variables"},{token:"keyword.operator",regex:/`/},{token:"string.end",regex:'"',next:"pop"},{defaultToken:"string"}]},{token:"string",regex:"\\$'",push:[{token:"constant.language.escape",regex:/\\(?:[abeEfnrtv\\'"]|x[a-fA-F\d]{1,2}|u[a-fA-F\d]{4}([a-fA-F\d]{4})?|c.|\d{1,3})/},{token:"string",regex:"'",next:"pop"},{defaultToken:"string"}]},{regex:"<<<",token:"keyword.operator"},{stateName:"heredoc",regex:"(<<-?)(\\s*)(['\"`]?)([\\w\\-]+)(['\"`]?)",onMatch:function(e,l,n){var t="-"==e[2]?"indentedHeredoc":"heredoc",r=e.split(this.splitRegex);return n.push(t,r[4]),[{type:"constant",value:r[1]},{type:"text",value:r[2]},{type:"string",value:r[3]},{type:"support.class",value:r[4]},{type:"string",value:r[5]}]},rules:{heredoc:[{onMatch:function(e,l,n){return e===n[1]?(n.shift(),n.shift(),this.next=n[0]||"start","support.class"):(this.next="","string")},regex:".*$",next:"start"}],indentedHeredoc:[{token:"string",regex:"^\t+"},{onMatch:function(e,l,n){return e===n[1]?(n.shift(),n.shift(),this.next=n[0]||"start","support.class"):(this.next="","string")},regex:".*$",next:"start"}]}},{regex:"$",token:"empty",next:function(e,l){return"heredoc"===l[0]||"indentedHeredoc"===l[0]?l[0]:e}},{token:["keyword","text","text","text","variable"],regex:/(declare|local|readonly)(\s+)(?:(-[fixar]+)(\s+))?([a-zA-Z_][a-zA-Z0-9_]*\b)/},{token:"variable.language",regex:"(?:\\$(?:SHLVL|\\$|\\!|\\?))"},{token:"variable",regex:"(?:[a-zA-Z_][a-zA-Z0-9_]*(?==))"},{include:"variables"},{token:"support.function",regex:"(?:[a-zA-Z_][a-zA-Z0-9_]*\\s*\\(\\))"},{token:"support.function",regex:"(?:&(?:\\d+))"},{token:"string",start:"'",end:"'"},{token:"constant.numeric",regex:"(?:(?:(?:(?:(?:(?:\\d+)?(?:\\.\\d+))|(?:(?:\\d+)\\.))|(?:\\d+)))|(?:(?:(?:\\d+)?(?:\\.\\d+))|(?:(?:\\d+)\\.)))"},{token:"constant.numeric",regex:"(?:(?:[1-9]\\d*)|(?:0))\\b"},{token:e,regex:"[a-zA-Z_][a-zA-Z0-9_]*\\b"},{token:"keyword.operator",regex:"\\+|\\-|\\*|\\*\\*|\\/|\\/\\/|~|<|>|<=|=>|=|!=|[%&|`]"},{token:"punctuation.operator",regex:";"},{token:"paren.lparen",regex:"[\\[\\(\\{]"},{token:"paren.rparen",regex:"[\\]]"},{token:"paren.rparen",regex:"[\\)\\}]",next:"pop"}],variables:[{token:"variable",regex:/(\$)(\w+)/},{token:["variable","paren.lparen"],regex:/(\$)(\()/,push:"start"},{token:["variable","paren.lparen","keyword.operator","variable","keyword.operator"],regex:/(\$)(\{)([#!]?)(\w+|[*@#?\-$!0_])(:[?+\-=]?|##?|%%?|,,?\/|\^\^?)?/,push:"start"},{token:"variable",regex:/\$[*@#?\-$!0_]/},{token:["variable","paren.lparen"],regex:/(\$)(\{)/,push:"start"}]},this.normalizeRules()};t.inherits(u,r),l.ShHighlightRules=u})),ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"],(function(e,l,n){"use strict";var t=e("../../lib/oop"),r=e("../../range").Range,a=e("./fold_mode").FoldMode,i=l.FoldMode=function(e){e&&(this.foldingStartMarker=new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/,"|"+e.start)),this.foldingStopMarker=new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/,"|"+e.end)))};t.inherits(i,a),(function(){this.foldingStartMarker=/([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/,this.foldingStopMarker=/^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/,this.singleLineBlockCommentRe=/^\s*(\/\*).*\*\/\s*$/,this.tripleStarBlockCommentRe=/^\s*(\/\*\*\*).*\*\/\s*$/,this.startRegionRe=/^\s*(\/\*|\/\/)#?region\b/,this._getFoldWidgetBase=this.getFoldWidget,this.getFoldWidget=function(e,l,n){var t=e.getLine(n);if(this.singleLineBlockCommentRe.test(t)&&!this.startRegionRe.test(t)&&!this.tripleStarBlockCommentRe.test(t))return"";var r=this._getFoldWidgetBase(e,l,n);return!r&&this.startRegionRe.test(t)?"start":r},this.getFoldWidgetRange=function(e,l,n,t){var r,a=e.getLine(n);if(this.startRegionRe.test(a))return this.getCommentRegionBlock(e,a,n);if(r=a.match(this.foldingStartMarker)){var i=r.index;if(r[1])return this.openingBracketBlock(e,r[1],n,i);var u=e.getCommentFoldRange(n,i+r[0].length,1);return u&&!u.isMultiLine()&&(t?u=this.getSectionRange(e,n):"all"!=l&&(u=null)),u}return"markbegin"!==l&&(r=a.match(this.foldingStopMarker))?(i=r.index+r[0].length,r[1]?this.closingBracketBlock(e,r[1],n,i):e.getCommentFoldRange(n,i,-1)):void 0},this.getSectionRange=function(e,l){for(var n=e.getLine(l),t=n.search(/\S/),a=l,i=n.length,u=l+=1,s=e.getLength();++l<s;){var o=(n=e.getLine(l)).search(/\S/);if(-1!==o){if(t>o)break;var d=this.getFoldWidgetRange(e,"all",l);if(d){if(d.start.row<=a)break;if(d.isMultiLine())l=d.end.row;else if(t==o)break}u=l}}return new r(a,i,u,e.getLine(u).length)},this.getCommentRegionBlock=function(e,l,n){for(var t=l.search(/\s*$/),a=e.getLength(),i=n,u=/^\s*(?:\/\*|\/\/|--)#?(end)?region\b/,s=1;++n<a;){l=e.getLine(n);var o=u.exec(l);if(o&&(o[1]?s--:s++,!s))break}if(n>i)return new r(i,t,n,l.length)}}).call(i.prototype)})),ace.define("ace/mode/sh",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/sh_highlight_rules","ace/range","ace/mode/folding/cstyle","ace/mode/behaviour/cstyle"],(function(e,l,n){"use strict";var t=e("../lib/oop"),r=e("./text").Mode,a=e("./sh_highlight_rules").ShHighlightRules,i=e("../range").Range,u=e("./folding/cstyle").FoldMode,s=e("./behaviour/cstyle").CstyleBehaviour,o=function(){this.HighlightRules=a,this.foldingRules=new u,this.$behaviour=new s};t.inherits(o,r),(function(){this.lineCommentStart="#",this.getNextLineIndent=function(e,l,n){var t=this.$getIndent(l),r=this.getTokenizer().getLineTokens(l,e).tokens;return r.length&&"comment"==r[r.length-1].type?t:("start"==e&&l.match(/^.*[\{\(\[:]\s*$/)&&(t+=n),t)};var e={pass:1,return:1,raise:1,break:1,continue:1};this.checkOutdent=function(l,n,t){if("\r\n"!==t&&"\r"!==t&&"\n"!==t)return!1;var r=this.getTokenizer().getLineTokens(n.trim(),l).tokens;if(!r)return!1;do{var a=r.pop()}while(a&&("comment"==a.type||"text"==a.type&&a.value.match(/^\s+$/)));return!!a&&"keyword"==a.type&&e[a.value]},this.autoOutdent=function(e,l,n){var t=this.$getIndent(l.getLine(n+=1)),r=l.getTabString();t.slice(-r.length)==r&&l.remove(new i(n,t.length-r.length,n,t.length))},this.$id="ace/mode/sh"}).call(o.prototype),l.Mode=o}))},xs27:function(e,l,n){"use strict";n.r(l);var t=n("8Y7J");class r{}var a=n("9AJC"),i=n("pMnS"),u=n("TSSN"),s=n("iInd"),o=n("SVse"),d=n("s7LF"),c=n("Vurf"),g=n("HyEY");class p{constructor(e,l,n,t,r,a){this.$auth=e,this.$api=l,this.$fb=n,this.$toastr=t,this.$route=r,this.translate=a}ngOnInit(){this.form=this.$fb.group({HOMEBRIDGE_DEBUG:[!1],HOMEBRIDGE_INSECURE:[!1]}),this.$route.data.subscribe(e=>{this.env=e.env,this.form.patchValue(this.env)}),this.form.valueChanges.subscribe(this.saveSettings.bind(this))}saveSettings(e=this.form.value){this.$api.put("/platform-tools/docker/env",e).subscribe(()=>{this.$toastr.success(this.translate.instant("platform.docker.settings.toast_container_restart_required"),this.translate.instant("platform.docker.settings.toast_title_settings_saved"))})}}var h=n("EApP"),m=t["\u0275crt"]({encapsulation:0,styles:[[".material-switch[_ngcontent-%COMP%] > input[type=checkbox][_ngcontent-%COMP%]{display:none}.material-switch[_ngcontent-%COMP%] > label[_ngcontent-%COMP%]{cursor:pointer;height:0;position:relative;width:40px}.material-switch[_ngcontent-%COMP%] > label[_ngcontent-%COMP%]::before{background:#000;box-shadow:inset 0 0 10px rgba(0,0,0,.5);border-radius:8px;content:'';height:16px;margin-top:-8px;position:absolute;opacity:.3;transition:all .4s ease-in-out;width:40px}.material-switch[_ngcontent-%COMP%] > label[_ngcontent-%COMP%]::after{background:#fff;border-radius:16px;box-shadow:0 0 5px rgba(0,0,0,.3);content:'';height:24px;left:-4px;margin-top:-8px;position:absolute;top:-4px;transition:all .3s ease-in-out;width:24px}.material-switch[_ngcontent-%COMP%] > input[type=checkbox][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]::before{background:inherit;opacity:.5}.material-switch[_ngcontent-%COMP%] > input[type=checkbox][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]::after{background:inherit;left:20px}"]],data:{}});function f(e){return t["\u0275vid"](0,[(e()(),t["\u0275eld"](0,0,null,null,3,"button",[["class","btn btn-primary waves-effect m-0"],["routerLink","/platform-tools/docker/restart-container"]],null,[[null,"click"]],(function(e,l,n){var r=!0;return"click"===l&&(r=!1!==t["\u0275nov"](e,2).onClick()&&r),r}),null,null)),t["\u0275did"](1,8536064,null,0,u.e,[u.l,t.ElementRef,t.ChangeDetectorRef],{translate:[0,"translate"]},null),t["\u0275did"](2,16384,null,0,s.m,[s.l,s.a,[8,null],t.Renderer2,t.ElementRef],{routerLink:[0,"routerLink"]},null),(e()(),t["\u0275ted"](-1,null,["Restart Required"]))],(function(e,l){e(l,1,0,"platform.docker.settings.button_restart_required"),e(l,2,0,"/platform-tools/docker/restart-container")}),null)}function v(e){return t["\u0275vid"](0,[(e()(),t["\u0275eld"](0,0,null,null,4,"div",[["class","alert alert-danger"],["role","alert"]],null,null,null,null,null)),(e()(),t["\u0275ted"](1,null,[" "," "])),t["\u0275pid"](131072,u.k,[u.l,t.ChangeDetectorRef]),(e()(),t["\u0275eld"](3,0,null,null,1,"a",[["href","https://github.com/oznu/docker-homebridge"],["rel","noopener noreferrer"],["target","_blank"]],null,null,null,null,null)),(e()(),t["\u0275ted"](-1,null,["https://github.com/oznu/docker-homebridge"]))],null,(function(e,l){e(l,1,0,t["\u0275unv"](l,1,0,t["\u0275nov"](l,2).transform("platform.docker.settings.message_image_upgrade_required")))}))}function b(e){return t["\u0275vid"](0,[(e()(),t["\u0275eld"](0,0,null,null,6,"div",[["class","d-flex justify-content-between"]],null,null,null,null,null)),(e()(),t["\u0275eld"](1,0,null,null,2,"h3",[["class","primary-text m-0"]],null,null,null,null,null)),t["\u0275did"](2,8536064,null,0,u.e,[u.l,t.ElementRef,t.ChangeDetectorRef],{translate:[0,"translate"]},null),(e()(),t["\u0275ted"](-1,null,["Settings"])),(e()(),t["\u0275eld"](4,0,null,null,2,"div",[["class","text-right"]],null,null,null,null,null)),(e()(),t["\u0275and"](16777216,null,null,1,null,f)),t["\u0275did"](6,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(e()(),t["\u0275eld"](7,0,null,null,6,"div",[["class","row mt-3"]],null,null,null,null,null)),(e()(),t["\u0275eld"](8,0,null,null,5,"div",[["class","col-md-12"]],null,null,null,null,null)),(e()(),t["\u0275and"](16777216,null,null,1,null,v)),t["\u0275did"](10,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(e()(),t["\u0275eld"](11,0,null,null,2,"div",[["class","alert alert-warning"],["role","alert"]],null,null,null,null,null)),t["\u0275did"](12,8536064,null,0,u.e,[u.l,t.ElementRef,t.ChangeDetectorRef],{translate:[0,"translate"]},null),(e()(),t["\u0275ted"](-1,null,[" Changing these values will override the corresponding environment variables you may have set with the docker run command. "])),(e()(),t["\u0275eld"](14,0,null,null,27,"form",[["novalidate",""]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"submit"],[null,"reset"]],(function(e,l,n){var r=!0;return"submit"===l&&(r=!1!==t["\u0275nov"](e,16).onSubmit(n)&&r),"reset"===l&&(r=!1!==t["\u0275nov"](e,16).onReset()&&r),r}),null,null)),t["\u0275did"](15,16384,null,0,d.B,[],null,null),t["\u0275did"](16,540672,null,0,d.k,[[8,null],[8,null]],{form:[0,"form"]},null),t["\u0275prd"](2048,null,d.c,null,[d.k]),t["\u0275did"](18,16384,null,0,d.q,[[4,d.c]],null,null),(e()(),t["\u0275eld"](19,0,null,null,1,"h5",[["class","primary-text"]],null,null,null,null,null)),(e()(),t["\u0275ted"](-1,null,["Homebridge"])),(e()(),t["\u0275eld"](21,0,null,null,20,"ul",[["class","list-group"]],null,null,null,null,null)),(e()(),t["\u0275eld"](22,0,null,null,9,"li",[["class","list-group-item d-flex justify-content-between align-items-center"]],null,null,null,null,null)),(e()(),t["\u0275ted"](-1,null,[" Homebridge Debug Mode "])),(e()(),t["\u0275eld"](24,0,null,null,7,"div",[["class","material-switch pull-right"]],null,null,null,null,null)),(e()(),t["\u0275eld"](25,0,null,null,5,"input",[["formControlName","HOMEBRIDGE_DEBUG"],["id","homebridgeDebugMode"],["type","checkbox"]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"change"],[null,"blur"]],(function(e,l,n){var r=!0;return"change"===l&&(r=!1!==t["\u0275nov"](e,26).onChange(n.target.checked)&&r),"blur"===l&&(r=!1!==t["\u0275nov"](e,26).onTouched()&&r),r}),null,null)),t["\u0275did"](26,16384,null,0,d.b,[t.Renderer2,t.ElementRef],null,null),t["\u0275prd"](1024,null,d.n,(function(e){return[e]}),[d.b]),t["\u0275did"](28,671744,null,0,d.i,[[3,d.c],[8,null],[8,null],[6,d.n],[2,d.z]],{name:[0,"name"]},null),t["\u0275prd"](2048,null,d.o,null,[d.i]),t["\u0275did"](30,16384,null,0,d.p,[[4,d.o]],null,null),(e()(),t["\u0275eld"](31,0,null,null,0,"label",[["class","badge-primary"],["for","homebridgeDebugMode"]],null,null,null,null,null)),(e()(),t["\u0275eld"](32,0,null,null,9,"li",[["class","list-group-item d-flex justify-content-between align-items-center"]],null,null,null,null,null)),(e()(),t["\u0275ted"](-1,null,[" Homebridge Insecure Mode "])),(e()(),t["\u0275eld"](34,0,null,null,7,"div",[["class","material-switch pull-right"]],null,null,null,null,null)),(e()(),t["\u0275eld"](35,0,null,null,5,"input",[["formControlName","HOMEBRIDGE_INSECURE"],["id","homebridgeInsecureMode"],["type","checkbox"]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"change"],[null,"blur"]],(function(e,l,n){var r=!0;return"change"===l&&(r=!1!==t["\u0275nov"](e,36).onChange(n.target.checked)&&r),"blur"===l&&(r=!1!==t["\u0275nov"](e,36).onTouched()&&r),r}),null,null)),t["\u0275did"](36,16384,null,0,d.b,[t.Renderer2,t.ElementRef],null,null),t["\u0275prd"](1024,null,d.n,(function(e){return[e]}),[d.b]),t["\u0275did"](38,671744,null,0,d.i,[[3,d.c],[8,null],[8,null],[6,d.n],[2,d.z]],{name:[0,"name"]},null),t["\u0275prd"](2048,null,d.o,null,[d.i]),t["\u0275did"](40,16384,null,0,d.p,[[4,d.o]],null,null),(e()(),t["\u0275eld"](41,0,null,null,0,"label",[["class","badge-primary"],["for","homebridgeInsecureMode"]],null,null,null,null,null))],(function(e,l){var n=l.component;e(l,2,0,"platform.docker.settings.title_settings"),e(l,6,0,n.form.dirty),e(l,10,0,!n.$auth.env.ableToConfigureSelf),e(l,12,0,"platform.docker.settings.message_env_warning"),e(l,16,0,n.form),e(l,28,0,"HOMEBRIDGE_DEBUG"),e(l,38,0,"HOMEBRIDGE_INSECURE")}),(function(e,l){e(l,14,0,t["\u0275nov"](l,18).ngClassUntouched,t["\u0275nov"](l,18).ngClassTouched,t["\u0275nov"](l,18).ngClassPristine,t["\u0275nov"](l,18).ngClassDirty,t["\u0275nov"](l,18).ngClassValid,t["\u0275nov"](l,18).ngClassInvalid,t["\u0275nov"](l,18).ngClassPending),e(l,25,0,t["\u0275nov"](l,30).ngClassUntouched,t["\u0275nov"](l,30).ngClassTouched,t["\u0275nov"](l,30).ngClassPristine,t["\u0275nov"](l,30).ngClassDirty,t["\u0275nov"](l,30).ngClassValid,t["\u0275nov"](l,30).ngClassInvalid,t["\u0275nov"](l,30).ngClassPending),e(l,35,0,t["\u0275nov"](l,40).ngClassUntouched,t["\u0275nov"](l,40).ngClassTouched,t["\u0275nov"](l,40).ngClassPristine,t["\u0275nov"](l,40).ngClassDirty,t["\u0275nov"](l,40).ngClassValid,t["\u0275nov"](l,40).ngClassInvalid,t["\u0275nov"](l,40).ngClassPending)}))}function k(e){return t["\u0275vid"](0,[(e()(),t["\u0275eld"](0,0,null,null,1,"app-container-settings",[],null,null,null,b,m)),t["\u0275did"](1,114688,null,0,p,[c.a,g.a,d.f,h.j,s.a,u.l],null,null)],(function(e,l){e(l,1,0)}),null)}var x=t["\u0275ccf"]("app-container-settings",p,k,{},{},[]),_=n("gakQ"),y=n("BXrY"),C=(n("tag3"),n("RG6s"),n("rVO2"));class R{constructor(e,l,n,t,r){this.$api=e,this.$md=l,this.$toastr=n,this.translate=t,this.$route=r,this.options={printMargin:!1},l.detect.phone()&&(this.options.showGutter=!1),l.detect.mobile()&&(this.options.fontSize="16px")}ngOnInit(){this.$route.data.subscribe(e=>{this.startupScript=e.startupScript.script})}onSave(){if("#!/bin/sh"!==this.startupScript.split("\n")[0].trim())return this.$toastr.error(this.translate.instant("platform.docker.startup_script.toast_script_must_use_hashbang"),this.translate.instant("platform.docker.startup_script.toast_title_script_error")),void(this.startupScript="#!/bin/sh\n\n"+this.startupScript);this.$api.put("/platform-tools/docker/startup-script",{script:this.startupScript}).subscribe(e=>this.$toastr.success(this.translate.instant("platform.docker.startup_script.toast_restart_required"),this.translate.instant("platform.docker.startup_script.toast_title_script_saved")),e=>this.$toastr.error(e.message,this.translate.instant("toast.title_error")))}}var w=t["\u0275crt"]({encapsulation:0,styles:[[""]],data:{}});function $(e){return t["\u0275vid"](0,[(e()(),t["\u0275eld"](0,0,null,null,18,"div",[["class","flex-column d-flex align-items-stretch h-100"]],null,null,null,null,null)),(e()(),t["\u0275eld"](1,0,null,null,9,"div",[["class","row"]],null,null,null,null,null)),(e()(),t["\u0275eld"](2,0,null,null,4,"div",[["class","col-sm-8 d-none d-sm-block"]],null,null,null,null,null)),(e()(),t["\u0275eld"](3,0,null,null,3,"h3",[["class","primary-text m-0"]],null,null,null,null,null)),(e()(),t["\u0275eld"](4,0,null,null,1,"span",[["class","d-none d-md-inline"]],null,null,null,null,null)),(e()(),t["\u0275ted"](-1,null,["Docker Container"])),(e()(),t["\u0275ted"](-1,null,[" startup.sh"])),(e()(),t["\u0275eld"](7,0,null,null,3,"div",[["class","col-sm-4 text-right"]],null,null,null,null,null)),(e()(),t["\u0275eld"](8,0,null,null,2,"button",[["class","btn btn-primary waves-effect m-0"]],null,[[null,"click"]],(function(e,l,n){var t=!0;return"click"===l&&(t=!1!==e.component.onSave()&&t),t}),null,null)),t["\u0275did"](9,8536064,null,0,u.e,[u.l,t.ElementRef,t.ChangeDetectorRef],{translate:[0,"translate"]},null),(e()(),t["\u0275ted"](-1,null,["Save"])),(e()(),t["\u0275eld"](11,0,null,null,4,"div",[["class","row mt-3"]],null,null,null,null,null)),(e()(),t["\u0275eld"](12,0,null,null,3,"div",[["class","col-md-12"]],null,null,null,null,null)),(e()(),t["\u0275eld"](13,0,null,null,2,"div",[["class","alert alert-warning"],["role","alert"]],null,null,null,null,null)),t["\u0275did"](14,8536064,null,0,u.e,[u.l,t.ElementRef,t.ChangeDetectorRef],{translate:[0,"translate"]},null),(e()(),t["\u0275ted"](-1,null,[" This script will be executed each time the docker container starts. You can use this to install any extra packages your plugins may need such as ffmpeg or libpcap-dev. "])),(e()(),t["\u0275eld"](16,0,null,null,2,"ace-editor",[["class","hb-ace-text-editor align-self-end h-100 mb-3 mt-3"],["mode","sh"],["theme","xcode"]],null,[[null,"textChange"],[null,"keydown.meta.s"],[null,"keydown.control.s"]],(function(e,l,n){var t=!0,r=e.component;return"textChange"===l&&(t=!1!==(r.startupScript=n)&&t),"keydown.meta.s"===l&&(n.preventDefault(),t=!1!==r.onSave()&&t),"keydown.control.s"===l&&(n.preventDefault(),t=!1!==r.onSave()&&t),t}),_.b,_.a)),t["\u0275prd"](5120,null,d.n,(function(e){return[e]}),[y.a]),t["\u0275did"](18,245760,null,0,y.a,[t.ElementRef,t.NgZone],{options:[0,"options"],readOnly:[1,"readOnly"],theme:[2,"theme"],mode:[3,"mode"],text:[4,"text"],autoUpdateContent:[5,"autoUpdateContent"]},{textChange:"textChange"})],(function(e,l){var n=l.component;e(l,9,0,"form.button_save"),e(l,14,0,"platform.docker.startup_script.message_script_help"),e(l,18,0,n.options,!1,"xcode","sh",n.startupScript,!0)}),null)}function S(e){return t["\u0275vid"](0,[(e()(),t["\u0275eld"](0,0,null,null,1,"app-startup-script",[],null,null,null,$,w)),t["\u0275did"](1,114688,null,0,R,[g.a,C.a,h.j,u.l,s.a],null,null)],(function(e,l){e(l,1,0)}),null)}var M=t["\u0275ccf"]("app-startup-script",R,S,{},{},[]),I=n("GFsM"),E=n("vAZj"),D=n("O2so"),O=n("+WIb");class L{constructor(e,l,n,t,r,a){this.$api=e,this.$ws=l,this.$auth=n,this.$toastr=t,this.translate=r,this.$router=a,this.io=this.$ws.connectToNamespace("status"),this.resp={},this.timeout=!1,this.error=!1}ngOnInit(){this.io.connected.subscribe(()=>{this.io.socket.emit("monitor-server-status"),this.$auth.getAppSettings().catch()}),this.$api.put("/platform-tools/docker/restart-container",{}).subscribe(e=>{this.resp=e,this.checkIfServerUp()},e=>{const l=this.translate.instant("restart.toast_server_restart_error");this.error=l+".",this.$toastr.error(`${l}: ${e.message}`,this.translate.instant("toast.title_error"))})}checkIfServerUp(){this.checkDelay=D.a.create(1e4).subscribe(()=>{this.io.socket.on("homebridge-status",e=>{"up"===e.status&&(this.$toastr.success(this.translate.instant("platform.docker.restart_container.toast_container_restarted"),this.translate.instant("toast.title_success")),this.$router.navigate(["/"]))})}),this.checkTimeout=D.a.create(6e4).subscribe(()=>{this.$toastr.warning(this.translate.instant("restart.toast_sever_restart_timeout"),this.translate.instant("toast.title_warning"),{timeOut:1e4}),this.timeout=!0})}ngOnDestroy(){this.io.end(),this.checkDelay&&this.checkDelay.unsubscribe(),this.checkTimeout&&this.checkTimeout.unsubscribe()}}var T=t["\u0275crt"]({encapsulation:2,styles:[],data:{}});function P(e){return t["\u0275vid"](0,[(e()(),t["\u0275eld"](0,0,null,null,1,"app-spinner",[],null,null,null,I.b,I.a)),t["\u0275did"](1,114688,null,0,E.a,[],null,null)],(function(e,l){e(l,1,0)}),null)}function B(e){return t["\u0275vid"](0,[(e()(),t["\u0275eld"](0,0,null,null,2,"p",[["class","grey-text"]],null,null,null,null,null)),t["\u0275did"](1,8536064,null,0,u.e,[u.l,t.ElementRef,t.ChangeDetectorRef],{translate:[0,"translate"]},null),(e()(),t["\u0275ted"](-1,null,[" Please wait, this page will automatically redirect when the Homebridge is back online."]))],(function(e,l){e(l,1,0,"restart.message_please_wait_while_server_restarts")}),null)}function F(e){return t["\u0275vid"](0,[(e()(),t["\u0275eld"](0,0,null,null,1,"p",[["class","grey-text"]],null,null,null,null,null)),(e()(),t["\u0275ted"](1,null,["",""]))],null,(function(e,l){e(l,1,0,l.component.error)}))}function H(e){return t["\u0275vid"](0,[(e()(),t["\u0275eld"](0,0,null,null,8,"div",[],null,null,null,null,null)),(e()(),t["\u0275eld"](1,0,null,null,2,"p",[["class","grey-text"]],null,null,null,null,null)),t["\u0275did"](2,8536064,null,0,u.e,[u.l,t.ElementRef,t.ChangeDetectorRef],{translate:[0,"translate"]},null),(e()(),t["\u0275ted"](-1,null,[" Server restart is taking a long time. You may need to bring up the Docker container manually."])),(e()(),t["\u0275eld"](4,0,null,null,4,"p",[["class","primary-text"]],[[8,"innerHTML",1]],null,null,null,null)),t["\u0275pid"](131072,u.k,[u.l,t.ChangeDetectorRef]),(e()(),t["\u0275ted"](-1,null,["Make sure you're running the Docker container with "])),(e()(),t["\u0275eld"](7,0,null,null,1,"strong",[],null,null,null,null,null)),(e()(),t["\u0275ted"](-1,null,["--restart=always"]))],(function(e,l){e(l,2,0,"platform.docker.restart_container.message_server_taking_long_time_to_restart")}),(function(e,l){e(l,4,0,t["\u0275unv"](l,4,0,t["\u0275nov"](l,5).transform("platform.docker.restart_container.message_run_with_restart_always")))}))}function N(e){return t["\u0275vid"](0,[(e()(),t["\u0275and"](16777216,null,null,1,null,P)),t["\u0275did"](1,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(e()(),t["\u0275eld"](2,0,null,null,12,"div",[["class","row"]],null,null,null,null,null)),(e()(),t["\u0275eld"](3,0,null,null,11,"div",[["class","col-md-12 text-center"]],null,null,null,null,null)),(e()(),t["\u0275eld"](4,0,null,null,1,"h1",[["class","primary-text"]],null,null,null,null,null)),(e()(),t["\u0275eld"](5,0,null,null,0,"i",[["class","fab fa-docker"]],null,null,null,null,null)),(e()(),t["\u0275eld"](6,0,null,null,2,"h3",[["class","primary-text"]],null,null,null,null,null)),t["\u0275did"](7,8536064,null,0,u.e,[u.l,t.ElementRef,t.ChangeDetectorRef],{translate:[0,"translate"]},null),(e()(),t["\u0275ted"](-1,null,["Restarting Docker Container"])),(e()(),t["\u0275and"](16777216,null,null,1,null,B)),t["\u0275did"](10,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(e()(),t["\u0275and"](16777216,null,null,1,null,F)),t["\u0275did"](12,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(e()(),t["\u0275and"](16777216,null,null,1,null,H)),t["\u0275did"](14,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null)],(function(e,l){var n=l.component;e(l,1,0,!n.error),e(l,7,0,"platform.docker.restart_container.title_restarting"),e(l,10,0,!n.timeout&&!n.error),e(l,12,0,n.error),e(l,14,0,n.timeout)}),null)}function z(e){return t["\u0275vid"](0,[(e()(),t["\u0275eld"](0,0,null,null,1,"app-container-restart",[],null,null,null,N,T)),t["\u0275did"](1,245760,null,0,L,[g.a,O.a,c.a,h.j,u.l,s.l],null,null)],(function(e,l){e(l,1,0)}),null)}var A=t["\u0275ccf"]("app-container-restart",L,z,{},{},[]),j=n("G0yt");class G{constructor(e,l,n){this.$api=e,this.$toastr=l,this.$router=n}resolve(e,l){return this.$api.get("/platform-tools/docker/startup-script").toPromise().catch(e=>{this.$toastr.error(e.message,"Failed to Load Startup Script"),this.$router.navigate(["/"])})}}class V{constructor(e,l,n){this.$api=e,this.$toastr=l,this.$router=n}resolve(e,l){return this.$api.get("/platform-tools/docker/env").toPromise().catch(e=>{this.$toastr.error(e.message,"Failed to Load Startup Script"),this.$router.navigate(["/"])})}}var U=n("o6Sk"),q=n("pKmL");class Z{}n.d(l,"DockerModuleNgFactory",(function(){return W}));var W=t["\u0275cmf"](r,[],(function(e){return t["\u0275mod"]([t["\u0275mpd"](512,t.ComponentFactoryResolver,t["\u0275CodegenComponentFactoryResolver"],[[8,[a.a,a.b,a.h,a.i,a.e,a.f,a.g,i.a,x,M,A]],[3,t.ComponentFactoryResolver],t.NgModuleRef]),t["\u0275mpd"](4608,o.NgLocalization,o.NgLocaleLocalization,[t.LOCALE_ID,[2,o["\u0275angular_packages_common_common_a"]]]),t["\u0275mpd"](4608,d.y,d.y,[]),t["\u0275mpd"](4608,d.f,d.f,[]),t["\u0275mpd"](4608,j.v,j.v,[t.ComponentFactoryResolver,t.Injector,j.qb,j.w]),t["\u0275mpd"](4608,u.h,u.g,[]),t["\u0275mpd"](4608,u.c,u.f,[]),t["\u0275mpd"](4608,u.j,u.d,[]),t["\u0275mpd"](4608,u.b,u.a,[]),t["\u0275mpd"](4608,u.l,u.l,[u.m,u.h,u.c,u.j,u.b,u.n,u.o]),t["\u0275mpd"](4608,G,G,[g.a,h.j,s.l]),t["\u0275mpd"](4608,V,V,[g.a,h.j,s.l]),t["\u0275mpd"](1073742336,o.CommonModule,o.CommonModule,[]),t["\u0275mpd"](1073742336,d.x,d.x,[]),t["\u0275mpd"](1073742336,d.l,d.l,[]),t["\u0275mpd"](1073742336,d.u,d.u,[]),t["\u0275mpd"](1073742336,U.a,U.a,[]),t["\u0275mpd"](1073742336,j.c,j.c,[]),t["\u0275mpd"](1073742336,j.g,j.g,[]),t["\u0275mpd"](1073742336,j.i,j.i,[]),t["\u0275mpd"](1073742336,j.m,j.m,[]),t["\u0275mpd"](1073742336,j.n,j.n,[]),t["\u0275mpd"](1073742336,j.s,j.s,[]),t["\u0275mpd"](1073742336,j.t,j.t,[]),t["\u0275mpd"](1073742336,j.x,j.x,[]),t["\u0275mpd"](1073742336,j.C,j.C,[]),t["\u0275mpd"](1073742336,j.H,j.H,[]),t["\u0275mpd"](1073742336,j.K,j.K,[]),t["\u0275mpd"](1073742336,j.P,j.P,[]),t["\u0275mpd"](1073742336,j.S,j.S,[]),t["\u0275mpd"](1073742336,j.X,j.X,[]),t["\u0275mpd"](1073742336,j.ab,j.ab,[]),t["\u0275mpd"](1073742336,j.db,j.db,[]),t["\u0275mpd"](1073742336,j.eb,j.eb,[]),t["\u0275mpd"](1073742336,j.y,j.y,[]),t["\u0275mpd"](1073742336,u.i,u.i,[]),t["\u0275mpd"](1073742336,q.a,q.a,[]),t["\u0275mpd"](1073742336,s.p,s.p,[[2,s.u],[2,s.l]]),t["\u0275mpd"](1073742336,Z,Z,[]),t["\u0275mpd"](1073742336,r,r,[]),t["\u0275mpd"](1024,s.j,(function(){return[[{path:"",redirectTo:"/",pathMatch:"full"},{path:"settings",component:p,resolve:{env:V}},{path:"startup-script",component:R,resolve:{startupScript:G}},{path:"restart-container",component:L}]]}),[]),t["\u0275mpd"](256,u.o,void 0,[]),t["\u0275mpd"](256,u.n,void 0,[])])}))}}]);