From df9a34aa31b0a804a62b29118721b7bebc05a076 Mon Sep 17 00:00:00 2001 From: midoks Date: Mon, 21 Aug 2023 22:33:33 +0800 Subject: [PATCH] Update index.py --- plugins/mysql-apt/index.py | 32 +------------------------------- 1 file changed, 1 insertion(+), 31 deletions(-) diff --git a/plugins/mysql-apt/index.py b/plugins/mysql-apt/index.py index 73f663387..8deeae18f 100755 --- a/plugins/mysql-apt/index.py +++ b/plugins/mysql-apt/index.py @@ -2196,40 +2196,10 @@ def updateSlaveSSH(version=''): def getSlaveList(version=''): - db = pMysqlDb() dlist = db.query('show slave status') - ret = [] - for x in range(0, len(dlist)): - tmp = {} - tmp['Master_User'] = dlist[x]["Master_User"] - tmp['Master_Host'] = dlist[x]["Master_Host"] - tmp['Master_Port'] = dlist[x]["Master_Port"] - 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"] - tmp['Last_IO_Error'] = dlist[x]["Last_IO_Error"] - tmp['Last_SQL_Error'] = dlist[x]["Last_SQL_Error"] - tmp['Slave_SQL_Running_State'] = dlist[x]["Slave_SQL_Running_State"] - - tmp['Error'] = '' - if tmp['Last_Error'] != '': - tmp['Error'] = tmp['Last_Error'] - - if tmp['Last_IO_Error'] != '': - tmp['Error'] = tmp['Last_IO_Error'] - - if tmp['Last_SQL_Error'] != '': - tmp['Error'] = tmp['Last_SQL_Error'] - - if tmp['Error'] == '': - tmp['Error'] = tmp['Slave_SQL_Running_State'] - - ret.append(tmp) data = {} - data['data'] = ret - + data['data'] = dlist return mw.getJson(data)