← Back
Editing: index-legacy445.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(e){return function(e){if(Array.isArray(e))return r(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return r(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function n(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */n=function(){return r};var t,r={},a=Object.prototype,o=a.hasOwnProperty,u=Object.defineProperty||function(e,t,r){e[t]=r.value},i="function"==typeof Symbol?Symbol:{},l=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function f(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(t){f=function(e,t,r){return e[t]=r}}function p(e,t,r,n){var a=t&&t.prototype instanceof x?t:x,o=Object.create(a.prototype),i=new C(n||[]);return u(o,"_invoke",{value:E(e,r,i)}),o}function d(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}r.wrap=p;var m="suspendedStart",h="suspendedYield",y="executing",v="completed",b={};function x(){}function g(){}function w(){}var k={};f(k,l,(function(){return this}));var j=Object.getPrototypeOf,_=j&&j(j(N([])));_&&_!==a&&o.call(_,l)&&(k=_);var V=w.prototype=x.prototype=Object.create(k);function L(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function O(t,r){function n(a,u,i,l){var c=d(t[a],t,u);if("throw"!==c.type){var s=c.arg,f=s.value;return f&&"object"==e(f)&&o.call(f,"__await")?r.resolve(f.__await).then((function(e){n("next",e,i,l)}),(function(e){n("throw",e,i,l)})):r.resolve(f).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,l)}))}l(c.arg)}var a;u(this,"_invoke",{value:function(e,t){function o(){return new r((function(r,a){n(e,t,r,a)}))}return a=a?a.then(o,o):o()}})}function E(e,r,n){var a=m;return function(o,u){if(a===y)throw Error("Generator is already running");if(a===v){if("throw"===o)throw u;return{value:t,done:!0}}for(n.method=o,n.arg=u;;){var i=n.delegate;if(i){var l=P(i,n);if(l){if(l===b)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(a===m)throw a=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);a=y;var c=d(e,r,n);if("normal"===c.type){if(a=n.done?v:h,c.arg===b)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(a=v,n.method="throw",n.arg=c.arg)}}}function P(e,r){var n=r.method,a=e.iterator[n];if(a===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,P(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;var o=d(a,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,b;var u=o.arg;return u?u.done?(r[e.resultName]=u.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,b):u:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,b)}function S(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 U(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function C(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(S,this),this.reset(!0)}function N(r){if(r||""===r){var n=r[l];if(n)return n.call(r);if("function"==typeof r.next)return r;if(!isNaN(r.length)){var a=-1,u=function e(){for(;++a<r.length;)if(o.call(r,a))return e.value=r[a],e.done=!1,e;return e.value=t,e.done=!0,e};return u.next=u}}throw new TypeError(e(r)+" is not iterable")}return g.prototype=w,u(V,"constructor",{value:w,configurable:!0}),u(w,"constructor",{value:g,configurable:!0}),g.displayName=f(w,s,"GeneratorFunction"),r.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},r.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,w):(e.__proto__=w,f(e,s,"GeneratorFunction")),e.prototype=Object.create(V),e},r.awrap=function(e){return{__await:e}},L(O.prototype),f(O.prototype,c,(function(){return this})),r.AsyncIterator=O,r.async=function(e,t,n,a,o){void 0===o&&(o=Promise);var u=new O(p(e,t,n,a),o);return r.isGeneratorFunction(t)?u:u.next().then((function(e){return e.done?e.value:u.next()}))},L(V),f(V,s,"Generator"),f(V,l,(function(){return this})),f(V,"toString",(function(){return"[object Generator]"})),r.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},r.values=N,C.prototype={constructor:C,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(U),!e)for(var r in this)"t"===r.charAt(0)&&o.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},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 r=this;function n(n,a){return i.type="throw",i.arg=e,r.next=n,a&&(r.method="next",r.arg=t),!!a}for(var a=this.tryEntries.length-1;a>=0;--a){var u=this.tryEntries[a],i=u.completion;if("root"===u.tryLoc)return n("end");if(u.tryLoc<=this.prev){var l=o.call(u,"catchLoc"),c=o.call(u,"finallyLoc");if(l&&c){if(this.prev<u.catchLoc)return n(u.catchLoc,!0);if(this.prev<u.finallyLoc)return n(u.finallyLoc)}else if(l){if(this.prev<u.catchLoc)return n(u.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<u.finallyLoc)return n(u.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var a=n;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var u=a?a.completion:{};return u.type=e,u.arg=t,a?(this.method="next",this.next=a.finallyLoc,b):this.complete(u)},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),b},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),U(r),b}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;U(r)}return a}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:N(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),b}},r}function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function o(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?a(Object(r),!0).forEach((function(t){u(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):a(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function u(t,r,n){return(r=function(t){var r=function(t,r){if("object"!=e(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var a=n.call(t,r||"default");if("object"!=e(a))return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}(t,"string");return"symbol"==e(r)?r:r+""}(r))in t?Object.defineProperty(t,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[r]=n,t}function i(e,t,r,n,a,o,u){try{var i=e[o](u),l=i.value}catch(e){return void r(e)}i.done?t(l):Promise.resolve(l).then(n,a)}function l(e){return function(){var t=this,r=arguments;return new Promise((function(n,a){var o=e.apply(t,r);function u(e){i(o,n,a,u,l,"next",e)}function l(e){i(o,n,a,u,l,"throw",e)}u(void 0)}))}}System.register(["./index-legacy103.js?v=VERSION_NUMBER","./index-legacy140.js?v=VERSION_NUMBER","./utils-lib-legacy.js?v=VERSION_NUMBER","./base-lib-legacy.js?v=VERSION_NUMBER","./index-legacy123.js?v=VERSION_NUMBER","./site-legacy.js?v=VERSION_NUMBER","./column-legacy.js?v=VERSION_NUMBER","./useController-legacy6.js?v=VERSION_NUMBER","./useStore-legacy4.js?v=VERSION_NUMBER","./ace-legacy.js?v=VERSION_NUMBER","./__commonjsHelpers__-legacy.js?v=VERSION_NUMBER","./index-legacy104.js?v=VERSION_NUMBER","./validator-legacy.js?v=VERSION_NUMBER"],(function(e,r){"use strict";var a,i,c,s,f,p,d,m,h,y,v,b,x,g,w,k,j,_,V,L,O,E,P,S,U,C,N,q,R,A,F,T,G,M,I,D,J,B,H,Y,$,K,W,z,Q,X,Z,ee,te,re,ne,ae,oe;return{setters:[function(e){a=e._},function(e){i=e.B},function(e){c=e.u,s=e.K,f=e.M,p=e.at,d=e.p,m=e.l,h=e.a0,y=e.k,v=e.W,b=e.j},function(e){x=e.c,g=e.r,w=e.k,k=e.p,j=e.G,_=e.q,V=e.v,L=e.e,O=e.A,E=e.B,P=e.H,S=e.x,U=e.P,C=e.y,N=e.M,q=e.C,R=e.F,A=e.a_,F=e.U,T=e.D,G=e.al,M=e.a9,I=e.a7},function(e){D=e._},function(e){J=e.modifyModulesProxy,B=e.modifyProxy,H=e.getProxyFile,Y=e.removeModulesProxy,$=e.removeProxy,K=e.getModulesProxyList,W=e.getProxyList,z=e.asyncSaveProxyFile,Q=e.saveRedirectFile,X=e.createProxySite,Z=e.createProxy},function(e){ee=e.a,te=e.b,re=e.u,ne=e.c},function(e){ae=e.q},function(e){oe=e.u},null,null,null,null],execute:function(){var r={class:"p-[20px]"},ue={class:"flex items-center"},ie={class:"flex items-center"},le=["onClick"],ce={class:"p-2rem"};e("default",x({__name:"index",props:{compData:{default:function(){return{}}}},setup:function(e,x){var se,fe=x.expose,pe=c().plugin,de=oe().siteInfo,me=pe.value.webserver,he=g(null===(se=de.value)||void 0===se||null===(se=se.project_type)||void 0===se?void 0:se.toLowerCase()),ye=g();g(""),g([]),g("");var ve=g([]),be=g(!1),xe=g(!1),ge=g({}),we=w({proxyname:[{required:!0,message:"请输入代理名称",trigger:["blur","change"]},{trigger:["blur","input","change"],validator:function(e,t,r){t.length<3?r(new Error("代理名称必须大于3个字符串")):r()}}],proxysite:[{required:!0,message:"请输入目标url",trigger:"blur",validator:function(e,t,r){t?r():r(new Error("目标URL不能为空"))}}],todomain:[{required:!0,message:"请输入发送域名",trigger:["blur","change"]}]}),ke=g({isEdit:!1,type:!0,cache:!1,advanced:!1,proxyname:"",cachetime:1,proxydir:"/",proxysite:"http://",todomain:"",subfilter:[{sub1:"",sub2:"",id:1}],subNum:1,path:"",content:""}),je=g(!1),_e=g(!1),Ve=[{content:"代理目录:访问这个目录时将会把目标URL的内容返回并显示(需要开启高级功能)"},{content:"目标URL:可以填写你需要代理的站点,目标URL必须为可正常访问的URL,否则将返回错误"},{content:"发送域名:将域名添加到请求头传递到代理服务器,默认为目标URL域名,若设置不当可能导致代理无法正常运行"},{content:"内容替换:只能在使用nginx时提供,最多可以添加3条替换内容,如果不需要替换请留空"}],Le=function(){var e=l(n().mark((function e(t,r,a,u){var i,c,s,f;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=u.label,c=u.value,s=new Map([["start","批量启动选中的规则后,配置的反向代理规则将继续生效"],["stop","批量停用选中的规则后,配置的反向代理规则将会失效"],["delete","批量删除选中的规则后,配置的反向代理规则将会彻底失效"]]),f=function(){var e=l(n().mark((function e(t,r){var a,u,i,l,s,f,p;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a=t.proxyname,u=t.subfilter,i=["proxy","phpasync"].includes(he.value),e.t0=c,e.next="start"===e.t0||"stop"===e.t0?5:"delete"===e.t0?17:29;break;case 5:if(l=o(o({},t),{},{subfilter:JSON.stringify(u),type:"start"===c?1:0}),!i){e.next=12;break}return e.next=9,J(l,he.value);case 9:e.t1=e.sent,e.next=15;break;case 12:return e.next=14,B(l);case 14:e.t1=e.sent;case 15:return s=e.t1,e.abrupt("return",o(o({},t),{},{batchStatus:s.status?1:2,message:s.msg}));case 17:if(f={sitename:de.value.name,proxyname:"phpasync"===he.value?[a]:a},!i){e.next=24;break}return e.next=21,Y(f,he.value);case 21:e.t2=e.sent,e.next=27;break;case 24:return e.next=26,$(f);case 26:e.t2=e.sent;case 27:return p=e.t2,e.abrupt("return",o(o({},t),{},{batchStatus:p.status?1:2,message:p.msg}));case 29:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}(),e.next=5,t({title:"批量".concat(i),content:"".concat(s.get(c),",是否继续操作?"),column:[{label:"名称",prop:"proxyname"},ne()],onConfirm:function(){var e=l(n().mark((function e(){return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r(f);case 2:return Ge(),e.abrupt("return",!1);case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()});case 5:case"end":return e.stop()}}),e)})));return function(t,r,n,a){return e.apply(this,arguments)}}(),Oe=function(e){var t=e.replace(/^http[s]?:\/\//,"");t=t.replace(/(:|\?|\/|\\)(.*)$/,""),ke.value.todomain=t},Ee=function(){var e=l(n().mark((function e(t,r){var a,u;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=o(o({},t),{},{subfilter:JSON.stringify(t.subfilter)}),"cache"===r?a.cache=t.cache?0:1:a.type=t.type?0:1,u=["proxy","phpasync"].includes(he.value),e.next=5,s({loading:"正在修改状态中,请稍后...",request:u?J(a,he.value):B(a),message:!0});case 5:e.sent.status&&Ge();case 7:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}(),Pe=function(){var e=l(n().mark((function e(t){var r,a;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,0!==t.type){e.next=3;break}return e.abrupt("return",f.error("该规则已暂停,无法查看配置文件"));case 3:return e.next=5,H({sitename:de.value.name,proxyname:t.proxyname,webserver:me});case 5:r=e.sent,!1===(a=r.data).status?f.request(a):(ke.value.content=a[0].data,ke.value.path=a[1],ke.value.proxyname=t.proxyname,_e.value=!0),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(0),p(e.t0);case 13:case"end":return e.stop()}}),e,null,[[0,10]])})));return function(t){return e.apply(this,arguments)}}(),Se=function(){var e=l(n().mark((function e(){var t,r,a;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t="phpasync"===he.value,r=t?z:Q,a=u(u({path:ke.value.path},t?"config":"data",ke.value.content),"encoding","utf-8"),e.next=5,s({loading:"正在保存配置文件,请稍后...",request:r(a),message:!0});case 5:e.sent.status&&(_e.value=!1,Ne(),Ge());case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Ue=function(){var e=l(n().mark((function e(t){return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:ke.value.isEdit=!0,ke.value.proxyname=t.proxyname,ke.value.proxydir=t.proxydir,ke.value.proxysite=t.proxysite,ke.value.todomain=t.todomain,ke.value.type=!!t.type,ke.value.cache=!!t.cache,ke.value.advanced=!!t.advanced,ke.value.cachetime=t.cachetime,ke.value.subfilter=t.subfilter.map((function(e,t){return{sub1:e.sub1,sub2:e.sub2,id:t}})).filter((function(e){return""!==e.sub1})),je.value=!0;case 11:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),Ce=function(){var e=l(n().mark((function e(){return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:Ne(),je.value=!0;case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Ne=function(){var e=l(n().mark((function e(){return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:ke.value.isEdit=!1,ke.value.proxyname="",ke.value.proxydir="/",ke.value.proxysite="http://",ke.value.todomain="",ke.value.type=!0,ke.value.cache=!1,ke.value.advanced=!1,ke.value.cachetime=1,ke.value.subfilter=[{sub1:"",sub2:"",id:1}],ke.value.subNum=1;case 11:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),qe=function(){var e=l(n().mark((function e(){return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(3!==ke.value.subfilter.length){e.next=3;break}return f.error("最多添加三条内容替换"),e.abrupt("return");case 3:ke.value.subfilter.push({sub1:"",sub2:"",id:100*Math.random()});case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Re=function(){var e=l(n().mark((function e(t){return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(1!==ke.value.subfilter.length){e.next=3;break}return f.error("至少保留一条内容替换"),e.abrupt("return");case 3:ke.value.subfilter=ke.value.subfilter.filter((function(e){return e.id!==t.id}));case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),Ae=function(e){for(var r=t(e);r.length<3;)r.push({sub1:"",sub2:""});return r.map((function(e,t){return{sub1:e.sub1,sub2:e.sub2,id:100*Math.random()}}))},Fe=function(){var e=l(n().mark((function e(){var t,r,a,o,u,i,l,c,f,p,d,m,h,y,v;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,ge.value.validate();case 2:return t=ke.value,r=t.isEdit,a=t.type,o=t.subfilter,u=t.cache,i=t.advanced,l=t.proxyname,c=t.proxydir,f=t.proxysite,p=t.todomain,d=t.cachetime,m={subfilter:JSON.stringify(Ae(o).map((function(e){return{sub1:e.sub1,sub2:e.sub2}}))),type:a?1:0,cache:u?1:0,advanced:i?1:0,sitename:de.value.name,proxyname:l,proxydir:c,proxysite:f,todomain:p,cachetime:d},h=["proxy","phpasync"].includes(he.value),y=r?J:X,v=r?B:Z,e.next=9,s({loading:xe,request:h?y(m,he.value):v(m),message:!0});case 9:e.sent.status&&(Ge(),je.value=!1);case 11:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Te=function(){var e=l(n().mark((function e(t){var r,a,o;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,d({title:"删除反向代理规则【".concat(t.proxyname,"】"),content:"删除选中的规则后,配置的反向代理规则将会彻底失效,是否继续操作?",icon:"warning-filled"});case 2:return r=["proxy","phpasync"].includes(he.value),a={phpasync:{sitename:de.value.name,proxyname:t.proxyname},default:{sitename:de.value.name,proxyname:[t.proxyname]}},o=a[he.value]||a.default,e.next=7,s({loading:"正在删除,请稍后...",request:r?Y(o,he.value):$(a.default),message:!0});case 7:e.sent.status&&Ge();case 9:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),Ge=function(){var e=l(n().mark((function e(){var t,r;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t={sitename:de.value.name},r=["proxy","phpasync"].includes(he.value),e.next=4,s({loading:be,request:r?K(t,he.value):W(t),data:[Array,ve]});case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Me=[{label:"启用反向代理规则",value:"start",event:Le},{label:"停用反向代理规则",value:"stop",event:Le},{label:"删除反向代理规则",value:"delete",event:Le}],Ie=F([ee({key:"proxydir"}),{label:"名称",prop:"proxyname"},{label:"代理目录",prop:"proxydir"},{label:"目标URL",width:140,render:function(e){return L("span",{class:"bt-link",onClick:function(){window.open(e.proxysite)}},[e.proxysite])}},{prop:"cache",label:"缓存",width:60,render:function(e){var t=e.cache;return L("span",{class:"".concat(t?"bt-link":"bt-danger"),onClick:function(){Ee(e,"cache")}},[t?"已开启":"已关闭"])}},te({prop:"type",event:Ee,data:["已暂停","运行中"]}),re([{onClick:Pe,title:"配置文件",width:56},{onClick:Ue,title:"编辑"},{onClick:Te,title:"删除"}])]);return k(Ge),fe({init:Ge}),function(e,t){var n=T,o=D,u=m,l=h,c=G,s=M,f=y,p=I,d=v,x=b,g=i,w=a,k=j("bt-loading");return _(),V("div",null,[L(w,null,{"header-left":O((function(){return[L(n,{type:"primary",onClick:Ce},{default:O((function(){return t[11]||(t[11]=[E("添加反向代理")])})),_:1})]})),"header-right":O((function(){return[L(o,{onRefresh:Ge})]})),content:O((function(){return[P(L(u,{ref_key:"reverseTableRef",ref:ye,column:S(Ie),"max-height":520,data:S(ve)},null,8,["column","data"]),[[k,S(be)],[k,"正在获取列表,请稍候...","title"]])]})),"footer-left":O((function(){return[L(l,{"table-ref":S(ye),options:S(Me)},null,8,["table-ref","options"])]})),"footer-right":O((function(){return t[12]||(t[12]=[])})),popup:O((function(){return[L(x,{title:S(ke).isEdit?"修改反向代理【".concat(S(ke).proxyname,"】"):"添加反向代理",modelValue:S(je),"onUpdate:modelValue":t[8]||(t[8]=function(e){return U(je)?je.value=e:null}),"show-footer":!0,area:68,onConfirm:Fe},{default:O((function(){return[C("div",r,[L(p,{ref_key:"proxyForm",ref:ge,model:S(ke),rules:S(we),disabled:S(xe),"label-width":"80px"},{default:O((function(){return[L(s,{label:"开启代理"},{default:O((function(){return[C("div",ue,[L(c,{modelValue:S(ke).type,"onUpdate:modelValue":t[0]||(t[0]=function(e){return S(ke).type=e})},null,8,["modelValue"]),L(s,{label:"开启缓存",class:"!mt-0"},{default:O((function(){return[L(c,{modelValue:S(ke).cache,"onUpdate:modelValue":t[1]||(t[1]=function(e){return S(ke).cache=e})},null,8,["modelValue"])]})),_:1}),L(s,{label:"高级功能",class:"!mt-0"},{default:O((function(){return[L(c,{modelValue:S(ke).advanced,"onUpdate:modelValue":t[2]||(t[2]=function(e){return S(ke).advanced=e})},null,8,["modelValue"])]})),_:1})])]})),_:1}),L(s,{label:"代理名称",prop:"proxyname"},{default:O((function(){return[L(f,{modelValue:S(ke).proxyname,"onUpdate:modelValue":t[3]||(t[3]=function(e){return S(ke).proxyname=e}),disabled:S(ke).isEdit,placeholder:"请输入代理名称",width:"20rem"},null,8,["modelValue","disabled"])]})),_:1}),S(ke).cache?(_(),N(s,{key:0,label:"缓存时间",prop:"cachetime"},{default:O((function(){return[L(f,{modelValue:S(ke).cachetime,"onUpdate:modelValue":t[4]||(t[4]=function(e){return S(ke).cachetime=e}),placeholder:"请输入缓存时间",width:"20rem",textType:"分钟"},{append:O((function(){return t[13]||(t[13]=[E(" 分钟 ")])})),_:1},8,["modelValue"])]})),_:1})):q("",!0),S(ke).advanced?(_(),N(s,{key:1,label:"代理目录",prop:"proxydir"},{default:O((function(){return[L(f,{modelValue:S(ke).proxydir,"onUpdate:modelValue":t[5]||(t[5]=function(e){return S(ke).proxydir=e}),placeholder:"请输入代理目录",width:"20rem"},null,8,["modelValue"])]})),_:1})):q("",!0),L(s,{label:"目标URL",prop:"proxysite","label-width":"80px"},{default:O((function(){return[C("div",ie,[L(f,{modelValue:S(ke).proxysite,"onUpdate:modelValue":t[6]||(t[6]=function(e){return S(ke).proxysite=e}),placeholder:"请输入目标URL",width:"20rem",onInput:Oe},null,8,["modelValue"]),L(s,{label:"发送域名",prop:"todomain","label-width":"50px"},{default:O((function(){return[L(f,{modelValue:S(ke).todomain,"onUpdate:modelValue":t[7]||(t[7]=function(e){return S(ke).todomain=e}),placeholder:"请输入发送域名",width:"20rem"},null,8,["modelValue"])]})),_:1})])]})),_:1}),L(s,{label:"内容替换"},{default:O((function(){return[(_(!0),V(R,null,A(S(ke).subfilter,(function(e,t){return _(),V("div",{key:e.id,class:"flex items-center mb-1rem"},[L(f,{modelValue:e.sub1,"onUpdate:modelValue":function(t){return e.sub1=t},placeholder:"被替换的文本,可留空",width:"20rem",class:"mr-2rem !w-20rem"},null,8,["modelValue","onUpdate:modelValue"]),L(f,{modelValue:e.sub2,"onUpdate:modelValue":function(t){return e.sub2=t},placeholder:"替换为,可留空",width:"20rem",class:"mr-1rem !w-20rem"},null,8,["modelValue","onUpdate:modelValue"]),C("span",{class:"text-danger cursor-pointer",onClick:function(t){return Re(e)}},"删除",8,le)])})),128)),L(n,{disabled:3===S(ke).subfilter.length,type:"primary",class:"!mt-1rem",onClick:qe},{default:O((function(){return t[14]||(t[14]=[C("span",{class:"svgtofont-el-plus"},null,-1),E(" 添加内容替换 ")])})),_:1},8,["disabled"])]})),_:1})]})),_:1},8,["model","rules","disabled"]),L(d,{options:Ve,class:"mt-2rem pl-2rem"})])]})),_:1},8,["title","modelValue"]),L(x,{title:"编辑配置文件【".concat(S(ke).proxyname,"】"),modelValue:S(_e),"onUpdate:modelValue":t[10]||(t[10]=function(e){return U(_e)?_e.value=e:null}),area:55},{default:O((function(){return[C("div",ce,[t[16]||(t[16]=C("div",{class:"text-[#666] h-[2rem] leading-[2rem] mb-[1rem]"},"提示:Ctrl+S 保存",-1)),L(g,{modelValue:S(ke).content,"onUpdate:modelValue":t[9]||(t[9]=function(e){return S(ke).content=e}),filePath:S(ke).path,config:S(ae)(),request:!1,class:"!h-38rem",onSave:Se},null,8,["modelValue","filePath","config"]),L(n,{type:"primary",class:"!mt-2rem",onClick:Se},{default:O((function(){return t[15]||(t[15]=[E("保存")])})),_:1})])]})),_:1},8,["title","modelValue"])]})),_:1}),t[17]||(t[17]=C("ul",{class:"mt-[20px] leading-8 text-[1.2rem] list-disc ml-[20px]"},[C("li",null,"设置了反向代理后,【访问限制】中的相应路径的规则将会失效")],-1))])}}}))}}}))}();
Save File
Cancel