← Back
Editing: global-setting-legacy.js
!function(){function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}function t(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */t=function(){return r};var n,r={},o=Object.prototype,a=o.hasOwnProperty,i=Object.defineProperty||function(e,t,n){e[t]=n.value},l="function"==typeof Symbol?Symbol:{},u=l.iterator||"@@iterator",c=l.asyncIterator||"@@asyncIterator",s=l.toStringTag||"@@toStringTag";function f(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(n){f=function(e,t,n){return e[t]=n}}function p(e,t,n,r){var o=t&&t.prototype instanceof _?t:_,a=Object.create(o.prototype),l=new V(r||[]);return i(a,"_invoke",{value:k(e,n,l)}),a}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}r.wrap=p;var h="suspendedStart",v="suspendedYield",g="executing",y="completed",m={};function _(){}function x(){}function b(){}var w={};f(w,u,(function(){return this}));var P=Object.getPrototypeOf,C=P&&P(P(O([])));C&&C!==o&&a.call(C,u)&&(w=C);var L=b.prototype=_.prototype=Object.create(w);function I(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function j(t,n){function r(o,i,l,u){var c=d(t[o],t,i);if("throw"!==c.type){var s=c.arg,f=s.value;return f&&"object"==e(f)&&a.call(f,"__await")?n.resolve(f.__await).then((function(e){r("next",e,l,u)}),(function(e){r("throw",e,l,u)})):n.resolve(f).then((function(e){s.value=e,l(s)}),(function(e){return r("throw",e,l,u)}))}u(c.arg)}var o;i(this,"_invoke",{value:function(e,t){function a(){return new n((function(n,o){r(e,t,n,o)}))}return o=o?o.then(a,a):a()}})}function k(e,t,r){var o=h;return function(a,i){if(o===g)throw Error("Generator is already running");if(o===y){if("throw"===a)throw i;return{value:n,done:!0}}for(r.method=a,r.arg=i;;){var l=r.delegate;if(l){var u=E(l,r);if(u){if(u===m)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===h)throw o=y,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=g;var c=d(e,t,r);if("normal"===c.type){if(o=r.done?y:v,c.arg===m)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(o=y,r.method="throw",r.arg=c.arg)}}}function E(e,t){var r=t.method,o=e.iterator[r];if(o===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=n,E(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),m;var a=d(o,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,m;var i=a.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=n),t.delegate=null,m):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,m)}function F(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function S(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function V(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(F,this),this.reset(!0)}function O(t){if(t||""===t){var r=t[u];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function e(){for(;++o<t.length;)if(a.call(t,o))return e.value=t[o],e.done=!1,e;return e.value=n,e.done=!0,e};return i.next=i}}throw new TypeError(e(t)+" is not iterable")}return x.prototype=b,i(L,"constructor",{value:b,configurable:!0}),i(b,"constructor",{value:x,configurable:!0}),x.displayName=f(b,s,"GeneratorFunction"),r.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===x||"GeneratorFunction"===(t.displayName||t.name))},r.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,f(e,s,"GeneratorFunction")),e.prototype=Object.create(L),e},r.awrap=function(e){return{__await:e}},I(j.prototype),f(j.prototype,c,(function(){return this})),r.AsyncIterator=j,r.async=function(e,t,n,o,a){void 0===a&&(a=Promise);var i=new j(p(e,t,n,o),a);return r.isGeneratorFunction(t)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},I(L),f(L,s,"Generator"),f(L,u,(function(){return this})),f(L,"toString",(function(){return"[object Generator]"})),r.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},r.values=O,V.prototype={constructor:V,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=n,this.done=!1,this.delegate=null,this.method="next",this.arg=n,this.tryEntries.forEach(S),!e)for(var t in this)"t"===t.charAt(0)&&a.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=n)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(r,o){return l.type="throw",l.arg=e,t.next=r,o&&(t.method="next",t.arg=n),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],l=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var u=a.call(i,"catchLoc"),c=a.call(i,"finallyLoc");if(u&&c){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&a.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var o=r;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,m):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),m},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),S(n),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;S(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:O(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=n),m}},r}function n(e,t,n,r,o,a,i){try{var l=e[a](i),u=l.value}catch(e){return void n(e)}l.done?t(u):Promise.resolve(u).then(r,o)}function r(e){return function(){var t=this,r=arguments;return new Promise((function(o,a){var i=e.apply(t,r);function l(e){n(i,o,a,l,u,"next",e)}function u(e){n(i,o,a,l,u,"throw",e)}l(void 0)}))}}System.register(["./base-lib-legacy.js?v=VERSION_NUMBER","./utils-lib-legacy.js?v=VERSION_NUMBER","./index-legacy101.js?v=VERSION_NUMBER","./validator-legacy.js?v=VERSION_NUMBER","./useController-legacy6.js?v=VERSION_NUMBER","./site-legacy.js?v=VERSION_NUMBER","./__commonjsHelpers__-legacy.js?v=VERSION_NUMBER","./index-legacy104.js?v=VERSION_NUMBER","./column-legacy.js?v=VERSION_NUMBER","./useStore-legacy4.js?v=VERSION_NUMBER"],(function(e,n){"use strict";var o,a,i,l,u,c,s,f,p,d,h,v,g,y,m,_,x,b,w,P,C,L,I,j,k,E,F,S,V,O,G,T,X,N,R,U,q,A;return{setters:[function(e){o=e.c,a=e.r,i=e.k,l=e.aB,u=e.p,c=e.G,s=e.H,f=e.x,p=e.q,d=e.v,h=e.y,v=e.e,g=e.A,y=e.B,m=e.F,_=e.I,x=e.C,b=e.al,w=e.a9,P=e.D,C=e.a7,L=e.a$,I=e.c2},function(e){j=e.u,k=e.p,E=e.at,F=e.K,S=e.W,V=e.b,O=e.e},function(e){G=e._},function(e){T=e.f},function(e){X=e.o},function(e){N=e.getGloalSetting,R=e.setSitesLogPath,U=e.setSitesLogStatus,q=e.openCdnIp,A=e.getCdnIp},null,null,null,null],execute:function(){var n={class:"flex flex-col site-globa-setting-module"},B={class:"flex items-center"},H={class:"flex items-center"},W={class:"flex items-center"},D={class:"flex items-center"},Y={class:"flex items-center"},K={class:"flex items-center"},$=o({__name:"global-setting",setup:function(e){var o=V(),O=j().plugin.value.webserver,$=a(!1),z=a(),J=i({log_split:!1,log_path:""}),M=i({page_index:!1,page_404:!1}),Q=i({cdn_ip:"",header:""}),Z="",ee=i({log_path:[{required:!0,message:"请选择日志路径",trigger:"change"}]}),te=a([{label:"名称",prop:"site_name"},{label:"结果",render:function(e){return l("span",{class:e.status?"text-primary":"text-danger"},e.status?"操作成功":"操作失败")}}]),ne=[{value:"X-Forwarded-For",label:"X-Forwarded-For"},{value:"X-Real-IP",label:"X-Real-IP"},{value:"X-Forwarded",label:"X-Forwarded"},{value:"Forwarded-For",label:"Forwarded-For"},{value:"Forwarded",label:"Forwarded"},{value:"True-Client-IP",label:"True-Client-IP"},{value:"Client-IP",label:"Client-IP"},{value:"Ali-Cdn-Real-IP",label:"Ali-Cdn-Real-IP"},{value:"Cdn-Src-IP",label:"Cdn-Src-IP"},{value:"Cdn-Real-IP",label:"Cdn-Real-IP"},{value:"Cf-Connecting-IP",label:"Cf-Connecting-IP"},{value:"X-Cluster-Client-IP",label:"X-Cluster-Client-IP"},{value:"Wl-Proxy-Client-IP",label:"Wl-Proxy-Client-IP"},{value:"Proxy-Client-IP",label:"Proxy-Client-IP"}],re=function(e,t){t(ne)},oe=function(){var e=r(t().mark((function e(){var n,r;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return $.value=!0,e.prev=1,e.next=4,N();case 4:n=e.sent,r=n.data,J.log_path=r.log_path,J.log_split=r.log_split,M.page_index=r.page_index,M.page_404=r.page_404,Q.cdn_ip=r.cdn_ip,e.next=16;break;case 13:e.prev=13,e.t0=e.catch(1);case 16:return e.prev=16,$.value=!1,e.finish(16);case 19:case"end":return e.stop()}}),e,null,[[1,13,16,19]])})));return function(){return e.apply(this,arguments)}}(),ae=function(){var e=r(t().mark((function e(){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,z.value.validate();case 2:return e.next=4,k({title:"修改日志路径",content:"是否修改日志预设路径,继续执行?",type:"check",icon:"warning-filled",check:{content:"更改已有网站日志",value:!0,onConfirm:function(){var e=r(t().mark((function e(n){var r;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,R({mv_log:"1",change_sites:n?"1":"0",log_path:J.log_path});case 3:r=e.sent,n?X({resultColumn:te.value,resultData:r.data,resultTitle:"修改日志路径",title:"修改日志路径结果"}):o.request(r),e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),E(e.t0);case 10:case"end":return e.stop()}}),e,null,[[0,7]])})));return function(t){return e.apply(this,arguments)}}()}});case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),ie=function(){T({type:"dir",path:J.log_path,change:function(e){J.log_path=e}})},le=function(){var e=r(t().mark((function e(){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:F({loading:"正在设置,请稍后...",request:U({log_split:J.log_split,page_index:M.page_index,page_404:M.page_404}),message:!0});case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),ue=function(){var e=r(t().mark((function e(n){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:F({loading:"正在设置,请稍后...",request:q({cdn_ip:n,header_cdn:Q.header}),message:!0,success:oe});case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),ce=function(){var e=r(t().mark((function e(){var n,r;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,A();case 2:n=e.sent,r=n.data,Q.header=r.header_cdn||"X-Forwarded-For";case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),se=function(){Z=Q.header,Q.header=""},fe=function(){""===Q.header&&(Q.header=Z)};return u((function(){oe(),ce()})),function(e,t){var r=b,o=w,a=G,i=P,l=C,u=L,j=S,k=I,E=c("bt-loading");return s((p(),d("div",n,[h("div",null,[v(l,{ref_key:"globalSettingRef",ref:z,model:f(J),rules:f(ee)},{default:g((function(){return[v(o,{label:"日志切割"},{default:g((function(){return[h("div",B,[v(r,{onChange:le,modelValue:f(J).log_split,"onUpdate:modelValue":t[0]||(t[0]=function(e){return f(J).log_split=e})},null,8,["modelValue"]),t[7]||(t[7]=h("span",{class:"text-[#999] ml-[4px]"},"*提示:开启该选项将自动创建网站日志切割任务,当存在所有网站日志切割任务时不会新建",-1))])]})),_:1}),v(o,{label:"预设日志路径",prop:"log_path"},{default:g((function(){return[h("div",H,[v(a,{modelValue:f(J).log_path,"onUpdate:modelValue":t[1]||(t[1]=function(e){return f(J).log_path=e}),icon:"icon-file_mode",onIconClick:ie},null,8,["modelValue"]),v(i,{type:"primary",class:"!ml-1rem",onClick:ae},{default:g((function(){return t[8]||(t[8]=[y("保存")])})),_:1})])]})),_:1})]})),_:1},8,["model","rules"])]),v(u),v(l,{model:f(M)},{default:g((function(){return[v(o,{label:"默认页面设置"},{default:g((function(){return[h("div",W,[v(r,{onChange:le,modelValue:f(M).page_index,"onUpdate:modelValue":t[2]||(t[2]=function(e){return f(M).page_index=e})},null,8,["modelValue"]),t[9]||(t[9]=h("span",{class:"ml-[4px] mb-[2px]"},"自动生成index.html(默认首页)",-1))])]})),_:1}),v(o,{label:" "},{default:g((function(){return[h("div",D,[v(r,{onChange:le,modelValue:f(M).page_404,"onUpdate:modelValue":t[3]||(t[3]=function(e){return f(M).page_404=e})},null,8,["modelValue"]),t[10]||(t[10]=h("span",{class:"ml-[4px] mb-[2px]"},"自动生成404.html(默认404页面)",-1))])]})),_:1})]})),_:1},8,["model"]),v(j,{options:[{content:"请注意,仅对后续创建的PHP网站生效。"}],class:"ml-[20px] mt-[20px]"}),"nginx"===f(O)?(p(),d(m,{key:0},[v(u),v(l,{model:f(Q)},{default:g((function(){return[v(o,{label:"cdn来源IP解析"},{default:g((function(){return[h("div",Y,[v(r,{onChange:ue,modelValue:f(Q).cdn_ip,"onUpdate:modelValue":t[4]||(t[4]=function(e){return f(Q).cdn_ip=e})},null,8,["modelValue"]),t[11]||(t[11]=h("span",{class:"ml-[4px] mb-[2px]"},[y(" * 请确保使用 "),h("span",{class:"text-danger"},"安全可靠"),y(" 的cdn ")],-1))])]})),_:1}),s(v(o,{label:"来源的请求头"},{default:g((function(){return[h("div",K,[v(k,{modelValue:f(Q).header,"onUpdate:modelValue":t[5]||(t[5]=function(e){return f(Q).header=e}),"fetch-suggestions":re,placeholder:"请选择或输入来源的请求头",onFocus:se,onBlur:fe},{suffix:g((function(){return t[12]||(t[12]=[h("span",{class:"svgtofont-el-arrow-down"},null,-1)])})),_:1},8,["modelValue"]),v(i,{type:"primary",class:"!ml-1rem",onClick:t[6]||(t[6]=function(e){return ue(f(Q).cdn_ip)})},{default:g((function(){return t[13]||(t[13]=[y("保存")])})),_:1})])]})),_:1},512),[[_,f(Q).cdn_ip]])]})),_:1},8,["model"])],64)):x("",!0)])),[[E,f($)]])}}});e("default",O($,[["__scopeId","data-v-26ddcd85"]]))}}}))}();
Save File
Cancel