1 line
16 KiB
JavaScript
1 line
16 KiB
JavaScript
(window.webpackJsonp=window.webpackJsonp||[]).push([[54],{1282:function(t,e,n){"use strict";n.r(e);var o=n(2978),a=n(1602);for(var r in a)"default"!==r&&function(t){n.d(e,t,(function(){return a[t]}))}(r);n(2459);var i=n(0),s=n(2461),u=n.n(s),p=Object(i.a)(a.default,o.a,o.b,!1,null,"3a8f08e4",null);"function"==typeof u.a&&u()(p),e.default=p.exports},1456:function(t,e,n){"use strict";n.r(e);var o=n(1457),a=n.n(o);for(var r in o)"default"!==r&&function(t){n.d(e,t,(function(){return o[t]}))}(r);e.default=a.a},1457:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var o={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(n){var o=n.value,a=n.token;return!t.search||(e(a,t.search)||e(o,t.search))}))}}};e.default=o},1464:function(t,e,n){"use strict";var o=n(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 a=o(n(2)),r=o(n(17)),i=o(n(30)),s=n(14);function u(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,o)}return n}var p=s.fp.flow(s.fp.convert.toAppString,s.fp.convert.toLines),l=s.fp.flow((function(t){return t||""}),s.fp.convert.toAppString,s.fp.convert.toAppText),c="/CMD_CUSTOM_HTTPD",f=i.default.get({id:"CUSTOM_HTTPD_DOMAINS",url:c,pagination:!0,after:function(){return s.fp.flow(s.fp.mapProp("domains",s.fp.toTable()),s.fp.mapProp("file",s.fp.feedWith(1,(function(t){return["nginx","nginx_proxy","openlitespeed","httpd"].find((function(e){return"1"===t["have_".concat(e)]}))||"httpd"}))))}});e.getDomains=f;var m=i.default.post({url:c,params:{action:"all",rewrite_confs:!0}});e.rewriteConfs=m;var d=i.default.get({url:c,id:"CH_DOMAIN_CONFIG",schema:{domain:i.default.REQUIRED_STRING,proxy:i.default.OPTIONAL_BOOL},after:function(){return s.fp.flow((function(t){return{tokens:t.AVAILABLE_TOKENS,error:t.CONFIG_ERROR,test:t.CONFIG_TEST,data:t.HTTPD,templates:t}}),s.fp.mapProps({error:s.fp.isEqual("1"),nginx:s.fp.isEqual("1"),data:p,test:l,templates:s.fp.flow(s.fp.filter((function(t,e){return e.includes("VH")})),s.fp.filter(s.fp.getProp("data")),s.fp.toArray,s.fp.mapArrayProps({data:p,custom:s.fp.isEqual("1")})),tokens:s.fp.flow(s.fp.mapValues((function(t,e){return{token:e,value:t}})),s.fp.toArray)}))}});e.getDomainConfig=d;var v=i.default.get({url:c,id:"CH_DOMAIN_CUSTOMIZATION_VALUES",schema:{domain:i.default.REQUIRED_STRING,proxy:i.default.OPTIONAL_BOOL},after:function(){return s.fp.flow(s.fp.project({config:"CONFIG",custom1:"CUSTOM1",custom2:"CUSTOM2",custom3:"CUSTOM3",custom4:"CUSTOM4",custom5:"CUSTOM5",custom6:"CUSTOM6",custom7:"CUSTOM7",tokens:"AVAILABLE_TOKENS",appendix:"VH1.custom_global_pre_post",tokensCount:"NUM_CUSTOM_TOKENS"}),s.fp.mapProps({config:l,custom1:l,custom2:l,custom3:l,custom4:l,custom5:l,custom6:l,custom7:l,nginx:s.fp.convert.toAppBoolean,tokensCount:s.fp.convert.toAppNumber,tokens:s.fp.flow(s.fp.mapValues((function(t,e){return{token:e,value:t}})),s.fp.toArray),appendix:s.fp.flow(s.fp.setDefault({}),s.fp.filter((function(t,e){return e.includes("CUSTOM")})),s.fp.mapValues(l),s.fp.transformObject((function(t,e){var n=e.match(/^.*(CUSTOM.*)$/),o=(0,r.default)(n,2)[1];return(0,a.default)({},o,{data:t,name:e})})))}))}});e.getDomainCustomization=v;var _=i.default.post({url:c,schema:{proxy:i.default.OPTIONAL_STRING,domain:i.default.REQUIRED_STRING,config:i.default.OPTIONAL_STRING,custom1:i.default.OPTIONAL_STRING,custom2:i.default.OPTIONAL_STRING,custom3:i.default.OPTIONAL_STRING,custom4:i.default.OPTIONAL_STRING,custom5:i.default.OPTIONAL_STRING,custom6:i.default.OPTIONAL_STRING,custom7:i.default.OPTIONAL_STRING}});e.saveDomainCustomization=_;var h=i.default.get({url:c,id:"CH_PHP_FPM_CONFIGURATION",schema:{user:i.default.REQUIRED_STRING,"php-fpm":i.default.REQUIRED_STRING},after:function(){return s.fp.flow(s.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"}),s.fp.mapProps({error:s.fp.isEqual("1"),test:l,custom1:l,custom2:l,config:s.fp.mapProp("data",p),template:s.fp.mapProps({custom:s.fp.isEqual("1"),data:p})}))}});e.getPhpFpmConfiguration=h;var g=i.default.get({id:"CH_PHP_FPM_TOKENS",url:c,schema:{user:i.default.REQUIRED_STRING,"php-fpm":i.default.REQUIRED_STRING},after:function(){return s.fp.flow(s.fp.getProp("AVAILABLE_TOKENS"),s.fp.mapValues((function(t,e){return{token:e,value:t}})),s.fp.toArray)}});e.getPhpFpmTokens=g;var O=i.default.post({url:c,schema:{user:i.default.REQUIRED_STRING,"php-fpm":i.default.REQUIRED_STRING,custom1:i.default.OPTIONAL_STRING,custom2:i.default.OPTIONAL_STRING,all_php_versions:i.default.OPTIONAL_BOOL}});e.savePhpFpmTokens=O;var b=i.default.get({id:"CH_DIFF",url:"/CMD_TEMPLATE_DIFF",schema:{name:i.default.REQUIRED_STRING},after:function(){return s.fp.flow(s.fp.deleteProp("lines"),s.fp.mapValues((function(t,e){return function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?u(Object(n),!0).forEach((function(e){(0,a.default)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},t,{number:e})})),s.fp.toArray,s.fp.mapArray(s.fp.moveProp("line","content")),s.fp.mapArrayProps({number:s.fp.convert.toAppNumber,content:function(t){return t?t.replace(/\t/g," "):""}}),s.fp.sortBy("number"))}});e.getDiff=b},1536:function(t,e,n){"use strict";n.r(e);var o=n(1550),a=n(1456);for(var r in a)"default"!==r&&function(t){n.d(e,t,(function(){return a[t]}))}(r);var i=n(0),s=Object(i.a)(a.default,o.a,o.b,!1,null,null,null);e.default=s.exports},1550:function(t,e,n){"use strict";var o=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("ui-dialog",{attrs:{id:"VIEW_ALL_AVAILABLE_TOKENS",size:"normal"}},[n("translate",{attrs:{slot:"title"},slot:"title"},[t._v("View All Available Tokens")]),t._v(" "),n("div",{attrs:{slot:"content"},slot:"content"},[n("ui-form-element",{attrs:{underline:!1}},[n("translate",{attrs:{slot:"title"},slot:"title"},[t._v("\n Filter Tokens\n ")]),t._v(" "),n("ui-input-group",{attrs:{slot:"content"},slot:"content"},[n("input-text",{attrs:{slot:"input"},slot:"input",model:{value:t.search,callback:function(e){t.search=e},expression:"search"}}),t._v(" "),n("ui-button",{attrs:{slot:"additions:right",theme:"light"},on:{click:function(e){t.hideEmpty=!t.hideEmpty}},slot:"additions:right"},[n("input-checkbox",{model:{value:t.hideEmpty,callback:function(e){t.hideEmpty=e},expression:"hideEmpty"}},[n("translate",[t._v("Hide Empty")])],1)],1)],1)],1),t._v(" "),n("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)},a=[];n.d(e,"a",(function(){return o})),n.d(e,"b",(function(){return a}))},1602:function(t,e,n){"use strict";n.r(e);var o=n(1603),a=n.n(o);for(var r in o)"default"!==r&&function(t){n.d(e,t,(function(){return o[t]}))}(r);e.default=a.a},1603:function(t,e,n){"use strict";var o=n(10),a=n(1);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=a(n(2)),i=n(1464),s=n(23),u=o(n(6));function p(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,o)}return n}var l={preload:function(t){var e=t.dom,n=t.file;return(0,i.getDomainCustomization)({domain:e,proxy:"nginx_proxy"===n})},components:{AvailableTokensDialog:a(n(1536)).default},api:[{command:i.getDomainCustomization,bind:"customization"}],mixins:[(0,s.$bindTab)({defaultTab:"custom1",param:"tab"})],props:{dom:{type:String,required:!0},file:{type:String,required:!0,validator:function(t){return["nginx_proxy","nginx","httpd","openlitespeed"].includes(t)}}},data:function(){return{config:"",customValues:{}}},computed:{tokensCount:function(){return this.$api.customization.tokensCount},tabs:function(){var t=this,e=u.range(1,this.tokensCount+1);return u.map((function(e){return{id:"custom".concat(e),label:"CUSTOM".concat(e),desc:t.tabDescriptions[e-1]||"",pre:t.appendix["CUSTOM.".concat(e,".pre")]||!1,post:t.appendix["CUSTOM.".concat(e,".post")]||!1}}),e)},values:function(){return this.$api.customization},tokens:function(){return this.values.tokens},filename:function(){return"nginx_proxy"===this.file?"nginx.conf":"".concat(this.file,".conf")},tabDescriptions:function(){return{"nginx.conf":[this.$gettext("Appears at the very top of the template, before setting the variables."),this.$gettext("Appears in ALL location / sections. Use the LOCATION token."),this.$gettext("Appears just before the webapps include."),this.$gettext("The very last entry.")],"httpd.conf":[this.$gettext("Appears at the very top of the template, before setting the variables."),this.$gettext("Appears just before the <Directory> section."),this.$gettext("Appears just before the webapps include."),this.$gettext("The very last entry.")],"openlitespeed.conf":[this.$gettext("Appears at the very top of the template, before setting the variables."),this.$gettext("Appears in scripthandler{} section."),this.$gettext("Appears in ALL context{} sections, used for password protected directories."),this.$gettext("Appears in phpIniOverride{} section."),this.$gettext("Appears in rewrite{} section."),this.$gettext("Appears in vhssl{} section."),this.$gettext("Appears at the end of the virtualHost."),this.$gettext("The very last entry.")]}[this.filename]||[]},appendix:function(){return this.$api.customization.appendix}},methods:{save:function(){(0,i.saveDomainCustomization)(function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?p(Object(n),!0).forEach((function(e){(0,r.default)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):p(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({config:this.config},this.customValues,{domain:this.dom,proxy:"nginx_proxy"===this.file?"yes":"none"}))}},created:function(){var t=this;this.$set(this,"config",this.values.config),this.tabs.forEach((function(e){var n=e.id;return t.$set(t.customValues,n,t.values[n]||"")}))}};e.default=l},1604:function(t,e,n){var o=n(2460);"string"==typeof o&&(o=[[t.i,o,""]]),o.locals&&(t.exports=o.locals);(0,n(5).default)("1ac75304",o,!0,{})},2459:function(t,e,n){"use strict";var o=n(1604);n.n(o).a},2460:function(t,e,n){(t.exports=n(4)(!0)).push([t.i,"textarea[data-v-3a8f08e4]{margin-top:1rem;margin-bottom:3rem;display:block;width:100%;resize:vertical;max-height:unset;min-height:20rem;height:20rem}","",{version:3,sources:["/home/evo/evolution/src/js/pages/admin/custom-httpd/customize.vue"],names:[],mappings:"AAmNA,0BACQ,gBACA,mBACA,cACA,WACA,gBACA,iBACA,iBACA,YAAa,CAAA",file:"customize.vue?vue&type=style&index=0&id=3a8f08e4&lang=scss&scoped=true&",sourcesContent:["\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\ntextarea {\n margin-top: 1rem;\n margin-bottom: 3rem;\n display:block;\n width: 100%;\n resize: vertical;\n max-height: unset;\n min-height: 20rem;\n height: 20rem;\n }\n\n"],sourceRoot:""}])},2461:function(t,e){},2978:function(t,e,n){"use strict";var o=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("app-page",[n("ui-button-link",{attrs:{slot:"header:buttons",name:"admin/custom-httpd/view",params:{dom:t.dom},theme:"primary"},slot:"header:buttons"},[n("translate",[t._v("View")])],1),t._v(" "),n("app-page-section",[n("span",{directives:[{name:"flex",rawName:"v-flex"}]},[n("translate",{attrs:{tag:"h2","translate-params":{domain:t.$p6e.toU(t.dom),filename:t.filename}}},[t._v("\n %{ filename } customization for %{ domain }\n ")]),t._v(" "),n("ui-tooltip",{directives:[{name:"margin",rawName:"v-margin",value:[,,,1],expression:"[,,,1]"}],attrs:{theme:"primary",placement:"bottom"}},[n("span",[n("translate",[t._v("\n Only add the few lines of the server code you need to insert.\n ")]),t._v(" "),n("br"),t._v(" "),"nginx.conf"===t.filename?n("translate",[t._v("\n Do not add a whole server { ... } entry.\n ")]):"openlitespeed.conf"===t.filename?n("translate",[t._v("\n Do not add a whole virtualHost { ... } entry.\n ")]):n("translate",[t._v("\n Do not add a whole <Virtualhost>..</VirtualHost>\n ")])],1)])],1),t._v(" "),n("ui-textarea-group",[t.appendix["CUSTOM.pre"]?[n("template",{slot:"pre:name"},[t._v(t._s(t.appendix["CUSTOM.pre"].name))]),t._v(" "),n("template",{slot:"pre:data"},[t._v(t._s(t.appendix["CUSTOM.pre"].data))])]:t._e(),t._v(" "),n("textarea",{directives:[{name:"model",rawName:"v-model",value:t.config,expression:"config"}],attrs:{slot:"content"},domProps:{value:t.config},on:{input:function(e){e.target.composing||(t.config=e.target.value)}},slot:"content"}),t._v(" "),t.appendix["CUSTOM.post"]?[n("template",{slot:"post:name"},[t._v(t._s(t.appendix["CUSTOM.post"].name))]),t._v(" "),n("template",{slot:"post:data"},[t._v(t._s(t.appendix["CUSTOM.post"].data))])]:t._e()],2)],1),t._v(" "),n("app-page-section",[n("translate",{attrs:{slot:"section:title"},slot:"section:title"},[t._v("Additional CUSTOM tokens")]),t._v(" "),n("ui-tabs",{attrs:{tabs:t.tabs,selected:t.tab},on:{"update:selected":function(e){t.tab=e}}},t._l(t.tabs,(function(e){return n("ui-textarea-group",{key:e.id,attrs:{slot:"tab:"+e.id},slot:"tab:"+e.id},[e.pre?[n("template",{slot:"pre:name"},[t._v(t._s(e.pre.name))]),t._v(" "),n("template",{slot:"pre:data"},[t._v(t._s(e.pre.data))])]:t._e(),t._v(" "),n("textarea",{directives:[{name:"model",rawName:"v-model",value:t.customValues[e.id],expression:"customValues[tab.id]"}],attrs:{slot:"content"},domProps:{value:t.customValues[e.id]},on:{input:function(n){n.target.composing||t.$set(t.customValues,e.id,n.target.value)}},slot:"content"}),t._v(" "),e.post?[n("template",{slot:"post:name"},[t._v(t._s(e.post.name))]),t._v(" "),n("template",{slot:"post:data"},[t._v(t._s(e.post.data))])]:t._e()],2)})),1)],1),t._v(" "),n("ui-button",{attrs:{slot:"footer:buttons",theme:"safe"},on:{click:t.save},slot:"footer:buttons"},[n("translate",[t._v("Save")])],1),t._v(" "),n("ui-link",{attrs:{slot:"bottom:links",bullet:""},on:{click:function(e){t.$dialog("VIEW_ALL_AVAILABLE_TOKENS").open()}},slot:"bottom:links"},[n("translate",[t._v("View All Available Tokens")])],1),t._v(" "),n("available-tokens-dialog",t._b({},"available-tokens-dialog",{tokens:t.tokens},!1))],1)},a=[];n.d(e,"a",(function(){return o})),n.d(e,"b",(function(){return a}))}}]); |