From f17a9864617d203f1a946fe4cf4476d4b76c5e6d Mon Sep 17 00:00:00 2001 From: midoks Date: Tue, 7 Nov 2023 18:55:44 +0800 Subject: [PATCH] =?UTF-8?q?mysql=20=E5=90=8C=E6=AD=A51236=E9=94=99?= =?UTF-8?q?=E8=AF=AF-=E4=BF=AE=E5=A4=8D=E6=96=B9=E6=A1=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/mysql/index.py | 2 +- plugins/mysql/js/mysql.js | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/plugins/mysql/index.py b/plugins/mysql/index.py index e51b0f3b7..1f5989d5e 100755 --- a/plugins/mysql/index.py +++ b/plugins/mysql/index.py @@ -2487,7 +2487,7 @@ def trySlaveSyncBugfix(version=''): # print(sql) sdb.query(sql) sdb.query('start slave') - return mw.returnJson(True, 'ok') + return mw.returnJson(True, '修复成功!') def getSlaveSyncCmd(version=''): diff --git a/plugins/mysql/js/mysql.js b/plugins/mysql/js/mysql.js index 6754df892..c02528ac3 100755 --- a/plugins/mysql/js/mysql.js +++ b/plugins/mysql/js/mysql.js @@ -2346,11 +2346,16 @@ function masterOrSlaveConf(version=''){ "+(info['Slave_SQL_Running_State'] == '' ? '无':info['Slave_SQL_Running_State']) +"\ "; + + var btn_list = ['复制错误',"取消"]; + if (info['Last_IO_Error'].search(/1236/i)>0){ + btn_list = ['复制错误',"取消","尝试修复"]; + } layer.open({ type: 1, title: '同步异常信息', area: ['600px','300px'], - btn:['复制错误',"取消"], + btn:btn_list, content:"
\
\
\ @@ -2385,6 +2390,14 @@ function masterOrSlaveConf(version=''){ copyText(info['Slave_SQL_Running_State']); return; } + }, + btn3:function(){ + myPost('try_slave_sync_bugfix', {}, function(data){ + var rdata = $.parseJSON(data.data); + showMsg(rdata.msg, function(){ + masterOrSlaveConf(); + },{ icon: rdata.status ? 1 : 5 },2000); + }); } }); });