← Back
Editing: index-legacy450.js
!function(){function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}function e(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function r(t){for(var r=1;r<arguments.length;r++){var o=null!=arguments[r]?arguments[r]:{};r%2?e(Object(o),!0).forEach((function(e){n(t,e,o[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):e(Object(o)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))}))}return t}function n(e,r,n){return(r=function(e){var r=function(e,r){if("object"!=t(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,r||"default");if("object"!=t(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(e)}(e,"string");return"symbol"==t(r)?r:r+""}(r))in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function o(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */o=function(){return r};var e,r={},n=Object.prototype,a=n.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},u="function"==typeof Symbol?Symbol:{},c=u.iterator||"@@iterator",l=u.asyncIterator||"@@asyncIterator",s=u.toStringTag||"@@toStringTag";function f(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{f({},"")}catch(e){f=function(t,e,r){return t[e]=r}}function p(t,e,r,n){var o=e&&e.prototype instanceof b?e:b,a=Object.create(o.prototype),u=new N(n||[]);return i(a,"_invoke",{value:P(t,r,u)}),a}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}r.wrap=p;var h="suspendedStart",v="suspendedYield",y="executing",m="completed",g={};function b(){}function w(){}function x(){}var j={};f(j,c,(function(){return this}));var k=Object.getPrototypeOf,_=k&&k(k(T([])));_&&_!==n&&a.call(_,c)&&(j=_);var O=x.prototype=b.prototype=Object.create(j);function E(t){["next","throw","return"].forEach((function(e){f(t,e,(function(t){return this._invoke(e,t)}))}))}function L(e,r){function n(o,i,u,c){var l=d(e[o],e,i);if("throw"!==l.type){var s=l.arg,f=s.value;return f&&"object"==t(f)&&a.call(f,"__await")?r.resolve(f.__await).then((function(t){n("next",t,u,c)}),(function(t){n("throw",t,u,c)})):r.resolve(f).then((function(t){s.value=t,u(s)}),(function(t){return n("throw",t,u,c)}))}c(l.arg)}var o;i(this,"_invoke",{value:function(t,e){function a(){return new r((function(r,o){n(t,e,r,o)}))}return o=o?o.then(a,a):a()}})}function P(t,r,n){var o=h;return function(a,i){if(o===y)throw Error("Generator is already running");if(o===m){if("throw"===a)throw i;return{value:e,done:!0}}for(n.method=a,n.arg=i;;){var u=n.delegate;if(u){var c=S(u,n);if(c){if(c===g)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var l=d(t,r,n);if("normal"===l.type){if(o=n.done?m:v,l.arg===g)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=m,n.method="throw",n.arg=l.arg)}}}function S(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,S(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var a=d(o,t.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,g;var i=a.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,g):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function V(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function D(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function N(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(V,this),this.reset(!0)}function T(r){if(r||""===r){var n=r[c];if(n)return n.call(r);if("function"==typeof r.next)return r;if(!isNaN(r.length)){var o=-1,i=function t(){for(;++o<r.length;)if(a.call(r,o))return t.value=r[o],t.done=!1,t;return t.value=e,t.done=!0,t};return i.next=i}}throw new TypeError(t(r)+" is not iterable")}return w.prototype=x,i(O,"constructor",{value:x,configurable:!0}),i(x,"constructor",{value:w,configurable:!0}),w.displayName=f(x,s,"GeneratorFunction"),r.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===w||"GeneratorFunction"===(e.displayName||e.name))},r.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,f(t,s,"GeneratorFunction")),t.prototype=Object.create(O),t},r.awrap=function(t){return{__await:t}},E(L.prototype),f(L.prototype,l,(function(){return this})),r.AsyncIterator=L,r.async=function(t,e,n,o,a){void 0===a&&(a=Promise);var i=new L(p(t,e,n,o),a);return r.isGeneratorFunction(e)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},E(O),f(O,s,"Generator"),f(O,c,(function(){return this})),f(O,"toString",(function(){return"[object Generator]"})),r.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},r.values=T,N.prototype={constructor:N,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(D),!t)for(var r in this)"t"===r.charAt(0)&&a.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(n,o){return u.type="throw",u.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],u=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=a.call(i,"catchLoc"),l=a.call(i,"finallyLoc");if(c&&l){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&a.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o.finallyLoc,g):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),g},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),D(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;D(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:T(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),g}},r}function a(t,e,r,n,o,a,i){try{var u=t[a](i),c=u.value}catch(t){return void r(t)}u.done?e(c):Promise.resolve(c).then(n,o)}function i(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function u(t){a(i,n,o,u,c,"next",t)}function c(t){a(i,n,o,u,c,"throw",t)}u(void 0)}))}}System.register(["./index-legacy103.js?v=VERSION_NUMBER","./utils-lib-legacy.js?v=VERSION_NUMBER","./index-legacy140.js?v=VERSION_NUMBER","./base-lib-legacy.js?v=VERSION_NUMBER","./column-legacy.js?v=VERSION_NUMBER","./useController-legacy6.js?v=VERSION_NUMBER","./useStore-legacy4.js?v=VERSION_NUMBER","./site-legacy.js?v=VERSION_NUMBER","./__commonjsHelpers__-legacy.js?v=VERSION_NUMBER","./ace-legacy.js?v=VERSION_NUMBER","./index-legacy104.js?v=VERSION_NUMBER","./validator-legacy.js?v=VERSION_NUMBER"],(function(t,e){"use strict";var n,a,u,c,l,s,f,p,d,h,v,y,m,g,b,w,x,j,k,_,O,E,L,P,S,V,D,N,T,G,B,C,F,A,q,U,I,M,R,H,Y,K,W,z;return{setters:[function(t){n=t._},function(t){a=t.u,u=t.K,c=t.M,l=t.k,s=t.l,f=t.a0,p=t.c,d=t.W,h=t.j,v=t.p,y=t.at},function(t){m=t.B},function(t){g=t.c,b=t.r,w=t.e,x=t.p,j=t.G,k=t.q,_=t.v,O=t.y,E=t.x,L=t.P,P=t.A,S=t.F,V=t.a_,D=t.B,N=t.H,T=t.aj,G=t.D,B=t.aB,C=t.M,F=t.ai},function(t){A=t.a,q=t.u},function(t){U=t.o},function(t){I=t.S,M=t.u},function(t){R=t.getDirBinding,H=t.addDirBinding,Y=t.getFileBody,K=t.deleteDirBindMultiple,W=t.delDirBinding,z=t.getDirRewrite},null,null,null,null],execute:function(){var e={class:"flex items-center"},J={class:"flex items-center mr-[16px]"},Q={class:"flex items-center mr-[16px]"},X={class:"p-[20px]"},Z={class:"flex items-center justify-between"},$={class:"flex items-center"};t("default",g({__name:"index",props:{compData:{default:function(){return{}}}},setup:function(t,g){var tt=g.expose,et=I().saveFileEvent,rt=a().plugin,nt=M().siteInfo,ot=b(),at=b(""),it=b([]),ut=b("");b([]);var ct,lt=b(!1),st=b(""),ft=b(""),pt=b([]),dt=b(""),ht=b(!1),vt=[{content:"请选择您的应用,若设置伪静态后,网站无法正常访问,请尝试设置回default"},{content:"您可以对伪静态规则进行修改,修改完后保存即可。"}],yt=b([]),mt=b(!1),gt=function(){var t=i(o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,u({loading:mt,request:R({id:nt.value.id}),data:{dirs:[Array,it],binding:[Array,yt]}});case 2:ut.value=it.value[0]||"";case 3:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),bt=function(){var t=i(o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(ut.value&&at.value){t.next=3;break}return c.error("域名和子目录都不可为空!"),t.abrupt("return");case 3:return t.next=5,u({loading:"正在添加子目录中,清稍后...",request:H({id:nt.value.id,domain:at.value,dirName:ut.value}),message:!0});case 5:t.sent.status&&(at.value="",gt());case 7:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),wt=function(){var t=i(o().mark((function t(e){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,v({title:"删除【".concat(e.domain,"】"),content:"删除选中的子目录绑定后,将无法访问该子目录绑定的域名,是否继续操作?",icon:"warning-filled"});case 2:return t.next=4,u({loading:"正在删除,请稍后...",request:W({id:e.id}),message:!0});case 4:t.sent.status&>();case 6:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),xt=function(){var t=i(o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,et({data:st.value,encoding:"utf-8",path:dt.value});case 2:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),jt=function(){var t=i(o().mark((function t(e){var n,a,i;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=c.load("正在获取伪静态内容,请稍候..."),a={id:e.id},e.add&&(a.add=1),t.prev=3,t.next=6,z(a);case 6:if(i=t.sent,n.close(),i.data.status){t.next=14;break}return t.next=11,v({title:"创建伪静态",icon:"warning-filled",content:"你真的要为这个子目录创建独立的伪静态规则吗?"});case 11:jt(r(r({},e),{},{add:1})),t.next=19;break;case 14:st.value=i.data.data,pt.value=i.data.rlist,ft.value=i.data.rlist[0],dt.value=i.data.filename,lt.value=!0;case 19:t.next=24;break;case 21:t.prev=21,t.t0=t.catch(3),y(t.t0);case 24:return t.prev=24,n.close(),t.finish(24);case 27:case"end":return t.stop()}}),t,null,[[3,21,24,27]])})));return function(e){return t.apply(this,arguments)}}(),kt=function(){var t=i(o().mark((function t(e){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:u({loading:ht,request:Y({path:"/www/server/panel/rewrite/".concat(rt.value.webserver,"/").concat(e,".conf")}),data:{data:[String,st]}});case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),_t=b([A(),{prop:"domain",label:"域名",render:function(t){return w("span",{class:"cursor-pointer bt-link",onClick:function(){window.open("http://".concat(t.domain,":").concat(t.port),"_blank","noopener,noreferrer")}},[t.domain])}},{prop:"port",label:"端口"},{width:220,label:"子目录",render:function(t){return w("span",null,[t.path])}},q([{onClick:jt,title:"伪静态",width:60},{onClick:wt,title:"删除"}])]),Ot=[{label:"删除",value:"delete",event:(ct=i(o().mark((function t(e,r,n,a,i){var u,c,l,s;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,v({title:"批量删除",width:"35rem",icon:"warning-filled",content:"批量删除,该操作可能会存在风险,是否继续?"});case 2:return u=[n.value.map((function(t){return t.id}))],t.next=5,K({bind_ids:u,id:nt.value.id});case 5:return c=t.sent,l=c.data,s=[],t.next=10,l.success.forEach((function(t){s.push({name:t,msg:"删除成功",status:!0})}));case 10:return t.next=12,Object.keys(l.error).forEach((function(t){s.push({name:t,msg:l.data.error[t],status:!1})}));case 12:return t.next=14,U({resultData:s,resultTitle:"删除",resultColumn:[{label:"域名",prop:"name"},{label:"结果",render:function(t){return B("span",{class:t.status?"text-primary":"text-danger"},t.status?t.msg||"操作成功":t.msg||"操作失败")}}]});case 14:gt(),i();case 16:case"end":return t.stop()}}),t)}))),function(t,e,r,n,o){return ct.apply(this,arguments)})}];return x(gt),tt({init:gt}),function(t,r){var o=l,a=F,i=T,u=G,c=s,v=f,y=p,g=m,b=d,x=h,B=n,A=j("bt-loading");return k(),_("div",null,[O("div",e,[O("div",J,[r[5]||(r[5]=O("span",{class:"mr-[16px] w-[4rem]"},"域名",-1)),w(o,{modelValue:E(at),"onUpdate:modelValue":r[0]||(r[0]=function(t){return L(at)?at.value=t:null}),placeholder:"请输入域名"},null,8,["modelValue"])]),O("div",Q,[r[6]||(r[6]=O("span",{class:"mr-[16px]"},"子目录",-1)),w(i,{class:"!w-[15rem]",filterable:"",modelValue:E(ut),"onUpdate:modelValue":r[1]||(r[1]=function(t){return L(ut)?ut.value=t:null})},{default:P((function(){return[(k(!0),_(S,null,V(E(it),(function(t,e){return k(),C(a,{key:e,value:t,label:t},null,8,["value","label"])})),128))]})),_:1},8,["modelValue"])]),w(u,{type:"primary",onClick:bt},{default:P((function(){return r[7]||(r[7]=[D("添加")])})),_:1})]),w(B,null,{"header-left":P((function(){return r[8]||(r[8]=[])})),"header-right":P((function(){return r[9]||(r[9]=[])})),content:P((function(){return[N(w(c,{ref_key:"subTableRef",ref:ot,"max-height":"500",column:E(_t),data:E(yt)},null,8,["column","data"]),[[A,E(mt)]])]})),"footer-left":P((function(){return[w(v,{"table-ref":E(ot),options:E(Ot)},null,8,["table-ref","options"])]})),"footer-right":P((function(){return r[10]||(r[10]=[])})),popup:P((function(){return[w(x,{title:"伪静态规则",modelValue:E(lt),"onUpdate:modelValue":r[4]||(r[4]=function(t){return L(lt)?lt.value=t:null}),area:50},{default:P((function(){return[O("div",X,[O("div",Z,[w(i,{class:"!w-[15rem]",modelValue:E(ft),"onUpdate:modelValue":r[2]||(r[2]=function(t){return L(ft)?ft.value=t:null}),onChange:kt},{default:P((function(){return[(k(!0),_(S,null,V(E(pt),(function(t,e){return k(),C(a,{key:e,value:t,label:t},null,8,["value","label"])})),128))]})),_:1},8,["modelValue"]),O("span",$,[r[12]||(r[12]=D(" 规则转换工具: ")),w(y,{class:"flex items-center",href:"https://www.bt.cn/Tools",target:"_blank"},{default:P((function(){return r[11]||(r[11]=[D("Apache转Nginx "),O("i",{class:"svgtofont-el-link"},null,-1)])})),_:1})])]),N(w(g,{id:"statictRef",class:"!h-[40rem] !w-full my-[12px]",modelValue:E(st),"onUpdate:modelValue":r[3]||(r[3]=function(t){return L(st)?st.value=t:null}),onSave:xt},null,8,["modelValue"]),[[A,E(ht)]]),O("div",null,[w(u,{type:"primary",onClick:xt},{default:P((function(){return r[13]||(r[13]=[D("保存")])})),_:1})]),w(b,{options:vt,class:"ml-[20px] mt-[20px]"})])]})),_:1},8,["modelValue"])]})),_:1})])}}}))}}}))}();
Save File
Cancel