← Back
Editing: index-legacy63.js
!function(){function e(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o,u,i=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(i.push(r.value),i.length!==t);l=!0);}catch(e){c=!0,a=e}finally{try{if(!l&&null!=n.return&&(u=n.return(),Object(u)!==u))return}finally{if(c)throw a}}return i}}(e,n)||function(e,n){if(e){if("string"==typeof e)return t(e,n);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?t(e,n):void 0}}(e,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function t(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(Object(n),!0).forEach((function(t){o(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function o(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var a=r.call(e,t||"default");if("object"!=n(a))return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function u(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */u=function(){return t};var e,t={},r=Object.prototype,a=r.hasOwnProperty,o=Object.defineProperty||function(e,t,n){e[t]=n.value},i="function"==typeof Symbol?Symbol:{},l=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function p(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{p({},"")}catch(e){p=function(e,t,n){return e[t]=n}}function f(e,t,n,r){var a=t&&t.prototype instanceof g?t:g,u=Object.create(a.prototype),i=new M(r||[]);return o(u,"_invoke",{value:E(e,n,i)}),u}function v(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=f;var d="suspendedStart",m="suspendedYield",h="executing",y="completed",b={};function g(){}function _(){}function w(){}var x={};p(x,l,(function(){return this}));var k=Object.getPrototypeOf,j=k&&k(k(C([])));j&&j!==r&&a.call(j,l)&&(x=j);var S=w.prototype=g.prototype=Object.create(x);function O(e){["next","throw","return"].forEach((function(t){p(e,t,(function(e){return this._invoke(t,e)}))}))}function L(e,t){function r(o,u,i,l){var c=v(e[o],e,u);if("throw"!==c.type){var s=c.arg,p=s.value;return p&&"object"==n(p)&&a.call(p,"__await")?t.resolve(p.__await).then((function(e){r("next",e,i,l)}),(function(e){r("throw",e,i,l)})):t.resolve(p).then((function(e){s.value=e,i(s)}),(function(e){return r("throw",e,i,l)}))}l(c.arg)}var u;o(this,"_invoke",{value:function(e,n){function a(){return new t((function(t,a){r(e,n,t,a)}))}return u=u?u.then(a,a):a()}})}function E(t,n,r){var a=d;return function(o,u){if(a===h)throw Error("Generator is already running");if(a===y){if("throw"===o)throw u;return{value:e,done:!0}}for(r.method=o,r.arg=u;;){var i=r.delegate;if(i){var l=P(i,r);if(l){if(l===b)continue;return l}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(a===d)throw a=y,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);a=h;var c=v(t,n,r);if("normal"===c.type){if(a=r.done?y:m,c.arg===b)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(a=y,r.method="throw",r.arg=c.arg)}}}function P(t,n){var r=n.method,a=t.iterator[r];if(a===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,P(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),b;var o=v(a,t.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,b;var u=o.arg;return u?u.done?(n[t.resultName]=u.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,b):u:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,b)}function q(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function R(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function M(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(q,this),this.reset(!0)}function C(t){if(t||""===t){var r=t[l];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,u=function n(){for(;++o<t.length;)if(a.call(t,o))return n.value=t[o],n.done=!1,n;return n.value=e,n.done=!0,n};return u.next=u}}throw new TypeError(n(t)+" is not iterable")}return _.prototype=w,o(S,"constructor",{value:w,configurable:!0}),o(w,"constructor",{value:_,configurable:!0}),_.displayName=p(w,s,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===_||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,w):(e.__proto__=w,p(e,s,"GeneratorFunction")),e.prototype=Object.create(S),e},t.awrap=function(e){return{__await:e}},O(L.prototype),p(L.prototype,c,(function(){return this})),t.AsyncIterator=L,t.async=function(e,n,r,a,o){void 0===o&&(o=Promise);var u=new L(f(e,n,r,a),o);return t.isGeneratorFunction(n)?u:u.next().then((function(e){return e.done?e.value:u.next()}))},O(S),p(S,s,"Generator"),p(S,l,(function(){return this})),p(S,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=C,M.prototype={constructor:M,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(R),!t)for(var n in this)"t"===n.charAt(0)&&a.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function r(r,a){return i.type="throw",i.arg=t,n.next=r,a&&(n.method="next",n.arg=e),!!a}for(var o=this.tryEntries.length-1;o>=0;--o){var u=this.tryEntries[o],i=u.completion;if("root"===u.tryLoc)return r("end");if(u.tryLoc<=this.prev){var l=a.call(u,"catchLoc"),c=a.call(u,"finallyLoc");if(l&&c){if(this.prev<u.catchLoc)return r(u.catchLoc,!0);if(this.prev<u.finallyLoc)return r(u.finallyLoc)}else if(l){if(this.prev<u.catchLoc)return r(u.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<u.finallyLoc)return r(u.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&a.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var o=r;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var u=o?o.completion:{};return u.type=e,u.arg=t,o?(this.method="next",this.next=o.finallyLoc,b):this.complete(u)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),b},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),R(n),b}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var a=r.arg;R(n)}return a}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:C(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),b}},t}function i(e,t,n,r,a,o,u){try{var i=e[o](u),l=i.value}catch(e){return void n(e)}i.done?t(l):Promise.resolve(l).then(r,a)}function l(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var o=e.apply(t,n);function u(e){i(o,r,a,u,l,"next",e)}function l(e){i(o,r,a,u,l,"throw",e)}u(void 0)}))}}System.register(["./utils-lib-legacy.js?v=VERSION_NUMBER","./base-lib-legacy.js?v=VERSION_NUMBER","./index-legacy103.js?v=VERSION_NUMBER","./column-legacy.js?v=VERSION_NUMBER","./useController-legacy6.js?v=VERSION_NUMBER"],(function(t,r){"use strict";var o,i,c,s,p,f,v,d,m,h,y,b,g,_,w,x,k,j,S,O,L,E,P,q,R,M,C,T,B,D,A,N,G,I,W,Y,F,H,z,Q,$,V,J,U,K,Z,X,ee,te,ne;return{setters:[function(e){o=e.K,i=e.eY,c=e.eZ,s=e.at,p=e.e_,f=e.e$,v=e.u,d=e.eP,m=e.M,h=e.n,y=e.L,b=e.p,g=e.a6,_=e.w,w=e.R,x=e.f0,k=e.f1,j=e.aM,S=e.f2,O=e.a7,L=e.a8,E=e.e,P=e.f3,q=e.f4,R=e.f5,M=e.f6,C=e.al},function(e){T=e.j,B=e.bJ,D=e.s,A=e.r,N=e.e,G=e.B,I=e.bM,W=e.bN,Y=e.i,F=e.c,H=e.p,z=e.n,Q=e.q,$=e.v,V=e.A,J=e.x,U=e.J,K=e.M,Z=e.P},function(e){X=e._},function(e){ee=e.c,te=e.u,ne=e.a},null],execute:function(){t("g",(function(e){var t,n,r,a,o,u,i,l,c,s,p,f,v,d,m,h,y,b,g,w,x,k,j,S,O,L,E,P,q,R,M=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"master";var C="master"==M?(null===(t=e.value)||void 0===t?void 0:t.master_detail.data)||{}:e.data||{},T=C.memory||{},B=C.performance||{},D=C.connections||{},A=C.replication||{},N=[{name:"base",label:"基础信息",items:[{label:"节点状态",value:"online"===C.status?"在线":"离线"},{label:"Redis版本",value:C.redis_version||"--"},{label:"运行天数",value:(null!==(n=C.uptime_days)&&void 0!==n?n:"--")+"天"},{label:"监听端口",value:null!==(r=C.port)&&void 0!==r?r:"--"},{label:"连接数",value:null!==(a=C.connected_slaves)&&void 0!==a?a:"--"},{label:"角色",value:null!==(o=C.role)&&void 0!==o?o:"--"}]},{name:"memory",label:"内存信息",items:[{label:"已使用内存",value:null!==(u=T.used_memory_human)&&void 0!==u?u:"--"},{label:"系统内存",value:T.max_memory?_(T.max_memory):"--"},{label:"内存使用率",value:null!=T.usage_percent?Oe(T.usage_percent):"--",tooltip:"计算方式:已使用内存/系统内存"}]},{name:"connection",label:"连接信息",items:[{label:"当前连接数",value:null!==(i=D.connected_clients)&&void 0!==i?i:"--"},{label:"总连接数",value:null!==(l=D.total_connections)&&void 0!==l?l:"--",tooltip:"仅记录TCP连接数"},{label:"最大连接数限制",value:null!==(c=D.max_clients)&&void 0!==c?c:"--"},{label:"拒绝连接数",value:null!==(s=D.rejected_connections)&&void 0!==s?s:"--"}]},{name:"performance",label:"性能统计",items:[{label:"当前QPS",value:null!==(p=B.qps)&&void 0!==p?p:"--"},{label:"总执行命令数",value:null!==(f=B.total_commands)&&void 0!==f?f:"--"},{label:"键命中次数",value:null!==(v=B.keyspace_hits)&&void 0!==v?v:"--"},{label:"键未命中次数",value:null!==(d=B.keyspace_misses)&&void 0!==d?d:"--"},{label:"命中率",value:null!=B.hit_rate?Oe(B.hit_rate):"--"}]}],G=[{name:"base",label:"基础信息",items:[{label:"Redis版本",value:C.redis_version||"--"},{label:"运行天数",value:(null!==(m=C.uptime_days)&&void 0!==m?m:"--")+"天"},{label:"监听端口",value:null!==(h=C.tcp_port)&&void 0!==h?h:"--"},{label:"角色",value:null!==(y=A.role)&&void 0!==y?y:"--"},{label:"主节点地址",value:null!==(b=A.master_host)&&void 0!==b?b:"--"},{label:"主节点端口",value:null!==(g=A.master_port)&&void 0!==g?g:"--"}]},{name:"memory",label:"内存信息",items:[{label:"已使用内存",value:null!==(w=T.used_memory_human)&&void 0!==w?w:"--"},{label:"系统内存",value:T.max_memory?_(T.max_memory):"--"},{label:"内存使用率",value:null!=T.usage_percent?Oe(T.usage_percent):"--"}]},{name:"connection",label:"连接信息",items:[{label:"当前连接数",value:null!==(x=D.connected_clients)&&void 0!==x?x:"--"},{label:"总连接数",value:null!==(k=D.total_connections)&&void 0!==k?k:"--"},{label:"阻塞连接数",value:null!==(j=D.rejected_connections)&&void 0!==j?j:"--"}]},{name:"replication",label:"复制信息",items:[{label:"主从连接状态",value:null!==(S=A.master_link_status)&&void 0!==S?S:"--"},{label:"最后IO时间",value:A.last_io_seconds?A.last_io_seconds+"秒前":"--"},{label:"同步进度",value:A.sync_in_progress?"是":"否"},{label:"复制偏移量",value:null!==(O=A.repl_offset)&&void 0!==O?O:"--"},{label:"复制延迟(秒)",value:null!==(L=A.lag)&&void 0!==L?L:"--"},{label:"是否在线",value:A.is_online?"是":"否"}]},{name:"performance",label:"性能统计",items:[{label:"当前QPS",value:null!==(E=B.qps)&&void 0!==E?E:"--"},{label:"总执行命令数",value:null!==(P=B.total_commands)&&void 0!==P?P:"--"},{label:"键命中次数",value:null!==(q=B.keyspace_hits)&&void 0!==q?q:"--"},{label:"键未命中次数",value:null!==(R=B.keyspace_misses)&&void 0!==R?R:"--"},{label:"命中率",value:null!=B.hit_rate?Oe(B.hit_rate):"--"}]}];return"master"==M?N:G}));var re=T("MASTER-STORE",(function(){return{tabActive:B("nodeRedisTabActive","mysqlMaster")}})),ae=T("MASTER-MYSQL-STORE",(function(){var e=A(!1),t=A([]),n=function(){var e=l(u().mark((function e(t){var n,r;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,n={slave_ip:t.slave_ip},e.next=4,o({loading:"正在删除从库,请稍候...",request:i(n),message:!0});case 4:return r=e.sent,e.abrupt("return",{status:r.status,msg:r.msg});case 8:return e.prev=8,e.t0=e.catch(0),e.abrupt("return",{status:!1,msg:"删除从库失败"});case 12:case"end":return e.stop()}}),e,null,[[0,8]])})));return function(t){return e.apply(this,arguments)}}(),r=function(){var t=l(u().mark((function t(n,r,a,o){var c,s,p;return u().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return c=o.label,s=o.value,p=function(){var e=l(u().mark((function e(t,n){return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:e.t0=s,e.next="delete"===e.t0?3:6;break;case 3:return e.next=5,i({slave_ip:t.slave_ip});case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),t.next=4,n({title:"批量".concat(c,"从库"),content:"批量".concat(c,"已选的从库,是否继续操作!"),column:[{label:"从库地址",prop:"slave_ip"},ee()],onConfirm:function(){var t=l(u().mark((function t(){return u().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,r(p);case 2:return e.value=!0,t.abrupt("return",!1);case 4:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}()});case 4:case"end":return t.stop()}}),t)})));return function(e,n,r,a){return t.apply(this,arguments)}}(),a=function(){var e=l(u().mark((function e(){var t;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,c();case 3:return t=e.sent,e.abrupt("return",t);case 7:e.prev=7,e.t0=e.catch(0),s(e.t0);case 10:case"end":return e.stop()}}),e,null,[[0,7]])})));return function(){return e.apply(this,arguments)}}(),v=function(){var e=l(u().mark((function e(t){var n;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,p(t);case 3:return n=e.sent,e.abrupt("return",n);case 7:e.prev=7,e.t0=e.catch(0),s(e.t0);case 10:case"end":return e.stop()}}),e,null,[[0,7]])})));return function(t){return e.apply(this,arguments)}}(),d=function(){var e=l(u().mark((function e(t,n){var r;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,f({slave_ip:t.slave_ip,status:n});case 3:return r=e.sent,e.abrupt("return",r);case 7:e.prev=7,e.t0=e.catch(0),s(e.t0);case 10:case"end":return e.stop()}}),e,null,[[0,7]])})));return function(t,n){return e.apply(this,arguments)}}();return{deleteMysqlSlaveEvent:n,multDeleteMysqlSlaveEvent:r,setMysqlSlaveEvent:d,getMysqlSlaveHistoryEvent:a,deleteMysqlSlaveHistoryEvent:v,isRefreshList:e,mysqlRowData:t}})),oe=t("a",(function(){return a(a({},ae()),D(ae()))}));function ue(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!Y(e)}var ie=oe().mysqlRowData,le=v(),ce=(le.plugin,le.getGlobalInfo),se=function(){var e=l(u().mark((function e(){var t,a;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,ce();case 2:return a=e.sent,e.next=5,o({request:d(),loading:"正在获取节点数据,请稍等...",success:function(e){e.msg&&!1===e.status&&m.error(e.msg),ie.value=e.data.data.filter((function(e){return!e.is_local&&!e.lpver})).map((function(e){return{label:"".concat(e.remarks," - ").concat(e.server_ip),value:e.id,remarks:e.server_ip}}))}});case 5:h({title:"添加主从",area:62,compData:{panel_address:"object"===n(a)&&(null==a||null===(t=a.panel)||void 0===t?void 0:t.address)},btn:["添加","取消"],component:function(){return y((function(){return r.import("./add-form-legacy.js?v=VERSION_NUMBER")}),void 0,r.meta.url)},showFooter:!0});case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),pe=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];(0,de().openMasterSlaveLog)(e,t)},fe=function(){var e=l(u().mark((function e(t){var n,r,a,o,i,l;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=oe(),r=n.deleteMysqlSlaveEvent,a=n.isRefreshList,e.next=3,b({title:"".concat("删除mysql从库【".concat(t.slave_ip,"】")),content:"".concat("风险操作,此操作不可逆,删除【".concat(t.slave_ip,"】后您将无法管理该从库,是否继续操作?"))});case 3:return e.next=5,r(t);case 5:o=e.sent,i=o.status,l=o.msg,i?(m.success(l),a.value=!0):m.error(l);case 9:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),ve=function(){var e=l(u().mark((function e(t){var n,r,a;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,b({title:"".concat("start"===t.run_status?"停止":"启动","从库同步【").concat(t.slave_ip,"】"),content:"是否确认".concat("start"===t.run_status?"停止":"启动","从库同步【").concat(t.slave_ip,"】?")});case 2:return n=oe(),r=n.setMysqlSlaveEvent,a=n.isRefreshList,e.next=5,r(t,"start"===t.run_status?"stop":"start");case 5:a.value=!0;case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),de=function(){var t=function(){var t=l(u().mark((function t(n){var r,a,o,i,l,c=arguments;return u().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=c.length>1&&void 0!==c[1]&&c[1],a=A(),!r||"done"!==n.config_status){t.next=10;break}return t.next=5,x({slave_ip:n.slave_ip});case 5:o=t.sent,i=o.data,a.value=i,t.next=16;break;case 10:if(k(n.error_msg)){t.next=14;break}a.value=n.error_msg,t.next=16;break;case 14:return"done"!==n.config_status&&m.error("主从配置未完成,请先完成主从配置:操作 - 同步中"),t.abrupt("return");case 16:l=m.load("正在获取日志信息,请稍后..."),h({title:"从库状态日志",area:60,component:function(){var t;return N("div",{class:"p-[1.6rem] max-h-[60rem] overflow-y-auto"},[N("div",{class:"mb-[1.6rem]"},[G("从库地址: "),n.slave_ip]),N(I,{column:1,border:!0},ue(t=Object.entries(a.value).map((function(t){var n,r=e(t,2),a=r[0],o=r[1];return N(W,{label:a},ue(n=String(o))?n:{default:function(){return[n]}})})))?t:{default:function(){return[t]}})])}}),null==l||l.close();case 19:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}();return{openMasterSlaveLog:t}},me=t("b",(function(e){h({title:"同步进度",area:[60,"auto"],component:function(){return y((function(){return r.import("./index-legacy348.js?v=VERSION_NUMBER")}),void 0,r.meta.url)},compData:{slave_ip:e}})})),he=F({__name:"index",setup:function(e){v();var t,n=oe(),a=n.isRefreshList,o=n.multDeleteMysqlSlaveEvent,i=j({options:[{type:"button",label:"添加主从",active:!0,onClick:se},{type:"button",label:"历史备份",active:!1,onClick:function(){var e,t,n,r=(e=oe(),t=e.getMysqlSlaveHistoryEvent,n=e.deleteMysqlSlaveHistoryEvent,{openHistoryBackup:function(){var e,r,a=g({request:(r=l(u().mark((function e(){var n,r;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t();case 2:return n=e.sent,(r=n.data).msg&&!1===r.status&&m.error(r.msg),e.abrupt("return",{data:r.data,total:r.data.length});case 6:case"end":return e.stop()}}),e)}))),function(){return r.apply(this,arguments)}),columns:[{label:"文件名",prop:"name"},{label:"大小",prop:"size",render:function(e){return _(e.size)}},{label:"创建时间",prop:"mtime",width:160,render:function(e){return w(e.mtime)}},te([{title:"下载",onClick:function(e){window.open("/download?filename="+e.path)}},{title:"删除",onClick:(e=l(u().mark((function e(t){var r,a,o;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,b({title:"删除备份文件",content:"是否确认删除该备份文件?"});case 2:return e.next=4,n({path:t.path});case 4:r=e.sent,a=r.status,o=r.msg,a?(m.success(o),i()):m.error(o);case 8:case"end":return e.stop()}}),e)}))),function(t){return e.apply(this,arguments)})}])]}),o=a.BtTable,i=a.refresh;h({title:"主库历史备份文件",area:62,component:function(){return N("div",{class:"p-[1.6rem]"},[N(o,{maxHeight:"40rem"},null)])}})}});(0,r.openHistoryBackup)()}}]}),c=i.BtOperation,s=L([{label:"删除从库",value:"delete",event:o}]),p=function(e){return{label:e.label,prop:e.prop,render:function(t){var n="function"==typeof e.status?e.status(t):t[e.prop];return e.render?e.render(t):N("span",{class:"bt-link ".concat(e.onClick?"cursor-pointer":""," ").concat(e.class?e.class(t):""),style:{color:"success"===n.type?"#20a53a":"#ef0808"},onClick:function(){var n;null===(n=e.onClick)||void 0===n||n.call(e,t)}},[n.text])}}},f=g({request:(t=l(u().mark((function e(t){var n,r;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,S(t);case 2:return n=e.sent,(r=n.data).msg&&!1===r.status&&m.error(r.msg),e.abrupt("return",{data:r.data,total:0,search:{}});case 6:case"end":return e.stop()}}),e)}))),function(e){return t.apply(this,arguments)}),columns:[ne({key:"slave_ip"}),{label:"从库地址",prop:"slave_ip",minWidth:220},{label:"同步中的数据库",prop:"db_name",render:function(e){return e.db_name}},p({label:"读写状态",prop:"io_status",status:function(e){return{type:"Yes"===e.io_status&&"done"===e.config_status?"success":"danger",text:"done"!==e.config_status?"未开始":"Yes"===e.io_status?"正常":"异常"}},onClick:pe}),p({label:"同步状态",prop:"sql_status",status:function(e){return{type:"Yes"===e.sql_status&&"done"===e.config_status?"success":"danger",text:"done"!==e.config_status?"未开始":"Yes"===e.sql_status?"正常":"异常"}},onClick:pe}),p({label:"是否启用",prop:"run_status",status:function(e){return{type:"start"===e.run_status?"success":"danger",text:"start"===e.run_status?"已启用":"已停用"}},onClick:ve}),te([{render:function(e){var t="done"===e.config_status?"状态":"同步中";return N("span",null,[N("span",{onClick:function(){return"done"===e.config_status?pe(e,!0):me(e.slave_ip)},title:t,class:"bt-link"},[t]),N("div",{class:"el-divider el-divider--vertical",role:"separator",style:"--el-border-style: solid;"},null)])}},{title:"删除",onClick:function(e){return fe(e)}}])],extension:[s,O(a)],empty:function(){return N("span",null,[G("您的列表为空,您可以"),N("span",{class:"bt-link",onClick:se},[G("添加一个主从")])])}}),d=f.BtTable,x=f.BtSearch,k=f.BtRefresh,E=f.BtPage,P=(f.BtColumn,f.BtBatch);f.refresh;return H((function(){z((function(){y((function(){return r.import("./index-legacy349.js?v=VERSION_NUMBER")}),void 0,r.meta.url),y((function(){return r.import("./index-legacy350.js?v=VERSION_NUMBER")}),void 0,r.meta.url)}))})),function(e,t){var n=X;return Q(),$("div",null,[N(n,null,{"header-left":V((function(){return[N(J(c))]})),"header-right":V((function(){return[N(J(x),{class:U(["mr-[10px]","!w-[210px]"]),placeholder:"请输入地址"}),N(J(k))]})),content:V((function(){return[N(J(d))]})),"footer-left":V((function(){return[N(J(P))]})),"footer-right":V((function(){return[N(J(E))]})),_:1})])}}}),ye=E(he,[["__scopeId","data-v-f67b8eeb"]]),be=T("MASTER-REDIS-STORE",(function(){return{isRedisRefreshList:A(!1),redisRowData:A([]),redisAvailableNodes:A({row:[],nodes:[]}),redisGroupDetail:A({}),openNodesLoading:A(!0),slaveListLoad:A(!0)}})),ge=t("u",(function(){return a(a({},be()),D(be()))})),_e=ge(),we=_e.isRedisRefreshList,xe=_e.redisAvailableNodes,ke=_e.redisGroupDetail,je=_e.openNodesLoading,Se=_e.slaveListLoad,Oe=t("f",(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;if("number"!=typeof e||isNaN(e))return"-";var n=(+(100*e).toFixed(t)).toString();return n.indexOf(".")>-1&&(n=(n=n.replace(/\.0+$/,"")).replace(/(\.[1-9]*)0+$/,"$1")),n+"%"})),Le=function(){var e=l(u().mark((function e(){var t,n;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return h({title:"新建主从复制组",area:60,btn:["创建","取消"],component:function(){return y((function(){return r.import("./index-legacy351.js?v=VERSION_NUMBER")}),void 0,r.meta.url)}}),e.prev=1,e.next=4,R();case 4:t=e.sent,(n=t.data).status||m.error(n.msg||"获取可用节点失败!"),xe.value={row:n.data,nodes:n.data.map((function(e){var t;return{label:"".concat(e.name," - ").concat(e.server_ip," ").concat(null===e.group_info?"":"(主从组 - ".concat(null===(t=e.group_info)||void 0===t?void 0:t.group_name,")")),value:e.id,server_ip:e.server_ip,disabled:null!==e.group_info}}))},e.next=14;break;case 11:e.prev=11,e.t0=e.catch(1);case 14:return e.prev=14,je.value=!1,e.finish(14);case 17:case"end":return e.stop()}}),e,null,[[1,11,14,17]])})));return function(){return e.apply(this,arguments)}}(),Ee=function(){var e=l(u().mark((function e(t,n,r,a){var o,i,c;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=a.label,i=a.value,c=function(){var e=l(u().mark((function e(t,n){return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:e.t0=i,e.next="delete"===e.t0?3:6;break;case 3:return e.next=5,q({group_id:t.group_id});case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),e.next=4,t({title:"批量".concat(o),content:"批量删除选中的项目后,项目将无法恢复,是否继续操作?",column:[{label:"主从组名称",prop:"group_name"},ee()],onConfirm:function(){var e=l(u().mark((function e(){return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n(c);case 2:return we.value=!0,e.abrupt("return",!1);case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()});case 4:case"end":return e.stop()}}),e)})));return function(t,n,r,a){return e.apply(this,arguments)}}(),Pe=function(){var e=l(u().mark((function e(t){var n,a;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return h({title:"管理主从复制组【".concat(t.group_name,"】"),area:80,component:function(){return y((function(){return r.import("./index-legacy352.js?v=VERSION_NUMBER")}),void 0,r.meta.url)},compData:{rowData:t}}),e.next=3,P({group_id:t.group_id});case 3:n=e.sent,(a=n.data).status||m.error(a.msg||"获取主从复制组失败!"),ke.value=a.data,Se.value=!1;case 9:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),qe=(t("h",(function(e,t){var n;h({title:"".concat("slave"===t?"从节点详情【".concat(e.data.server_ip,"】"):"主节点详情【".concat(null===(n=e.value)||void 0===n||null===(n=n.master_detail)||void 0===n||null===(n=n.data)||void 0===n?void 0:n.address,"】")),area:70,component:function(){return y((function(){return r.import("./index-legacy353.js?v=VERSION_NUMBER")}),void 0,r.meta.url)},compData:{rowData:e,type:t||"master"}})})),function(){var e=l(u().mark((function e(t){return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=1,e.next=4,b({icon:"warning-filled",title:"删除主从复制组【".concat(t.group_name,"】"),content:"即将删除主从复制组,是否继续操作?"});case 4:return e.next=6,o({loading:"正在删除主从复制组,因需重新还原所有redis相关配置进行重启操作,过程可能较长请稍等...",request:q({group_id:t.group_id}),message:!0,success:function(e){we.value=!0}});case 6:e.next=11;break;case 8:e.prev=8,e.t0=e.catch(1);case 11:case"end":return e.stop()}}),e,null,[[1,8]])})));return function(t){return e.apply(this,arguments)}}());t("o",function(){var e=l(u().mark((function e(t){return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:h({title:"创建主从复制组",area:60,component:function(){return y((function(){return r.import("./redis-create-log-legacy.js?v=VERSION_NUMBER")}),void 0,r.meta.url)},compData:{task_id:t}});case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}());var Re={class:"node-master-redis"},Me=F({__name:"index",setup:function(e){var t,n=ge().isRedisRefreshList,r=L([{label:"删除主从组",value:"delete",event:Ee}]),a=j({options:A([{type:"button",label:"新建主从复制组",active:!0,onClick:function(){return Le()}}])}).BtOperation,o=[ne({key:"group_id"}),{label:"主从组名称",prop:"group_name",minWidth:120},{label:"主库地址",prop:"master_server_ip",minWidth:160},{label:"内存占用",prop:"memory_usage",minWidth:100,render:function(e){return N("span",{style:{color:e.memory_usage>=.95?"#fa1616":e.memory_usage>.8?"#ef8a08":"#20a53a"}},[Oe(e.memory_usage,0)])}},{label:"QPS",prop:"qps",minWidth:80},{label:"连接数",prop:"connections",minWidth:80},{label:"从库数量",prop:"slave_count",minWidth:80},{label:"从库正常数",prop:"normal_slaves",minWidth:100,render:function(e){return N("span",{style:{color:e.normal_slaves<e.slave_count?"#ef0808":"#333"}},[e.normal_slaves])}},{label:"平均延迟(秒)",prop:"avg_lag",minWidth:100},te([{title:"管理",onClick:Pe},{title:"删除",onClick:qe}])],i=g({request:(t=l(u().mark((function e(t){var n,r;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,M(t);case 2:return n=e.sent,(r=n.data).status||m.error(r.msg),e.abrupt("return",{data:r.data,total:r.page.total_count,search:{}});case 6:case"end":return e.stop()}}),e)}))),function(e){return t.apply(this,arguments)}),columns:o,extension:[r,O(n)],empty:function(){return N("span",null,[G("您的列表为空,您可以"),N("span",{class:"bt-link",onClick:function(){return Le()}},[G("新建主从复制组")])])}}),c=i.BtTable,s=i.BtBatch,p=i.BtSearch,f=i.BtRefresh,v=i.BtPage;return function(e,t){var n=X;return Q(),$("div",Re,[N(n,null,{"header-left":V((function(){return[N(J(a))]})),"header-right":V((function(){return[N(J(p),{class:U(["mr-[10px]","!w-[210px]"]),placeholder:"请输入名称或地址"}),N(J(f))]})),content:V((function(){return[N(J(c))]})),"footer-left":V((function(){return[N(J(s))]})),"footer-right":V((function(){return[N(J(v))]})),_:1})])}}}),Ce=[{label:"MySQL",name:"mysqlMaster",lazy:!0,render:function(){return N(ye,null,null)}},{label:"Redis",name:"redisMaster",lazy:!0,render:function(){return N(Me,null,null)}}],Te=F({__name:"index",setup:function(e){var t=D(re()).tabActive;return function(e,n){var r=C;return Q(),K(r,{class:"module-ui",type:"card",modelValue:J(t),"onUpdate:modelValue":n[0]||(n[0]=function(e){return Z(t)?t.value=e:null}),options:J(Ce)},null,8,["modelValue","options"])}}}),Be=Object.freeze(Object.defineProperty({__proto__:null,default:Te},Symbol.toStringTag,{value:"Module"}));t("i",Be)}}}))}();
Save File
Cancel