From beb00d46e046b4288fec0a150b64bd420641b60d Mon Sep 17 00:00:00 2001 From: midoks Date: Wed, 8 Nov 2023 01:15:28 +0800 Subject: [PATCH] update --- plugins/mysql/index_mysql.py | 21 +++++++++++++++++++++ plugins/mysql/js/mysql.js | 10 +++++----- 2 files changed, 26 insertions(+), 5 deletions(-) diff --git a/plugins/mysql/index_mysql.py b/plugins/mysql/index_mysql.py index a1357c8d4..9a03ca285 100644 --- a/plugins/mysql/index_mysql.py +++ b/plugins/mysql/index_mysql.py @@ -62,6 +62,27 @@ def binLogListLook(args): my_bin = getServerDir() + '/bin' my_binlog_cmd = my_bin + '/mysqlbinlog' + cmd = my_binlog_cmd + ' --no-defaults ' + \ + data_dir + '/' + file + '|tail -' + str(line) + + data = mw.execShell(cmd) + + rdata = {} + rdata['cmd'] = cmd + rdata['data'] = data[0] + + return rdata + + +def binLogListLookDecode(args): + + file = args['file'] + line = args['line'] + + data_dir = getDataDir() + my_bin = getServerDir() + '/bin' + my_binlog_cmd = my_bin + '/mysqlbinlog' + cmd = my_binlog_cmd + ' --no-defaults --base64-output=decode-rows -vvvv ' + \ data_dir + '/' + file + '|tail -' + str(line) diff --git a/plugins/mysql/js/mysql.js b/plugins/mysql/js/mysql.js index 3919958bb..f6be7302a 100755 --- a/plugins/mysql/js/mysql.js +++ b/plugins/mysql/js/mysql.js @@ -1315,14 +1315,14 @@ function myBinLogsRender(page){ $('#binlog_list .look').click(function(){ var i = $(this).data('index'); var file = rdata.data[i]['name']; - myBinRollingLogs('查看','binLogListLook',{'file':file },100); - // myPostCallbak('binLogListLook','',{'file':file}, function(rdata){ - // console.log(rdata); - // }); }); - + $('#binlog_list .look_decode').click(function(){ + var i = $(this).data('index'); + var file = rdata.data[i]['name']; + myBinRollingLogs('查看','binLogListLookDecode',{'file':file },100); + }); }); }