diff --git a/plugins/mysql/index.py b/plugins/mysql/index.py index 732e0d5b2..9a48ff301 100755 --- a/plugins/mysql/index.py +++ b/plugins/mysql/index.py @@ -2303,6 +2303,7 @@ def getSlaveList(version=''): tmp['Master_Log_File'] = dlist[x]["Master_Log_File"] tmp['Slave_IO_Running'] = dlist[x]["Slave_IO_Running"] tmp['Slave_SQL_Running'] = dlist[x]["Slave_SQL_Running"] + tmp['Last_Error'] = dlist[x]["Last_Error"] ret.append(tmp) data = {} data['data'] = ret @@ -2579,8 +2580,9 @@ def doFullSyncUser(version=''): if os.path.exists(bak_file): pwd = pSqliteDb('config').where('id=?', (1,)).getField('mysql_root') sock = getSocketFile() - mysql_import_cmd = getServerDir() + '/bin/mysql -S ' + sock + ' -uroot -p' + pwd + \ - ' ' + name + ' < ' + bak_file + my_import_cmd = getServerDir() + '/bin/mysql -S ' + sock + ' -uroot -p' + pwd + \ + ' ' + sync_db + ' < ' + bak_file + mw.execShell(my_import_cmd) db.query("start slave") # db.query("start slave user='{}' password='{}';".format(user, apass)) diff --git a/plugins/mysql/js/mysql.js b/plugins/mysql/js/mysql.js index 760a38f32..4889bafb2 100755 --- a/plugins/mysql/js/mysql.js +++ b/plugins/mysql/js/mysql.js @@ -2234,7 +2234,7 @@ function masterOrSlaveConf(version=''){ for(i in rdata.data){ var v = rdata.data[i]; - var status = "异常"; + var status = "异常"; if (v['Slave_SQL_Running'] == 'Yes' && v['Slave_IO_Running'] == 'Yes'){ status = "正常"; } @@ -2276,6 +2276,26 @@ function masterOrSlaveConf(version=''){ // 添加\ // $(".table_slave_status_list").html(con); + + $('.db_error').click(function(){ + layer.open({ + type: 1, + title: '同步异常信息', + area: '500px', + content:"
\ +
"+v['Last_Error']+"
\ +
\ + \ +
\ +
", + success:function(){ + copyText(v['Last_Error']); + $('.class-copy-db-err').click(function(){ + copyText(v['Last_Error']); + }); + } + }); + }); }); }