← Back
Editing: index-legacy345.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 G(n||[]);return i(a,"_invoke",{value:S(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 y="suspendedStart",d="suspendedYield",v="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 P(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 S(t,e,n){var o=y;return function(a,i){if(o===v)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=k(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===y)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=v;var c=h(t,e,n);if("normal"===c.type){if(o=n.done?m:d,c.arg===b)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(o=m,n.method="throw",n.arg=c.arg)}}}function k(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,k(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 T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function G(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(P.prototype),f(P.prototype,c,(function(){return this})),n.AsyncIterator=P,n.async=function(t,e,r,o,a){void 0===a&&(a=Promise);var i=new P(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,G.prototype={constructor:G,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(T),!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),T(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;T(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","./index-legacy62.js?v=VERSION_NUMBER","./form-item-legacy.js?v=VERSION_NUMBER","./useController-legacy10.js?v=VERSION_NUMBER","./__commonjsHelpers__-legacy.js?v=VERSION_NUMBER","./index-legacy103.js?v=VERSION_NUMBER","./column-legacy.js?v=VERSION_NUMBER","./index-legacy104.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,y,d,v,m,b,g,w,_,x,j,O,L,E,P,S,k;return{setters:[function(t){o=t.G,i=t.bV,u=t.aa,l=t.ab},function(t){c=t.c,s=t.g,f=t.e,p=t.D,h=t.B,y=t.aw,d=t.au,v=t.aj,m=t.ai,b=t.p,g=t.a4,w=t.q,_=t.v,x=t.x},function(t){j=t.b,O=t.d,L=t.f},function(t){E=t.b,P=t.i,S=t.F},function(t){k=t.c},null,null,null,null,null],execute:function(){var r={class:"p-[2rem]"};t("default",c({__name:"index",setup:function(t,c){var N,T,G=c.expose,C=j(),D=C.isTcpudpClbEdit,F=C.addTcpudpNodeData,I=C.nodeClbTcpudpRefresh,V=o({data:O,options:function(t){return s((function(){return[E("名称","ps",{attrs:{disabled:D.value,class:"!w-[320px]",placeholder:"请输入负载均衡名称"},rules:[i({message:"请输入负载均衡名称",trigger:["blur","change"]})]}),P("协议","type",[{label:"TCP",value:"tcp"},{label:"UDP",value:"udp"}]),P("监听地址","host",[{label:"127.0.0.1",value:"127.0.0.1"},{label:"0.0.0.0",value:"0.0.0.0"}]),E("监听端口","port",{attrs:{class:"!w-[320px]",placeholder:"请输入监听端口"},rules:[u({message:"请输入监听端口"})]}),E("超时时间(秒) ","proxy_timeout",{attrs:{class:"!w-[320px]",placeholder:"连接节点时的最大超时时间,默认8秒"}}),E("保持时间(秒)","proxy_connect_timeout",{attrs:{class:"!w-[320px]",placeholder:"连接成功后最长无操作时间,默认86400秒"}}),S((function(){return f("div",null,[f("div",{class:"flex justify-between items-center mb-5"},[f(p,{type:"primary",onClick:L},{default:function(){return[h("添加负载均衡节点")]}})]),f(y,{data:F.value,"table-layout":"auto"},{default:function(){return[f(d,{prop:"node_id",label:"负载均衡节点"},{default:function(t){var e=t.row;return f("span",null,[e.host])}}),f(d,{prop:"port",label:"端口"},null),f(d,{prop:"node_status",label:"节点状态"},{default:function(t){var e=t.row;return f(v,{modelValue:e.node_status,"onUpdate:modelValue":function(t){return e.node_status=t},style:"width: 70px"},{default:function(){return[f(m,{label:"参与",value:"online"},null),f(m,{label:"备份",value:"backup"},null),f(m,{label:"停用",value:"down"},null)]}})}}),f(d,{prop:"weight",label:"权重"},null),f(d,{prop:"max_fail",label:"阈值"},null),f(d,{prop:"fail_timeout",label:"恢复时间(秒)"},null),f(d,{prop:"ps",label:"备注","show-overflow-tooltip":!0,width:"120"},null),f(d,{label:"操作",width:"60"},{default:function(t){return f("span",{class:"bt-link",onClick:function(){return e=t.$index,void F.value.splice(e,1);var e}},[h("删除")])}})]}})])}))]}))},submit:(N=e().mark((function t(r,o,a){var i,u,l,c,s,f,p,h,y,d;return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,o();case 3:return i=r.value,u=i.name,l=i.proxy_connect_timeout,c=i.proxy_timeout,s=i.host,f=i.port,p=i.type,h=i.ps,y=F.value||[],d={name:u,ps:h,tcp_config:{type:p,host:s,port:Number(f),proxy_connect_timeout:Number(l),proxy_timeout:Number(c)},nodes:y},D.value&&(d.load_id=r.value.load_id),t.next=9,k({mod_name:"node",sub_mod_name:"load",def_name:D.value?"modify_tcp_load":"create_tcp_load",ws_callback:D.value?"modify_tcp_load":"create_tcp_load",data:n({},d)});case 9:return I.value=!0,t.abrupt("return",!0);case 13:return t.prev=13,t.t0=t.catch(0),t.abrupt("return",!1);case 17:case"end":return t.stop()}}),t,null,[[0,13]])})),T=function(){var t=this,e=arguments;return new Promise((function(r,n){var o=N.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)})}),A=V.BtForm;return G({onConfirm:V.submit}),b((function(){var t;F.value=l(null!==(t=O().nodes)&&void 0!==t?t:[])})),g((function(){F.value=[]})),function(t,e){return w(),_("div",r,[f(x(A))])}}}))}}}))}();
Save File
Cancel