← Back
Editing: index-legacy342.js
!function(){function e(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var n,r,a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.toStringTag||"@@toStringTag";function l(e,a,o,i){var l=a&&a.prototype instanceof s?a:s,c=Object.create(l.prototype);return t(c,"_invoke",function(e,t,a){var o,i,l,s=0,c=a||[],f=!1,p={p:0,n:0,v:n,a:d,f:d.bind(n,4),d:function(e,t){return o=e,i=0,l=n,p.n=t,u}};function d(e,t){for(i=e,l=t,r=0;!f&&s&&!a&&r<c.length;r++){var a,o=c[r],d=p.p,v=o[2];e>3?(a=v===t)&&(l=o[(i=o[4])?5:(i=3,3)],o[4]=o[5]=n):o[0]<=d&&((a=e<2&&d<o[1])?(i=0,p.v=t,p.n=o[1]):d<v&&(a=e<3||o[0]>t||t>v)&&(o[4]=e,o[5]=t,p.n=v,i=0))}if(a||e>1)return u;throw f=!0,t}return function(a,c,v){if(s>1)throw TypeError("Generator is already running");for(f&&1===c&&d(c,v),i=c,l=v;(r=i<2?n:l)||!f;){o||(i?i<3?(i>1&&(p.n=-1),d(i,l)):p.n=l:p.v=l);try{if(s=2,o){if(i||(a="next"),r=o[a]){if(!(r=r.call(o,l)))throw TypeError("iterator result is not an object");if(!r.done)return r;l=r.value,i<2&&(i=0)}else 1===i&&(r=o.return)&&r.call(o),i<2&&(l=TypeError("The iterator does not provide a '"+a+"' method"),i=1);o=n}else if((r=(f=p.n<0)?l:e.call(t,p))!==u)break}catch(r){o=n,i=1,l=r}finally{s=1}}return{value:r,done:f}}}(e,o,i),!0),c}var u={};function s(){}function c(){}function f(){}r=Object.getPrototypeOf;var p=[][o]?r(r([][o]())):(t(r={},o,function(){return this}),r),d=f.prototype=s.prototype=Object.create(p);function v(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,f):(e.__proto__=f,t(e,i,"GeneratorFunction")),e.prototype=Object.create(d),e}return c.prototype=f,t(d,"constructor",f),t(f,"constructor",c),c.displayName="GeneratorFunction",t(f,i,"GeneratorFunction"),t(d),t(d,i,"Generator"),t(d,o,function(){return this}),t(d,"toString",function(){return"[object Generator]"}),(e=function(){return{w:l,m:v}})()}function t(e,n,r,a){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}t=function(e,n,r,a){function i(n,r){t(e,n,function(e){return this._invoke(n,r,e)})}n?o?o(e,n,{value:r,enumerable:!a,configurable:!a,writable:!a}):e[n]=r:(i("next",0),i("throw",1),i("return",2))},t(e,n,r,a)}function n(e,t,n,r,a,o,i){try{var l=e[o](i),u=l.value}catch(e){return void n(e)}l.done?t(u):Promise.resolve(u).then(r,a)}function r(e){return function(){var t=this,r=arguments;return new Promise(function(a,o){var i=e.apply(t,r);function l(e){n(i,a,o,l,u,"next",e)}function u(e){n(i,a,o,l,u,"throw",e)}l(void 0)})}}System.register(["./base-lib-legacy.js?v=1765440387","./utils-lib-legacy.js?v=1765440387","./form-item-legacy.js?v=1765440387","./index-legacy63.js?v=1765440387","./__commonjsHelpers__-legacy.js?v=1765440387","./index-legacy94.js?v=1765440387","./index-legacy93.js?v=1765440387","./column-legacy.js?v=1765440387","./useController-legacy6.js?v=1765440387","./site-legacy.js?v=1765440387","./validator-legacy.js?v=1765440387","./useStore-legacy3.js?v=1765440387"],function(t,n){"use strict";var a,o,i,l,u,s,c,f,p,d,v,g,m,x,y,b,h,_,w,j,k,O,G,L,S,C,T,P,R,q,D,F;return{setters:[function(e){a=e.c,o=e.g,i=e.e,l=e.B,u=e.D,s=e.H,c=e.G,f=e.ax,p=e.av,d=e.aR,v=e.b0,g=e.a5,m=e.q,x=e.v,y=e.y,b=e.x},function(e){h=e.M,_=e.f5,w=e.l,j=e.L,k=e.o,O=e.K,G=e.f3,L=e.it,S=e.iu,C=e.f1,T=e.G,P=e.e},function(e){R=e.h},function(e){q=e.u,D=e.h,F=e.f},null,null,null,null,null,null,null,null],execute:function(){var E=q(),I=E.redisGroupDetail,B=E.isRedisRefreshList,H=function(){var t=r(e().m(function t(n){var a,o,i,l,u,s,c,f;return e().w(function(t){for(;;)switch(t.p=t.n){case 0:if(a=n.row,o=n.slaveListLoad,i=n.api,l=n.loadingText,u=n.needConfirm,s=n.confirmOptions,c=a.data.node_id,f=I.value.group_info.group_id,t.p=1,!u||!s){t.n=2;break}return t.n=2,k(s);case 2:return t.n=3,O({loading:l,request:i({group_id:f,slave_node_id:c}),message:!0,success:function(){var t=r(e().m(function t(n){var r,a;return e().w(function(e){for(;;)switch(e.n){case 0:return o.value=!0,e.n=1,G({group_id:f});case 1:r=e.v,a=r.data,I.value.slave_details=a.data.slave_details,o.value=!1,B.value=!0;case 2:return e.a(2)}},t)}));return function(e){return t.apply(this,arguments)}}()});case 3:t.n=5;break;case 4:t.p=4,t.v;case 5:return t.a(2)}},t,null,[[1,4]])}));return function(e){return t.apply(this,arguments)}}(),Q=function(){var t=r(e().m(function t(r){var a,o,i,l,u,s;return e().w(function(e){for(;;)switch(e.p=e.n){case 0:return o=null===(a=r.group_info)||void 0===a?void 0:a.group_id,i=h.load("正在获取可用从节点,请稍后..."),e.p=1,e.n=2,_();case 2:l=e.v,(u=l.data).status||h.error(u.msg||"获取可用节点数据失败!"),s=u.data.filter(function(e){return null===e.group_info}),w({title:"添加从节点",area:50,btn:["添加从节点","取消"],component:function(){return j(function(){return n.import("./add-slave-node-legacy.js?v=1765440387")},void 0,n.meta.url)},compData:{group_id:o,nodes:s||[]}}),e.n=4;break;case 3:e.p=3,e.v;case 4:return e.p=4,null==i||i.close(),e.f(4);case 5:return e.a(2)}},t,null,[[1,3,4,5]])}));return function(e){return t.apply(this,arguments)}}(),z={class:"p-[2rem] redis-mgt-group-page"},K=a({__name:"index",setup:function(e){var t=q(),n=t.redisGroupDetail,r=t.slaveListLoad,a=o(function(){var e,t,r,a,o,u,s=(null===(e=n.value)||void 0===e||null===(e=e.master_detail)||void 0===e?void 0:e.data)||{},c=s.memory||{},f=s.performance||{},p=i("span",{class:"text-[#999]"},[l("...")]);return[{label:"节点地址",value:null!==(t=s.address)&&void 0!==t?t:p},{label:"Redis版本",value:null!==(r=s.redis_version)&&void 0!==r?r:p},{label:"运行天数",value:C(s.uptime_days)?p:s.uptime_days+"天"},{label:"内存使用",value:null!==(a=c.used_memory_human)&&void 0!==a?a:p},{label:"当前QPS",value:null!==(o=f.qps)&&void 0!==o?o:p},{label:"连接数",value:null!==(u=s.connected_slaves)&&void 0!==u?u:p}]}),h=T({data:n.value,options:function(e){return o(function(){return[R("",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:r.value,type:"default",class:"!h-[28px] !text-[12px]",onClick:function(){return D(n,"master")}},{default:function(){return[l("查看详细信息")]}})]),i("div",{class:"grid grid-cols-2 gap-x-[24px] gap-y-[12px] text-[#666]"},[a.value.map(function(e){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"},[e.label]),i("span",{class:"flex-1 text-right"},[e.value])])})])])},"base_info"),R("",function(){var e;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 Q(n.value)}},{default:function(){return[l("添加从节点")]}})]),s(i(f,{data:n.value.slave_details,"table-layout":"auto",height:(null===(e=n.value.slave_details)||void 0===e?void 0:e.length)>10?"40rem":"auto",class:"w-full"},{default:function(){return[i(p,{prop:"server_ip",label:"地址","min-width":"140"},{default:function(e){var t=e.row;return i("span",{class:"text-[12px]"},[t.data.server_ip])}}),i(p,{prop:"status",label:"状态",width:"80"},{default:function(e){var t=e.row;return"online"===t.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:t.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(e){var t=e.row,n=t.data.health_score||0,r="online"===t.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:r?"#22c55e":"#ef4444",color:"#fff",fontWeight:700,fontSize:"12px",marginRight:"4px",transition:"background 0.2s"}},[n,l("%")])])}}),i(p,{prop:"memory",label:"内存",width:"60"},{default:function(e){var t=e.row;return F(t.data.memory.usage_percent)}}),i(p,{prop:"qps",label:"QPS",width:"80"},{default:function(e){return e.row.data.performance.qps||"--"}}),i(p,{prop:"lag",label:"延迟(秒)",width:"80"},{default:function(e){return e.row.data.replication.lag||"--"}}),i(p,{prop:"delay",label:"偏移量",width:"80"},{default:function(e){return e.row.data.replication.repl_offset||"--"}}),i(p,{align:"right",label:"操作",width:"140"},{default:function(e){e.$index;var t=e.row;return i("div",{class:"flex items-center justify-end"},["offline"===t.data.status&&i("span",null,[i("span",{class:"bt-link",onClick:function(){return function(e,t){return H({row:e,slaveListLoad:t,api:S,loadingText:"正在重连,请稍后..."})}(t,r)}},[l("重启")]),i(v,{direction:"vertical"},null)]),i("span",{class:"bt-link",onClick:function(){return D(t,"slave")}},[l("详情")]),"online"===t.data.status&&i("span",null,[i(v,{direction:"vertical"},null),i("span",{class:"bt-link",onClick:function(){return function(e,t){return H({row:e,slaveListLoad:t,api:L,loadingText:"正在移除从节点,请稍后...",needConfirm:!0,confirmOptions:{icon:"warning-filled",title:"移除从节点",content:"即将移除该从节点,是否继续操作?"}})}(t,r)}},[l("移除")])])])}})]}}),[[c("bt-loading"),r.value]])])},"slave_table")]})}}).BtForm;return g(function(){n.value={},r.value=!0}),function(e,t){return m(),x("div",z,[y("div",null,[i(b(h))])])}}});t("default",P(K,[["__scopeId","data-v-a251a9c0"]]))}}})}();
Save File
Cancel