diff --git a/plugins/mariadb/index.py b/plugins/mariadb/index.py index 1117577ef..7ce3e7bbc 100755 --- a/plugins/mariadb/index.py +++ b/plugins/mariadb/index.py @@ -1682,6 +1682,13 @@ def setDbMasterAccess(): psdb.where('username=?', (username,)).save('accept', (access,)) return mw.returnJson(True, '设置成功!') +def resetMaster(version=''): + pdb = pMysqlDb() + r = pdb.execute('reset master') + isError = isSqlError(r) + if isError != None: + return isError + return mw.returnJson(True, '重置成功!') def getMasterDbList(version=''): args = getArgs() @@ -2893,6 +2900,8 @@ if __name__ == "__main__": print(getDbrunMode(version)) elif func == 'set_dbrun_mode': print(setDbrunMode(version)) + elif func == 'reset_master': + print(resetMaster(version)) elif func == 'get_masterdb_list': print(getMasterDbList(version)) elif func == 'get_master_status': diff --git a/plugins/mariadb/js/mariadb.js b/plugins/mariadb/js/mariadb.js index 6ce33e4cf..9d518549d 100755 --- a/plugins/mariadb/js/mariadb.js +++ b/plugins/mariadb/js/mariadb.js @@ -1830,6 +1830,14 @@ function setDbMasterAccess(username){ }); } +function resetMaster(){ + myPost('reset_master', '', function(data){ + var rdata = $.parseJSON(data.data); + showMsg(rdata.msg,function(){ + },{icon: rdata.status ? 1 : 2}); + },'正在执行重置master命令[reset master]'); +} + function getMasterRepSlaveList(){ var _data = {}; if (typeof(page) =='undefined'){ @@ -2664,6 +2672,7 @@ function masterOrSlaveConf(version=''){

\ Master[主]配置\ \ + \

\
\ \ diff --git a/plugins/mysql/js/mysql.js b/plugins/mysql/js/mysql.js index e6434b8d5..ac0dbf0a3 100755 --- a/plugins/mysql/js/mysql.js +++ b/plugins/mysql/js/mysql.js @@ -2693,7 +2693,7 @@ function masterOrSlaveConf(version=''){

\ Master[主]配置\ \ - \ + \

\
\ \