From 441dd2b43bae5cd882f7dc30d8b5c78caf185072 Mon Sep 17 00:00:00 2001 From: midoks Date: Tue, 16 Feb 2021 14:20:34 +0800 Subject: [PATCH] up --- plugins/mysql/index.py | 14 ++------------ plugins/mysql/js/mysql.js | 24 ++++++++++++------------ 2 files changed, 14 insertions(+), 24 deletions(-) diff --git a/plugins/mysql/index.py b/plugins/mysql/index.py index a20384ddc..71d2d7a46 100755 --- a/plugins/mysql/index.py +++ b/plugins/mysql/index.py @@ -1394,7 +1394,8 @@ def getMasterStatus(version=''): con = mw.readFile(conf) master_status = False if con.find('#log-bin') == -1 and con.find('log-bin') > 1: - if con.find('binlog-do-db') > 1: + dodb = findBinlogDoDb() + if len(dodb) > 0: master_status = True data = {} data['status'] = master_status @@ -1414,17 +1415,6 @@ def setMasterStatus(version=''): if con.find('#log-bin') != -1: return mw.returnJson(False, '必须开启二进制日志') - - if con.find('#binlog-do-db') != -1: - con = con.replace('#binlog-do-db', 'binlog-do-db') - con = con.replace('#binlog-ignore-db', 'binlog-ignore-db') - else: - con = con.replace('binlog-do-db', '#binlog-do-db') - con = con.replace('binlog-ignore-db', '#binlog-ignore-db') - - mw.writeFile(conf, con) - restart(version) - time.sleep(4) return mw.returnJson(True, '设置成功') diff --git a/plugins/mysql/js/mysql.js b/plugins/mysql/js/mysql.js index a4cd35aa6..b29e9769b 100755 --- a/plugins/mysql/js/mysql.js +++ b/plugins/mysql/js/mysql.js @@ -1688,15 +1688,15 @@ function masterOrSlaveConf(version=''){ $(".soft-man-con").html(limitCon); //设置主服务器配置 - $(".btn-master").click(function () { - myPost('set_master_status', 'close=change', function(data){ - var rdata = $.parseJSON(data.data); - layer.msg(rdata.msg, { icon: rdata.status ? 1 : 5 }); - setTimeout(function(){ - getMasterStatus(); - }, 3000); - }); - }); + // $(".btn-master").click(function () { + // myPost('set_master_status', 'close=change', function(data){ + // var rdata = $.parseJSON(data.data); + // layer.msg(rdata.msg, { icon: rdata.status ? 1 : 5 }); + // setTimeout(function(){ + // getMasterStatus(); + // }, 3000); + // }); + // }); $(".btn-slave").click(function () { myPost('set_slave_status', 'close=change', function(data){ @@ -1708,9 +1708,9 @@ function masterOrSlaveConf(version=''){ }); }); - if (rdata.status){ - getMasterDbList(); - } + // if (rdata.status){ + getMasterDbList(); + // } if (rdata.data.slave_status){ getAsyncMasterDbList();