← Back
Editing: index-legacy343.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 h(t,e,r,n){var o=e&&e.prototype instanceof b?e:b,a=Object.create(o.prototype),u=new G(n||[]);return i(a,"_invoke",{value:S(t,r,u)}),a}function p(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}r.wrap=h;var v="suspendedStart",d="suspendedYield",y="executing",m="completed",g={};function b(){}function w(){}function _(){}var x={};f(x,c,(function(){return this}));var j=Object.getPrototypeOf,O=j&&j(j(T([])));O&&O!==n&&a.call(O,c)&&(x=O);var L=_.prototype=b.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,c){var l=p(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 S(t,r,n){var o=v;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=k(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===v)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var l=p(t,r,n);if("normal"===l.type){if(o=n.done?m:d,l.arg===g)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=m,n.method="throw",n.arg=l.arg)}}}function k(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,k(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=p(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 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 D(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 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=_,i(L,"constructor",{value:_,configurable:!0}),i(_,"constructor",{value:w,configurable:!0}),w.displayName=f(_,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,_):(t.__proto__=_,f(t,s,"GeneratorFunction")),t.prototype=Object.create(L),t},r.awrap=function(t){return{__await:t}},E(P.prototype),f(P.prototype,l,(function(){return this})),r.AsyncIterator=P,r.async=function(t,e,n,o,a){void 0===a&&(a=Promise);var i=new P(h(t,e,n,o),a);return r.isGeneratorFunction(e)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},E(L),f(L,s,"Generator"),f(L,c,(function(){return this})),f(L,"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,G.prototype={constructor:G,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(["./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,e){"use strict";var n,a,u,c,l,s,f,h,p,v,d,y,m,g,b,w,_,x,j,O,L,E,P,S;return{setters:[function(t){n=t.G,a=t.eQ,u=t.M,c=t.aa},function(t){l=t.c,s=t.r,f=t.g,h=t.e,p=t.c2,v=t.B,d=t.D,y=t.a4,m=t.q,g=t.v,b=t.x},function(t){w=t.k,_=t.h,x=t.b,j=t.f},function(t){O=t.u,L=t.c,E=t.t},function(t){P=t.u,S=t.a},null,null,null,null,null],execute:function(){var e={class:"p-[2rem]"};t("default",l({__name:"index",props:{compData:{default:function(){return{nodes:[]}}}},setup:function(t,l){var k,N=l.expose,D=O(),G=D.addNodeData,T=(D.httpRowData,P()),F=T.nodesStatusList,C=T.testLinkStatus,q=s(t.compData.nodes.map((function(t){return{label:"".concat(t.label," - ").concat(t.server_ip," (").concat(""==t.version?"本机地址":t.version," ").concat(S(t.version,"9.7.0")<0?"版本较低无法显示站点":"",")"),value:t.value}}))),I=s([]),A=s(!1),B=s(""),V=s({path:"/",weight:1,max_fail:5,fail_timeout:10,ps:"",node_status:"online"}),Y=n({data:function(){return V.value},options:function(t){return f((function(){return[w("负载均衡节点","node_id",q.value,{attrs:{class:"!w-[38rem]",placeholder:"请选择负载均衡节点",onChange:(e=i(o().mark((function e(r){var n,i;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return A.value=!0,I.value=[],t.value.node_site_name="",e.prev=3,e.next=6,a({node_id:r});case 6:n=e.sent,(i=n.data).msg&&!1===i.status&&u.error(i.msg),I.value=i.data.map((function(t){return{label:t.site_name,value:t.site_id,port:t.ports}})),e.next=15;break;case 12:e.prev=12,e.t0=e.catch(3);case 15:return e.prev=15,A.value=!1,e.finish(15);case 18:case"end":return e.stop()}}),e,null,[[3,12,15,18]])}))),function(t){return e.apply(this,arguments)})},rules:[{required:!0,message:"请选择负载均衡节点"}]}),_("节点网站",(function(){return h(p,{modelValue:t.value.node_site_name,"onUpdate:modelValue":function(e){return t.value.node_site_name=e},"fetch-suggestions":L(I.value),clearable:!0,class:"inline-input !w-[38rem]",onSelect:function(e){var r,n,o,a;return B.value=e.value,t.value.node_site_id=e.value,a=null===(r=I.value.find((function(t){return t.value===e.value})))||void 0===r?void 0:r.port,t.value.port=null!==(n=a)&&void 0!==n&&n[1]?a[1]:(null===(o=a)||void 0===o?void 0:o[0])||80,e.value},"value-key":"label",placeholder:"请输入或选择网站"},null)}),"node_site_name",{rules:[{required:!0,message:"请输入或选择节点网站"}]}),x("端口","port",{attrs:{class:"!w-[38rem]",placeholder:"请输入端口"},rules:[c({message:"请输入端口"})]}),x("验证路径","path",{attrs:{class:"!w-[38rem]",placeholder:"请输入验证路径"}}),w("节点算法","node_status",F.value,{attrs:{class:"!w-[38rem]",placeholder:"请输入或选择节点算法"}}),x("权重","weight",{attrs:{class:"!w-[38rem]",placeholder:"请输入权重"}}),x("阈值","max_fail",{attrs:{class:"!w-[38rem]",placeholder:"请输入最大失败次数"}}),x("恢复时间(秒)","fail_timeout",{attrs:{class:"!w-[37.5rem]",placeholder:"请输入恢复时间(秒)"}}),x("备注信息","ps",{attrs:{class:"!w-[38rem]",placeholder:"请输入备注"}}),_("测试连接",(function(){return h(d,{type:"primary",loading:C.value,onClick:function(){return E(t,I.value)}},{default:function(){return[v("测试连接")]}})})),j("",[{content:"[节点算法]: 节点在负载均衡中的参与类型,参与:参与负载均衡,备用:无可用节点时启用,停用:停止使用的节点"},{content:"[权重] 当前节点在负载均衡中的节点负载权重,数值越大,使用率越高,请根据节点负载能力设置"},{content:"[阀值] 当负载节点访问故障次数超过指定阀值时,自动暂停此节点"},{content:"[恢复时间] 当负载节点因访问故障被自动暂停后,尝试自动恢复的间隔时间"},{content:"当后端节点返回的http状态码在错误状态码中时,该节点将会被视为处理失败"},{content:"当该节点在恢复时间内失败次数到达阈值后将会自动暂停访问该节点,并在间隔恢复时间时长后再次尝试使用该节点"}],{attrs:{class:"!mt-[1rem]"}})];var e}))},submit:(k=i(o().mark((function t(e,n,a){var i,u,c;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,n();case 2:return i=q.value.find((function(t){return t.value===e.value.node_id}))||"",I.value.some((function(t){return t.label===e.value.node_site_name}))||delete e.value.node_site_id,u=e.value.port,c=r(r({node_remarks:i.label.split("-")[0].trim()},e.value),{},{port:Number(u)}),G.value.push(c),t.abrupt("return",!0);case 10:case"end":return t.stop()}}),t)}))),function(t,e,r){return k.apply(this,arguments)})}),H=Y.BtForm;return N({onConfirm:Y.submit}),y((function(){C.value=!1,B.value=""})),function(t,r){return m(),g("div",e,[h(b(H))])}}}))}}}))}();
Save File
Cancel