File: /www/server/panel/BTPanel/static/js/index-legacy522.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",l=a.toStringTag||"@@toStringTag";function i(e,a,o,l){var i=a&&a.prototype instanceof s?a:s,c=Object.create(i.prototype);return t(c,"_invoke",function(e,t,a){var o,l,i,s=0,c=a||[],d=!1,f={p:0,n:0,v:n,a:p,f:p.bind(n,4),d:function(e,t){return o=e,l=0,i=n,f.n=t,u}};function p(e,t){for(l=e,i=t,r=0;!d&&s&&!a&&r<c.length;r++){var a,o=c[r],p=f.p,v=o[2];e>3?(a=v===t)&&(i=o[(l=o[4])?5:(l=3,3)],o[4]=o[5]=n):o[0]<=p&&((a=e<2&&p<o[1])?(l=0,f.v=t,f.n=o[1]):p<v&&(a=e<3||o[0]>t||t>v)&&(o[4]=e,o[5]=t,f.n=v,l=0))}if(a||e>1)return u;throw d=!0,t}return function(a,c,v){if(s>1)throw TypeError("Generator is already running");for(d&&1===c&&p(c,v),l=c,i=v;(r=l<2?n:i)||!d;){o||(l?l<3?(l>1&&(f.n=-1),p(l,i)):f.n=i:f.v=i);try{if(s=2,o){if(l||(a="next"),r=o[a]){if(!(r=r.call(o,i)))throw TypeError("iterator result is not an object");if(!r.done)return r;i=r.value,l<2&&(l=0)}else 1===l&&(r=o.return)&&r.call(o),l<2&&(i=TypeError("The iterator does not provide a '"+a+"' method"),l=1);o=n}else if((r=(d=f.n<0)?i:e.call(t,f))!==u)break}catch(r){o=n,l=1,i=r}finally{s=1}}return{value:r,done:d}}}(e,o,l),!0),c}var u={};function s(){}function c(){}function d(){}r=Object.getPrototypeOf;var f=[][o]?r(r([][o]())):(t(r={},o,function(){return this}),r),p=d.prototype=s.prototype=Object.create(f);function v(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,d):(e.__proto__=d,t(e,l,"GeneratorFunction")),e.prototype=Object.create(p),e}return c.prototype=d,t(p,"constructor",d),t(d,"constructor",c),c.displayName="GeneratorFunction",t(d,l,"GeneratorFunction"),t(p),t(p,l,"Generator"),t(p,o,function(){return this}),t(p,"toString",function(){return"[object Generator]"}),(e=function(){return{w:i,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 l(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:(l("next",0),l("throw",1),l("return",2))},t(e,n,r,a)}function n(e,t,n,r,a,o,l){try{var i=e[o](l),u=i.value}catch(e){return void n(e)}i.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 l=e.apply(t,r);function i(e){n(l,a,o,i,u,"next",e)}function u(e){n(l,a,o,i,u,"throw",e)}i(void 0)})}}System.register(["./base-lib-legacy.js?v=1777008528","./utils-lib-legacy.js?v=1777008528","./form-item-legacy.js?v=1777008528","./index-legacy75.js?v=1777008528","./__commonjsHelpers__-legacy.js?v=1777008528","./index-legacy119.js?v=1777008528","./index-legacy118.js?v=1777008528","./index-legacy3.js?v=1777008528","./index-legacy116.js?v=1777008528","./useController-legacy13.js?v=1777008528","./site-legacy.js?v=1777008528","./useStore-legacy2.js?v=1777008528"],function(t,n){"use strict";var a,o,l,i,u,s,c,d,f,p,v,g,m,y,b,x,h,_,w,j,k,O,S,T,C,G,L,P,q,R,F,I;return{setters:[function(e){a=e.c,o=e.g,l=e.e,i=e.x,u=e.z,s=e.J,c=e.I,d=e.aA,f=e.ay,p=e.aW,v=e.G,g=e.a8,m=e.j,y=e.k,b=e.q,x=e.p},function(e){h=e.M,_=e.gT,w=e.e,j=e._,k=e.w,O=e.k,S=e.eb,T=e.gU,C=e.gV,G=e.fj,L=e.X,P=e.cZ},function(e){q=e.g},function(e){R=e.u,F=e.h,I=e.f},null,null,null,null,null,null,null,null],execute:function(){var D=R(),E=D.redisGroupDetail,z=D.isRedisRefreshList,Q=function(){var t=r(e().m(function t(n){var a,o,l,i,u,s,c,d,f;return e().w(function(t){for(;;)switch(t.p=t.n){case 0:if(a=n.row,o=n.slaveListLoad,l=n.api,i=n.loadingText,u=n.needConfirm,s=n.confirmOptions,c=a.data.node_id,d=E.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:i,request:l({group_id:d,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,S({group_id:d});case 1:r=e.v,a=r.data,E.value.slave_details=a.data.slave_details,o.value=!1,z.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,f=t.v,console.warn(f);case 5:return t.a(2)}},t,null,[[1,4]])}));return function(e){return t.apply(this,arguments)}}(),W=function(){var t=r(e().m(function t(r){var a,o,l,i,u,s,c;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,l=h.load("正在获取可用从节点,请稍后..."),e.p=1,e.n=2,_();case 2:i=e.v,(u=i.data).status||h.error(u.msg||"获取可用节点数据失败!"),console.log("res.data",u.data.group_info),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=1777008528")},void 0,n.meta.url)},compData:{group_id:o,nodes:s||[]}}),e.n=4;break;case 3:e.p=3,c=e.v,console.warn(c);case 4:return e.p=4,null==l||l.close(),e.f(4);case 5:return e.a(2)}},t,null,[[1,3,4,5]])}));return function(e){return t.apply(this,arguments)}}(),A={class:"p-[2rem] redis-mgt-group-page"},B=a({__name:"index",setup:function(e){var t=R(),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||{},d=s.performance||{},f=l("span",{class:"text-tertiary"},[i("...")]);return[{label:"节点地址",value:null!==(t=s.address)&&void 0!==t?t:f},{label:"Redis版本",value:null!==(r=s.redis_version)&&void 0!==r?r:f},{label:"运行天数",value:G(s.uptime_days)?f:s.uptime_days+"天"},{label:"内存使用",value:null!==(a=c.used_memory_human)&&void 0!==a?a:f},{label:"当前QPS",value:null!==(o=d.qps)&&void 0!==o?o:f},{label:"连接数",value:null!==(u=s.connected_slaves)&&void 0!==u?u:f}]}),h=L({data:n.value,options:function(e){return o(function(){return[q("",function(){return l("div",{class:"w-full mb-[32px]"},[l("div",{class:"flex items-center mb-[20px]"},[l("span",{class:"text-base mr-[1rem]"},[i("基本信息")]),l(u,{disabled:r.value,type:"default",class:"!h-[28px] !text-small",onClick:function(){return F(n,"master")}},{default:function(){return[i("查看详细信息")]}})]),l("div",{class:"grid grid-cols-2 gap-x-[24px] gap-y-[12px] text-secondary"},[a.value.map(function(e){return l("div",{class:"flex justify-between items-center bg-lighter rounded-medium px-[16px] py-[8px]"},[l("span",{class:"font-bold w-[90px] flex-shrink-0"},[e.label]),l("span",{class:"flex-1 text-right"},[e.value])])})])])},"base_info"),q("",function(){var e;return l("div",{class:"w-full"},[l("div",{class:"flex items-center mb-[12px]"},[l("span",{class:"text-base"},[i("从节点列表")]),l(u,{type:"primary",class:"ml-auto !h-[28px] !px-[12px] !text-small",onClick:function(){return W(n.value)}},{default:function(){return[i("添加从节点")]}})]),s(l(d,{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[l(f,{prop:"server_ip",label:"地址","min-width":"140"},{default:function(e){var t=e.row;return l("span",{class:"text-small"},[t.data.server_ip])}}),l(f,{prop:"status",label:"状态",width:"80"},{default:function(e){var t=e.row;return"online"===t.data.status?l("span",{class:"bg-[var(--el-color-success-light-8)] text-primary px-[8px] py-[2px] rounded"},[i("在线")]):l("span",{class:"bg-light text-danger cursor-pointer px-[8px] py-[2px] rounded"},[i("离线"),l(p,{content:t.data.replication.error,placement:"top"},{default:function(){return[l("span",{class:"ml-4px bt-ico-ask"},[i("?")])]}})])}}),l(f,{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 l("span",{style:{display:"inline-flex",alignItems:"center"}},[l("span",{style:{display:"inline-flex",justifyContent:"center",alignItems:"center",width:"40px",height:"40px",borderRadius:"50%",background:r?"var(--el-color-primary)":"var(--el-color-danger)",color:"var(--el-color-white)",fontWeight:700,fontSize:"12px",marginRight:"4px",transition:"background 0.2s"}},[n,i("%")])])}}),l(f,{prop:"memory",label:"内存",width:"60"},{default:function(e){var t=e.row;return I(t.data.memory.usage_percent)}}),l(f,{prop:"qps",label:"QPS",width:"80"},{default:function(e){return e.row.data.performance.qps||"--"}}),l(f,{prop:"lag",label:"延迟(秒)",width:"80"},{default:function(e){return e.row.data.replication.lag||"--"}}),l(f,{prop:"delay",label:"偏移量",width:"80"},{default:function(e){return e.row.data.replication.repl_offset||"--"}}),l(f,{align:"right",label:"操作",width:"140"},{default:function(e){e.$index;var t=e.row;return l("div",{class:"flex items-center justify-end"},["offline"===t.data.status&&l("span",null,[l("span",{class:"bt-link",onClick:function(){return function(e,t){return Q({row:e,slaveListLoad:t,api:C,loadingText:"正在重连,请稍后..."})}(t,r)}},[i("重启")]),l(v,{direction:"vertical"},null)]),l("span",{class:"bt-link",onClick:function(){return F(t,"slave")}},[i("详情")]),"online"===t.data.status&&l("span",null,[l(v,{direction:"vertical"},null),l("span",{class:"bt-link",onClick:function(){return function(e,t){return Q({row:e,slaveListLoad:t,api:T,loadingText:"正在移除从节点,请稍后...",needConfirm:!0,confirmOptions:{icon:"warning-filled",title:"移除从节点",content:"即将移除该从节点,是否继续操作?"}})}(t,r)}},[i("移除")])])])}})]}}),[[c("bt-loading"),r.value]])])},"slave_table")]})}}).BtForm;return g(function(){n.value={},r.value=!0}),function(e,t){return m(),y("div",A,[b("div",null,[l(x(h))])])}}});t("default",P(B,[["__scopeId","data-v-f6121d5a"]]))}}})}();