1 line
14 KiB
JavaScript
1 line
14 KiB
JavaScript
(window.webpackJsonp=window.webpackJsonp||[]).push([[64],{1726:function(t,e,o){"use strict";o.r(e);var a=o(3837),n=o(2083);for(var s in n)["default"].indexOf(s)<0&&function(t){o.d(e,t,(function(){return n[t]}))}(s);o(3178);var r=o(0),i=o(3180),l=o.n(i),u=Object(r.a)(n.default,a.a,a.b,!1,null,"028d4ee6",null);"function"==typeof l.a&&l()(u),e.default=u.exports},1901:function(t,e,o){"use strict";o.r(e);var a=o(1902),n=o.n(a);for(var s in a)["default"].indexOf(s)<0&&function(t){o.d(e,t,(function(){return a[t]}))}(s);e.default=n.a},1902:function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,o(13),o(15),o(21),o(62),o(5);var a={data:function(){return{search:"",hideEmpty:!0}},props:{tokens:{type:Array,required:!0,default:function(){return[]}}},computed:{filtered:function(){var t=this,e=function(t,e){return t.toLowerCase().includes(e.toLowerCase())};return this.tokens.filter((function(e){return!t.hideEmpty||e.value})).filter((function(o){var a=o.value,n=o.token;return!t.search||(e(n,t.search)||e(a,t.search))}))}}};e.default=a},1923:function(t,e,o){"use strict";o(7),o(10),o(6),o(8),o(11);var a=o(1);Object.defineProperty(e,"__esModule",{value:!0}),e.getDiff=e.savePhpFpmTokens=e.getPhpFpmTokens=e.getPhpFpmConfiguration=e.saveDomainCustomization=e.getDomainCustomization=e.getDomainConfig=e.rewriteConfs=e.getDomains=void 0;var n=a(o(2)),s=a(o(38));o(57),o(5),o(13),o(15),o(21),o(79),o(40);var r=a(o(78)),i=o(32);function l(t,e){var o=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),o.push.apply(o,a)}return o}function u(t){for(var e=1;e<arguments.length;e++){var o=null!=arguments[e]?arguments[e]:{};e%2?l(Object(o),!0).forEach((function(e){(0,n.default)(t,e,o[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):l(Object(o)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))}))}return t}var c=i.fp.flow(i.fp.convert.toAppString,i.fp.convert.toLines),p=i.fp.flow((function(t){return t||""}),i.fp.convert.toAppString,i.fp.convert.toAppText),f="/CMD_CUSTOM_HTTPD",m=r.default.get({id:"CUSTOM_HTTPD_DOMAINS",url:f,pagination:!0,after:function(){return i.fp.flow(i.fp.mapProp("domains",i.fp.toTable()),i.fp.mapProp("file",i.fp.feedWith(1,(function(t){return["nginx","nginx_proxy","openlitespeed","httpd"].find((function(e){return"1"===t["have_".concat(e)]}))||"httpd"}))))}});e.getDomains=m;var d=r.default.post({url:f,params:{action:"all",rewrite_confs:!0}});e.rewriteConfs=d;var _=r.default.get({url:f,id:"CH_DOMAIN_CONFIG",schema:{domain:r.default.REQUIRED_STRING,proxy:r.default.OPTIONAL_BOOL},after:function(){return i.fp.flow((function(t){return{tokens:t.AVAILABLE_TOKENS,error:t.CONFIG_ERROR,test:t.CONFIG_TEST,data:t.HTTPD,templates:t}}),i.fp.mapProps({error:i.fp.isEqual("1"),nginx:i.fp.isEqual("1"),data:c,test:p,templates:i.fp.flow(i.fp.filter((function(t,e){return e.includes("VH")})),i.fp.filter(i.fp.getProp("data")),i.fp.toArray,i.fp.mapArrayProps({data:c,custom:i.fp.isEqual("1")})),tokens:i.fp.flow(i.fp.mapValues((function(t,e){return{token:e,value:t}})),i.fp.toArray)}))}});e.getDomainConfig=_;var v=r.default.get({url:f,id:"CH_DOMAIN_CUSTOMIZATION_VALUES",schema:{domain:r.default.REQUIRED_STRING,proxy:r.default.OPTIONAL_BOOL},after:function(){return i.fp.flow(i.fp.project({config:"CONFIG",custom1:"CUSTOM1",custom2:"CUSTOM2",custom3:"CUSTOM3",custom4:"CUSTOM4",custom5:"CUSTOM5",custom6:"CUSTOM6",custom7:"CUSTOM7",custom8:"CUSTOM8",tokens:"AVAILABLE_TOKENS",appendix:"VH1.custom_global_pre_post",tokensCount:"NUM_CUSTOM_TOKENS"}),i.fp.mapProps({config:p,custom1:p,custom2:p,custom3:p,custom4:p,custom5:p,custom6:p,custom7:p,custom8:p,nginx:i.fp.convert.toAppBoolean,tokensCount:i.fp.convert.toAppNumber,tokens:i.fp.flow(i.fp.mapValues((function(t,e){return{token:e,value:t}})),i.fp.toArray),appendix:i.fp.flow(i.fp.setDefault({}),i.fp.filter((function(t,e){return e.includes("CUSTOM")})),i.fp.mapValues(p),i.fp.transformObject((function(t,e){var o=e.match(/^.*(CUSTOM.*)$/),a=(0,s.default)(o,2)[1];return(0,n.default)({},a,{data:t,name:e})})))}))}});e.getDomainCustomization=v;var g=r.default.post({url:f,schema:{proxy:r.default.OPTIONAL_STRING,domain:r.default.REQUIRED_STRING,config:r.default.OPTIONAL_STRING,custom1:r.default.OPTIONAL_STRING,custom2:r.default.OPTIONAL_STRING,custom3:r.default.OPTIONAL_STRING,custom4:r.default.OPTIONAL_STRING,custom5:r.default.OPTIONAL_STRING,custom6:r.default.OPTIONAL_STRING,custom7:r.default.OPTIONAL_STRING,custom8:r.default.OPTIONAL_STRING}});e.saveDomainCustomization=g;var b=r.default.get({url:f,id:"CH_PHP_FPM_CONFIGURATION",schema:{user:r.default.REQUIRED_STRING,"php-fpm":r.default.REQUIRED_STRING},after:function(){return i.fp.flow(i.fp.project({error:"CONFIG_ERROR",test:"CONFIG_TEST",custom1:"CUSTOM1",custom2:"CUSTOM2",global_custom1:"GLOBAL_CUSTOM1",global_custom2:"GLOBAL_CUSTOM2","config.data":"FPM_CONFIG","config.file":"FPM_CONFIG_FILE","config.version":"FPM_VER","template.custom":"PHP_FPM_IS_CUSTOM_TEMPLATE","template.data":"PHP_FPM_TEMPLATE","template.name":"PHP_FPM_TEMPLATE_NAME","template.short":"PHP_FPM_TEMPLATE_NAME_SHORT"}),i.fp.mapProps({error:i.fp.isEqual("1"),test:p,custom1:p,custom2:p,config:i.fp.mapProp("data",c),template:i.fp.mapProps({custom:i.fp.isEqual("1"),data:c})}))}});e.getPhpFpmConfiguration=b;var h=r.default.get({id:"CH_PHP_FPM_TOKENS",url:f,schema:{user:r.default.REQUIRED_STRING,"php-fpm":r.default.REQUIRED_STRING},after:function(){return i.fp.flow(i.fp.getProp("AVAILABLE_TOKENS"),i.fp.mapValues((function(t,e){return{token:e,value:t}})),i.fp.toArray)}});e.getPhpFpmTokens=h;var O=r.default.post({url:f,schema:{user:r.default.REQUIRED_STRING,"php-fpm":r.default.REQUIRED_STRING,custom1:r.default.OPTIONAL_STRING,custom2:r.default.OPTIONAL_STRING,all_php_versions:r.default.OPTIONAL_BOOL}});e.savePhpFpmTokens=O;var T=r.default.get({id:"CH_DIFF",url:"/CMD_TEMPLATE_DIFF",schema:{name:r.default.REQUIRED_STRING},after:function(){return i.fp.flow(i.fp.deleteProp("lines"),i.fp.mapValues((function(t,e){return u(u({},t),{},{number:e})})),i.fp.toArray,i.fp.mapArray(i.fp.moveProp("line","content")),i.fp.mapArrayProps({number:i.fp.convert.toAppNumber,content:function(t){return t?t.replace(/\t/g," "):""}}),i.fp.sortBy("number"))}});e.getDiff=T},2004:function(t,e,o){"use strict";o.r(e);var a=o(2024),n=o(1901);for(var s in n)["default"].indexOf(s)<0&&function(t){o.d(e,t,(function(){return n[t]}))}(s);var r=o(0),i=Object(r.a)(n.default,a.a,a.b,!1,null,null,null);e.default=i.exports},2024:function(t,e,o){"use strict";o.d(e,"a",(function(){return a})),o.d(e,"b",(function(){return n}));var a=function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("ui-dialog",{attrs:{id:"VIEW_ALL_AVAILABLE_TOKENS",size:"normal"}},[o("translate",{attrs:{slot:"title"},slot:"title"},[t._v("View All Available Tokens")]),t._v(" "),o("div",{attrs:{slot:"content"},slot:"content"},[o("ui-form-element",{attrs:{underline:!1}},[o("translate",{attrs:{slot:"title"},slot:"title"},[t._v("\n Filter Tokens\n ")]),t._v(" "),o("ui-input-group",{attrs:{slot:"content"},slot:"content"},[o("input-text",{attrs:{slot:"input"},slot:"input",model:{value:t.search,callback:function(e){t.search=e},expression:"search"}}),t._v(" "),o("ui-button",{attrs:{slot:"additions:right",theme:"light"},on:{click:function(e){t.hideEmpty=!t.hideEmpty}},slot:"additions:right"},[o("input-checkbox",{model:{value:t.hideEmpty,callback:function(e){t.hideEmpty=e},expression:"hideEmpty"}},[o("translate",[t._v("Hide Empty")])],1)],1)],1)],1),t._v(" "),o("ui-r-table",t._b({attrs:{verticalLayout:t.$_Client.isPhone,disablePagination:"",hideBeforeControls:"",unstickHeaders:""}},"ui-r-table",{rows:t.filtered,columns:[{id:"token",label:t.$gettext("Token"),width:"200px"},{id:"value",label:t.$gettext("Value")}],isCheckable:!1},!1))],1)],1)},n=[]},2083:function(t,e,o){"use strict";o.r(e);var a=o(2084),n=o.n(a);for(var s in a)["default"].indexOf(s)<0&&function(t){o.d(e,t,(function(){return a[t]}))}(s);e.default=n.a},2084:function(t,e,o){"use strict";var a=o(1);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n,s=a(o(36)),r=a(o(37)),i=o(1923),l=o(58),u={components:{AvailableTokensDialog:a(o(2004)).default},preload:[function(t){var e=t.user,o=t.version;return(0,i.getPhpFpmConfiguration)({user:e,"php-fpm":o})},function(t){var e=t.user,o=t.version;return(0,i.getPhpFpmTokens)({user:e,"php-fpm":o})}],api:[{command:i.getPhpFpmConfiguration,bind:"config"},{command:i.getPhpFpmTokens,bind:"tokens"}],mixins:[(0,l.$bindTab)({defaultTab:"global_custom1",param:"tab"})],props:{user:{type:String,required:!0},version:{type:String,required:!0}},data:function(){return{global_custom1:"",global_custom2:"",custom1:"",custom2:"",tokensFilter:{search:"",hideEmpty:!0},allPHPVersions:!1}},created:function(){this.custom1=this.$api.config.custom1,this.custom2=this.$api.config.custom2,this.global_custom1=this.$api.config.global_custom1,this.global_custom2=this.$api.config.global_custom2},methods:{save:(n=(0,r.default)(s.default.mark((function t(){return s.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,(0,i.savePhpFpmTokens)({user:this.user,"php-fpm":this.version,custom1:this.custom1,custom2:this.custom2,global_custom1:this.global_custom1,global_custom2:this.global_custom2,all_php_versions:this.allPHPVersions});case 2:(0,i.getPhpFpmConfiguration)({user:this.user,"php-fpm":this.version});case 3:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})}};e.default=u},2861:function(t,e,o){var a=o(3179);a.__esModule&&(a=a.default),"string"==typeof a&&(a=[[t.i,a,""]]),a.locals&&(t.exports=a.locals);(0,o(4).default)("ff3015fc",a,!0,{})},3178:function(t,e,o){"use strict";o(2861)},3179:function(t,e,o){},3180:function(t,e){},3837:function(t,e,o){"use strict";o.d(e,"a",(function(){return a})),o.d(e,"b",(function(){return n}));var a=function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("app-page",{attrs:{id:"custom-httpd-php-fpm"}},[o("ui-grid",{attrs:{slot:"page:title"},slot:"page:title"},[o("translate",{attrs:{"translate-params":{user:t.user,version:t.version}}},[t._v("\n PHP-FPM config customization for %{ user } php-fpm %{ version }\n ")]),t._v(" "),t.$api.config.error?o("ui-badge",{attrs:{theme:"danger",size:"big"}},[o("translate",[t._v("Syntax Error")])],1):t._e()],1),t._v(" "),o("app-page-section",[o("translate",[t._v("Add the code to be inserted into the CUSTOM tokens.")]),t._v(" "),o("ui-tabs",{attrs:{tabs:[{id:"global_custom1",label:t.$gettext("php-fpm Global |CUSTOM1|")},{id:"global_custom2",label:t.$gettext("php-fpm Global |CUSTOM2|")},{id:"custom1",label:"php-fpm "+t.version+" |CUSTOM1|"},{id:"custom2",label:"php-fpm "+t.version+" |CUSTOM2|"}],selected:t.tab},on:{"update:selected":function(e){t.tab=e}}},[o("div",{attrs:{slot:"tab:global_custom1"},slot:"tab:global_custom1"},[o("textarea",{directives:[{name:"model",rawName:"v-model",value:t.global_custom1,expression:"global_custom1"}],domProps:{value:t.global_custom1},on:{input:function(e){e.target.composing||(t.global_custom1=e.target.value)}}}),t._v(" "),o("translate",[t._v("Global custom tokens apply to all php version, but only for this User. Global is added before per-php tokens.")])],1),t._v(" "),o("div",{attrs:{slot:"tab:global_custom2"},slot:"tab:global_custom2"},[o("textarea",{directives:[{name:"model",rawName:"v-model",value:t.global_custom2,expression:"global_custom2"}],domProps:{value:t.global_custom2},on:{input:function(e){e.target.composing||(t.global_custom2=e.target.value)}}}),t._v(" "),o("translate",[t._v("Global custom tokens apply to all php version, but only for this User. Global is added before per-php tokens.")])],1),t._v(" "),o("textarea",{directives:[{name:"model",rawName:"v-model",value:t.custom1,expression:"custom1"}],attrs:{slot:"tab:custom1"},domProps:{value:t.custom1},on:{input:function(e){e.target.composing||(t.custom1=e.target.value)}},slot:"tab:custom1"}),t._v(" "),o("textarea",{directives:[{name:"model",rawName:"v-model",value:t.custom2,expression:"custom2"}],attrs:{slot:"tab:custom2"},domProps:{value:t.custom2},on:{input:function(e){e.target.composing||(t.custom2=e.target.value)}},slot:"tab:custom2"})]),t._v(" "),o("div",{directives:[{name:"flex",rawName:"v-flex",value:{cross:"center",main:"end"},expression:"{ cross: 'center', main: 'end' }"},{name:"margin",rawName:"v-margin",value:[1,,,],expression:"[1,,,]"}]},[o("ui-tooltip",{attrs:{theme:"danger"}},[o("input-checkbox",{directives:[{name:"margin",rawName:"v-margin",value:[0,1],expression:"[0, 1]"}],attrs:{slot:"trigger"},slot:"trigger",model:{value:t.allPHPVersions,callback:function(e){t.allPHPVersions=e},expression:"allPHPVersions"}},[o("translate",[t._v("Save for all PHP versions")])],1),t._v(" "),o("translate",[t._v("\n This assumes your code is valid across all php versions. This will also overwrite any other custom code for other versions.\n ")])],1),t._v(" "),o("ui-button",{attrs:{theme:"safe"},on:{click:t.save}},[o("translate",[t._v("Save")])],1)],1)],1),t._v(" "),o("app-page-section",[o("translate",{attrs:{slot:"section:title"},slot:"section:title"},[t._v("\n "+t._s(t.$api.config.template.name)+"\n ")]),t._v(" "),o("ol",{staticClass:"config limited"},t._l(t.$api.config.template.data,(function(e,a){return o("li",{key:e+a,staticClass:"line"},[o("pre",{staticClass:"line-content",domProps:{textContent:t._s(e)}})])})),0)],1),t._v(" "),o("app-page-section",[o("translate",{attrs:{slot:"section:title"},slot:"section:title"},[t._v("\n "+t._s(t.$api.config.config.file)+"\n ")]),t._v(" "),o("ol",{staticClass:"config limited"},t._l(t.$api.config.config.data,(function(e,a){return o("li",{key:e+a,staticClass:"line"},[o("pre",{staticClass:"line-content",domProps:{textContent:t._s(e)}})])})),0)],1),t._v(" "),t.$api.config.error?o("app-page-section",[o("translate",{attrs:{slot:"section:title"},slot:"section:title"},[t._v("\n Configuration Check\n ")]),t._v(" "),o("pre",{staticClass:"configuration-check",domProps:{textContent:t._s(t.$api.config.test)}})],1):t._e(),t._v(" "),o("ui-link",{attrs:{slot:"bottom:links",bullet:""},on:{click:function(e){t.$dialog("VIEW_ALL_AVAILABLE_TOKENS").open()}},slot:"bottom:links"},[o("translate",[t._v("Available Tokens")])],1),t._v(" "),o("available-tokens-dialog",{attrs:{tokens:t.$api.tokens}})],1)},n=[]}}]); |