← Back
Editing: index-legacy352.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={},a=Object.prototype,o=a.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},l="function"==typeof Symbol?Symbol:{},u=l.iterator||"@@iterator",c=l.asyncIterator||"@@asyncIterator",s=l.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 a=e&&e.prototype instanceof x?e:x,o=Object.create(a.prototype),l=new T(n||[]);return i(o,"_invoke",{value:S(t,r,l)}),o}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}n.wrap=p;var h="suspendedStart",v="suspendedYield",y="executing",g="completed",m={};function x(){}function w(){}function b(){}var _={};f(_,u,(function(){return this}));var L=Object.getPrototypeOf,j=L&&L(L(N([])));j&&j!==a&&o.call(j,u)&&(_=j);var k=b.prototype=x.prototype=Object.create(_);function E(t){["next","throw","return"].forEach((function(e){f(t,e,(function(t){return this._invoke(e,t)}))}))}function O(e,r){function n(a,i,l,u){var c=d(e[a],e,i);if("throw"!==c.type){var s=c.arg,f=s.value;return f&&"object"==t(f)&&o.call(f,"__await")?r.resolve(f.__await).then((function(t){n("next",t,l,u)}),(function(t){n("throw",t,l,u)})):r.resolve(f).then((function(t){s.value=t,l(s)}),(function(t){return n("throw",t,l,u)}))}u(c.arg)}var a;i(this,"_invoke",{value:function(t,e){function o(){return new r((function(r,a){n(t,e,r,a)}))}return a=a?a.then(o,o):o()}})}function S(t,e,n){var a=h;return function(o,i){if(a===y)throw Error("Generator is already running");if(a===g){if("throw"===o)throw i;return{value:r,done:!0}}for(n.method=o,n.arg=i;;){var l=n.delegate;if(l){var u=G(l,n);if(u){if(u===m)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(a===h)throw a=g,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);a=y;var c=d(t,e,n);if("normal"===c.type){if(a=n.done?g:v,c.arg===m)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(a=g,n.method="throw",n.arg=c.arg)}}}function G(t,e){var n=e.method,a=t.iterator[n];if(a===r)return e.delegate=null,"throw"===n&&t.iterator.return&&(e.method="return",e.arg=r,G(t,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var o=d(a,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,m;var i=o.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,m):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,m)}function P(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 C(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function T(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(P,this),this.reset(!0)}function N(e){if(e||""===e){var n=e[u];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var a=-1,i=function t(){for(;++a<e.length;)if(o.call(e,a))return t.value=e[a],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=b,i(k,"constructor",{value:b,configurable:!0}),i(b,"constructor",{value:w,configurable:!0}),w.displayName=f(b,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,b):(t.__proto__=b,f(t,s,"GeneratorFunction")),t.prototype=Object.create(k),t},n.awrap=function(t){return{__await:t}},E(O.prototype),f(O.prototype,c,(function(){return this})),n.AsyncIterator=O,n.async=function(t,e,r,a,o){void 0===o&&(o=Promise);var i=new O(p(t,e,r,a),o);return n.isGeneratorFunction(e)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},E(k),f(k,s,"Generator"),f(k,u,(function(){return this})),f(k,"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=N,T.prototype={constructor:T,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(C),!t)for(var e in this)"t"===e.charAt(0)&&o.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,a){return l.type="throw",l.arg=t,e.next=n,a&&(e.method="next",e.arg=r),!!a}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],l=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var u=o.call(i,"catchLoc"),c=o.call(i,"finallyLoc");if(u&&c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(u){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&&o.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var a=n;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=t,i.arg=e,a?(this.method="next",this.next=a.finallyLoc,m):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),m},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),C(r),m}},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 a=n.arg;C(r)}return a}}throw Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:N(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=r),m}},n}function r(t,e,r,n,a,o,i){try{var l=t[o](i),u=l.value}catch(t){return void r(t)}l.done?e(u):Promise.resolve(u).then(n,a)}function n(t){return function(){var e=this,n=arguments;return new Promise((function(a,o){var i=t.apply(e,n);function l(t){r(i,a,o,l,u,"next",t)}function u(t){r(i,a,o,l,u,"throw",t)}l(void 0)}))}}System.register(["./base-lib-legacy.js?v=VERSION_NUMBER","./utils-lib-legacy.js?v=VERSION_NUMBER","./form-item-legacy.js?v=VERSION_NUMBER","./index-legacy63.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","./useController-legacy6.js?v=VERSION_NUMBER","./site-legacy.js?v=VERSION_NUMBER","./validator-legacy.js?v=VERSION_NUMBER","./useStore-legacy4.js?v=VERSION_NUMBER"],(function(t,r){"use strict";var a,o,i,l,u,c,s,f,p,d,h,v,y,g,m,x,w,b,_,L,j,k,E,O,S,G,P,C,T,N,F,I;return{setters:[function(t){a=t.c,o=t.g,i=t.e,l=t.B,u=t.D,c=t.H,s=t.G,f=t.aw,p=t.au,d=t.aQ,h=t.a$,v=t.a4,y=t.q,g=t.v,m=t.y,x=t.x},function(t){w=t.M,b=t.f5,_=t.n,L=t.L,j=t.p,k=t.K,E=t.f3,O=t.iV,S=t.iW,G=t.f1,P=t.G,C=t.e},function(t){T=t.h},function(t){N=t.u,F=t.h,I=t.f},null,null,null,null,null,null,null,null],execute:function(){var q=N(),R=q.redisGroupDetail,D=q.isRedisRefreshList,Q=function(){var t=n(e().mark((function t(r){var a,o,i,l,u,c,s,f;return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(a=r.row,o=r.slaveListLoad,i=r.api,l=r.loadingText,u=r.needConfirm,c=r.confirmOptions,s=a.data.node_id,f=R.value.group_info.group_id,t.prev=3,!u||!c){t.next=7;break}return t.next=7,j(c);case 7:return t.next=9,k({loading:l,request:i({group_id:f,slave_node_id:s}),message:!0,success:function(){var t=n(e().mark((function t(r){var n,a;return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o.value=!0,t.next=3,E({group_id:f});case 3:n=t.sent,a=n.data,R.value.slave_details=a.data.slave_details,o.value=!1,D.value=!0;case 8:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()});case 9:t.next=14;break;case 11:t.prev=11,t.t0=t.catch(3);case 14:case"end":return t.stop()}}),t,null,[[3,11]])})));return function(e){return t.apply(this,arguments)}}(),A=function(){var t=n(e().mark((function t(n){var a,o,i,l,u,c;return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o=null===(a=n.group_info)||void 0===a?void 0:a.group_id,i=w.load("正在获取可用从节点,请稍后..."),t.prev=2,t.next=5,b();case 5:l=t.sent,(u=l.data).status||w.error(u.msg||"获取可用节点数据失败!"),c=u.data.filter((function(t){return null===t.group_info})),_({title:"添加从节点",area:50,btn:["添加从节点","取消"],component:function(){return L((function(){return r.import("./add-slave-node-legacy.js?v=VERSION_NUMBER")}),void 0,r.meta.url)},compData:{group_id:o,nodes:c||[]}}),t.next=16;break;case 13:t.prev=13,t.t0=t.catch(2);case 16:return t.prev=16,null==i||i.close(),t.finish(16);case 19:case"end":return t.stop()}}),t,null,[[2,13,16,19]])})));return function(e){return t.apply(this,arguments)}}(),B={class:"p-[2rem] redis-mgt-group-page"},H=a({__name:"index",setup:function(t){var e=N(),r=e.redisGroupDetail,n=e.slaveListLoad,a=o((function(){var t,e,n,a,o,u,c=(null===(t=r.value)||void 0===t||null===(t=t.master_detail)||void 0===t?void 0:t.data)||{},s=c.memory||{},f=c.performance||{},p=i("span",{class:"text-[#999]"},[l("...")]);return[{label:"节点地址",value:null!==(e=c.address)&&void 0!==e?e:p},{label:"Redis版本",value:null!==(n=c.redis_version)&&void 0!==n?n:p},{label:"运行天数",value:G(c.uptime_days)?p:c.uptime_days+"天"},{label:"内存使用",value:null!==(a=s.used_memory_human)&&void 0!==a?a:p},{label:"当前QPS",value:null!==(o=f.qps)&&void 0!==o?o:p},{label:"连接数",value:null!==(u=c.connected_slaves)&&void 0!==u?u:p}]})),w=P({data:r.value,options:function(t){return o((function(){return[T("",(function(){return i("div",{class:"w-full mb-[32px]"},[i("div",{class:"flex items-center mb-[20px]"},[i("span",{class:"text-[14px] mr-[1rem]"},[l("基本信息")]),i(u,{disabled:n.value,type:"default",class:"!h-[28px] !text-[12px]",onClick:function(){return F(r,"master")}},{default:function(){return[l("查看详细信息")]}})]),i("div",{class:"grid grid-cols-2 gap-x-[24px] gap-y-[12px] text-[#666]"},[a.value.map((function(t){return i("div",{class:"flex justify-between items-center bg-[#fafafa] rounded-[6px] px-[16px] py-[8px]"},[i("span",{class:"font-bold w-[90px] flex-shrink-0"},[t.label]),i("span",{class:"flex-1 text-right"},[t.value])])}))])])}),"base_info"),T("",(function(){var t;return i("div",{class:"w-full"},[i("div",{class:"flex items-center mb-[12px]"},[i("span",{class:"text-[14px]"},[l("从节点列表")]),i(u,{type:"primary",class:"ml-auto !h-[28px] !px-[12px] !text-[12px]",onClick:function(){return A(r.value)}},{default:function(){return[l("添加从节点")]}})]),c(i(f,{data:r.value.slave_details,"table-layout":"auto",height:(null===(t=r.value.slave_details)||void 0===t?void 0:t.length)>10?"40rem":"auto",class:"w-full"},{default:function(){return[i(p,{prop:"server_ip",label:"地址","min-width":"140"},{default:function(t){var e=t.row;return i("span",{class:"text-[12px]"},[e.data.server_ip])}}),i(p,{prop:"status",label:"状态",width:"80"},{default:function(t){var e=t.row;return"online"===e.data.status?i("span",{class:"bg-[#eaffea] text-[#20a53a] px-[8px] py-[2px] rounded"},[l("在线")]):i("span",{class:"bg-[#fff1f0] text-[#ff4d4f] cursor-pointer px-[8px] py-[2px] rounded"},[l("离线"),i(d,{content:e.data.replication.error,placement:"top"},{default:function(){return[i("span",{class:"ml-4px bt-ico-ask"},[l("?")])]}})])}}),i(p,{prop:"health_score",label:"健康度",width:"80"},{default:function(t){var e=t.row,r=e.data.health_score||0,n="online"===e.data.status;return i("span",{style:{display:"inline-flex",alignItems:"center"}},[i("span",{style:{display:"inline-flex",justifyContent:"center",alignItems:"center",width:"40px",height:"40px",borderRadius:"50%",background:n?"#22c55e":"#ef4444",color:"#fff",fontWeight:700,fontSize:"12px",marginRight:"4px",transition:"background 0.2s"}},[r,l("%")])])}}),i(p,{prop:"memory",label:"内存",width:"60"},{default:function(t){var e=t.row;return I(e.data.memory.usage_percent)}}),i(p,{prop:"qps",label:"QPS",width:"80"},{default:function(t){return t.row.data.performance.qps||"--"}}),i(p,{prop:"lag",label:"延迟(秒)",width:"80"},{default:function(t){return t.row.data.replication.lag||"--"}}),i(p,{prop:"delay",label:"偏移量",width:"80"},{default:function(t){return t.row.data.replication.repl_offset||"--"}}),i(p,{align:"right",label:"操作",width:"140"},{default:function(t){t.$index;var e=t.row;return i("div",{class:"flex items-center justify-end"},["offline"===e.data.status&&i("span",null,[i("span",{class:"bt-link",onClick:function(){return function(t,e){return Q({row:t,slaveListLoad:e,api:S,loadingText:"正在重连,请稍后..."})}(e,n)}},[l("重启")]),i(h,{direction:"vertical"},null)]),i("span",{class:"bt-link",onClick:function(){return F(e,"slave")}},[l("详情")]),"online"===e.data.status&&i("span",null,[i(h,{direction:"vertical"},null),i("span",{class:"bt-link",onClick:function(){return function(t,e){return Q({row:t,slaveListLoad:e,api:O,loadingText:"正在移除从节点,请稍后...",needConfirm:!0,confirmOptions:{icon:"warning-filled",title:"移除从节点",content:"即将移除该从节点,是否继续操作?"}})}(e,n)}},[l("移除")])])])}})]}}),[[s("bt-loading"),n.value]])])}),"slave_table")]}))}}).BtForm;return v((function(){r.value={},n.value=!0})),function(t,e){return y(),g("div",B,[m("div",null,[i(x(w))])])}}});t("default",C(H,[["__scopeId","data-v-a251a9c0"]]))}}}))}();
Save File
Cancel