← Back
Editing: index-legacy342.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(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */e=function(){return n};var r,n={},o=Object.prototype,a=o.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},u="function"==typeof Symbol?Symbol:{},l=u.iterator||"@@iterator",c=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(r){f=function(t,e,r){return t[e]=r}}function p(t,e,r,n){var o=e&&e.prototype instanceof g?e:g,a=Object.create(o.prototype),u=new D(n||[]);return i(a,"_invoke",{value:P(t,r,u)}),a}function h(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}n.wrap=p;var d="suspendedStart",v="suspendedYield",y="executing",m="completed",b={};function g(){}function w(){}function _(){}var x={};f(x,l,(function(){return this}));var j=Object.getPrototypeOf,O=j&&j(j(C([])));O&&O!==o&&a.call(O,l)&&(x=O);var L=_.prototype=g.prototype=Object.create(x);function E(t){["next","throw","return"].forEach((function(e){f(t,e,(function(t){return this._invoke(e,t)}))}))}function k(e,r){function n(o,i,u,l){var c=h(e[o],e,i);if("throw"!==c.type){var s=c.arg,f=s.value;return f&&"object"==t(f)&&a.call(f,"__await")?r.resolve(f.__await).then((function(t){n("next",t,u,l)}),(function(t){n("throw",t,u,l)})):r.resolve(f).then((function(t){s.value=t,u(s)}),(function(t){return n("throw",t,u,l)}))}l(c.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,e,n){var o=d;return function(a,i){if(o===y)throw Error("Generator is already running");if(o===m){if("throw"===a)throw i;return{value:r,done:!0}}for(n.method=a,n.arg=i;;){var u=n.delegate;if(u){var l=S(u,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(o===d)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var c=h(t,e,n);if("normal"===c.type){if(o=n.done?m:v,c.arg===b)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(o=m,n.method="throw",n.arg=c.arg)}}}function S(t,e){var n=e.method,o=t.iterator[n];if(o===r)return e.delegate=null,"throw"===n&&t.iterator.return&&(e.method="return",e.arg=r,S(t,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;var a=h(o,t.iterator,e.arg);if("throw"===a.type)return e.method="throw",e.arg=a.arg,e.delegate=null,b;var i=a.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=r),e.delegate=null,b):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,b)}function N(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 G(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function D(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(N,this),this.reset(!0)}function C(e){if(e||""===e){var n=e[l];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function t(){for(;++o<e.length;)if(a.call(e,o))return t.value=e[o],t.done=!1,t;return t.value=r,t.done=!0,t};return i.next=i}}throw new TypeError(t(e)+" is not iterable")}return w.prototype=_,i(L,"constructor",{value:_,configurable:!0}),i(_,"constructor",{value:w,configurable:!0}),w.displayName=f(_,s,"GeneratorFunction"),n.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===w||"GeneratorFunction"===(e.displayName||e.name))},n.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,_):(t.__proto__=_,f(t,s,"GeneratorFunction")),t.prototype=Object.create(L),t},n.awrap=function(t){return{__await:t}},E(k.prototype),f(k.prototype,c,(function(){return this})),n.AsyncIterator=k,n.async=function(t,e,r,o,a){void 0===a&&(a=Promise);var i=new k(p(t,e,r,o),a);return n.isGeneratorFunction(e)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},E(L),f(L,s,"Generator"),f(L,l,(function(){return this})),f(L,"toString",(function(){return"[object Generator]"})),n.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}},n.values=C,D.prototype={constructor:D,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=r,this.done=!1,this.delegate=null,this.method="next",this.arg=r,this.tryEntries.forEach(G),!t)for(var e in this)"t"===e.charAt(0)&&a.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=r)},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 e=this;function n(n,o){return u.type="throw",u.arg=t,e.next=n,o&&(e.method="next",e.arg=r),!!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 l=a.call(i,"catchLoc"),c=a.call(i,"finallyLoc");if(l&&c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(l){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!c)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,b):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),b},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),G(r),b}},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;G(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:C(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=r),b}},n}function r(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 n(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?r(Object(n),!0).forEach((function(e){o(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function o(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 a(t,e,r,n,o,a,i){try{var u=t[a](i),l=u.value}catch(t){return void r(t)}u.done?e(l):Promise.resolve(l).then(n,o)}System.register(["./utils-lib-legacy.js?v=VERSION_NUMBER","./base-lib-legacy.js?v=VERSION_NUMBER","./form-item-legacy.js?v=VERSION_NUMBER","./index-legacy62.js?v=VERSION_NUMBER","./useController-legacy10.js?v=VERSION_NUMBER","./__commonjsHelpers__-legacy.js?v=VERSION_NUMBER","./index-legacy104.js?v=VERSION_NUMBER","./index-legacy103.js?v=VERSION_NUMBER","./column-legacy.js?v=VERSION_NUMBER","./index-legacy145.js?v=VERSION_NUMBER"],(function(t,r){"use strict";var o,i,u,l,c,s,f,p,h,d,v,y,m,b,g,w,_,x,j,O,L,E,k,P,S,N,G,D,C,F;return{setters:[function(t){o=t.G,i=t.ab,u=t.f1,l=t.e},function(t){c=t.c,s=t.r,f=t.g,p=t.e,h=t.c2,d=t.D,v=t.B,y=t.aw,m=t.au,b=t.aj,g=t.ai,w=t.p,_=t.a4,x=t.q,j=t.v,O=t.x},function(t){L=t.b,E=t.h,k=t.k,P=t.F},function(t){S=t.u,N=t.h,G=t.c,D=t.a,C=t.r},function(t){F=t.c},null,null,null,null,null],execute:function(){var r={class:"p-[2rem]"},T=c({__name:"index",setup:function(t,l){var c,T,I=l.expose,V=S(),H=V.isHttpClbEdit,q=V.addNodeData,A=V.httpRowData,B=V.nodeClbHttpRefresh,R=V.domainList,U=s([{label:"轮询 - 按照权重依次分配请求到上游服务器",value:"round_robin"},{label:"coockie跟随 - 基于coockie选择实际的上游服务,保证每位访问者每次访问到同一个上游服务器",value:"sticky_cookie"},{label:"IP跟随 - 基于访问者的IP地址选择实际的上游服务,保证每位访问者每次访问到同一个上游服务器(拥有CDN的网站不推荐使用)",value:"ip_hash"},{label:"最少链接 - 每次优先选择当前链接数量较少的上游服务器来处理访问者的请求",value:"least_conn"}]),Y=o({data:N,options:function(t){return f((function(){return[L("名称","ps",{attrs:{disabled:H.value,class:"!w-[320px]",placeholder:"请输入负载均衡名称"},rules:[{required:!0,message:"请输入负载均衡名称"},{validator:function(t,e,r){e.length>=3?r():r(new Error("请输入至少大于3个字符"))},trigger:["blur","change"]}]}),!H.value&&E("选择网站",(function(){return p(h,{modelValue:t.value.site_name,"onUpdate:modelValue":function(e){return t.value.site_name=e},"fetch-suggestions":G(R.value),clearable:!0,class:"inline-input !w-[32rem]",onSelect:function(t){return t.value.value},"value-key":"label",placeholder:"请输入或选择网站"},null)}),"site_name"),k("负载方式","http_alg",U.value,{attrs:{placeholder:"请选择负载方式",class:"!w-[74rem]"}}),P((function(){return p("div",null,[p("div",{class:"flex justify-between items-center mb-5"},[p(d,{type:"primary",onClick:D},{default:function(){return[v("添加负载均衡节点")]}})]),p(y,{data:q.value,"table-layout":"auto"},{default:function(){return[p(m,{prop:"node_remarks",label:"负载均衡节点",width:"120"},null),p(m,{prop:"node_site_name",label:"节点网站",width:"120"},null),p(m,{prop:"port",label:"端口",width:"70"},null),p(m,{prop:"path",label:"验证路径",width:"100"},null),p(m,{prop:"node_status",label:"节点状态"},{default:function(t){var e=t.row;return p(b,{modelValue:e.node_status,"onUpdate:modelValue":function(t){return e.node_status=t},style:"width: 70px"},{default:function(){return[p(g,{label:"参与",value:"online"},null),p(g,{label:"备份",value:"backup"},null),p(g,{label:"停用",value:"down"},null)]}})}}),p(m,{prop:"weight",label:"权重",width:"60"},null),p(m,{prop:"max_fail",label:"最大失败次数",width:"90"},null),p(m,{prop:"fail_timeout",label:"恢复时间(秒)",width:"100"},null),p(m,{prop:"ps",label:"备注"},null),p(m,{label:"操作",width:"60"},{default:function(t){return p("span",{class:"bt-link",onClick:function(){return C(t.$index)}},[v("删除")])}})]}})])}))]}))},submit:(c=e().mark((function t(r,o,a){var l,c,s,f,p,h,d,v,y;return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,o();case 3:return c=r.value,s=c.ps,f=c.site_name,p=c.http_alg,c.site_id,d=c.load_id,v=i(q.value),h=null===(l=R.value.find((function(t){return t.label===f})))||void 0===l?void 0:l.value,y=n(n({ps:s,site_name:f},u(h)?{}:{site_id:h}),{},{http_config:{http_alg:p,proxy_next_upstream:"error timeout http_500 http_502 http_503 http_504"},nodes:v}),H.value&&(y.http_config.proxy_next_upstream=r.value.http_config.proxy_next_upstream,y.site_id=r.value.site_id,y.load_id=d,y.name=r.value.name),t.next=10,F({mod_name:"node",sub_mod_name:"load",def_name:H.value?"modify_http_load":"create_http_load",ws_callback:H.value?"modify_http_load":"create_http_load",data:n({},y)});case 10:return B.value=!0,t.abrupt("return",!0);case 14:return t.prev=14,t.t0=t.catch(0),t.abrupt("return",!1);case 18:case"end":return t.stop()}}),t,null,[[0,14]])})),T=function(){var t=this,e=arguments;return new Promise((function(r,n){var o=c.apply(t,e);function i(t){a(o,r,n,i,u,"next",t)}function u(t){a(o,r,n,i,u,"throw",t)}i(void 0)}))},function(t,e,r){return T.apply(this,arguments)})}),$=Y.BtForm;return I({onConfirm:Y.submit}),w((function(){u(A.value)||(q.value=i(A.value.nodes))})),_((function(){q.value=[]})),function(t,e){return x(),j("div",r,[p(O($))])}}});t("default",l(T,[["__scopeId","data-v-530db14a"]]))}}}))}();
Save File
Cancel