From 12c90f5e6e5420b0c726ae65151a7956bb4af151 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Sun, 1 Dec 2024 23:42:01 +0800 Subject: [PATCH] update --- plugins/mtproxy/index.py | 21 ++++++++++++++++++++- plugins/mtproxy/js/mtproxy.js | 22 +++++++++++++++++++++- plugins/mysql/js/mysql.js | 2 +- 3 files changed, 42 insertions(+), 3 deletions(-) diff --git a/plugins/mtproxy/index.py b/plugins/mtproxy/index.py index d2a4d7f75..f25fe21a0 100755 --- a/plugins/mtproxy/index.py +++ b/plugins/mtproxy/index.py @@ -4,6 +4,7 @@ import sys import io import os import time +import re web_dir = os.getcwd() + "/web" if os.path.exists(web_dir): @@ -191,7 +192,25 @@ def getMtproxyUrl(): conf = getConfEnv() content = mw.readFile(conf) - + + rep = r'bind-to\s*=\s*(.*)' + tmp = re.search(rep, content) + bind_to = tmp.groups()[0].strip() + bind_to = bind_to.strip('"') + + rep = r'secret\s*=\s*(.*)' + tmp = re.search(rep, content) + secret = tmp.groups()[0].strip() + secret = secret.strip('"') + + info = bind_to.split(":") + + ip = mw.getLocalIp() + + url = 'tg://proxy?server={0}&port={1}&secret={2}'.format(ip, info[1], secret) + return mw.returnJson(True, 'ok', url) + + if __name__ == "__main__": func = sys.argv[1] diff --git a/plugins/mtproxy/js/mtproxy.js b/plugins/mtproxy/js/mtproxy.js index da6798cfe..748e2db60 100644 --- a/plugins/mtproxy/js/mtproxy.js +++ b/plugins/mtproxy/js/mtproxy.js @@ -35,7 +35,27 @@ function mtCommonFunc(){ $('#mtproxy_url').click(function(){ mtPost('url', '', {}, function(rdata){ - console.log(rdata); + var data = $.parseJSON(rdata.data); + + layer.open({ + title: "mtproxy代理信息", + area: ['600px', '180px'], + type:1, + closeBtn: 1, + shadeClose: false, + btn:["复制","取消"], + content: '
\ +
\ +
'+data.data+'
\ +
\ +
', + success:function(){ + copyText(data.data); + }, + yes:function(){ + copyText(data.data); + } + }); }); }); } \ No newline at end of file diff --git a/plugins/mysql/js/mysql.js b/plugins/mysql/js/mysql.js index dcb54e786..c5c25eae6 100755 --- a/plugins/mysql/js/mysql.js +++ b/plugins/mysql/js/mysql.js @@ -2041,7 +2041,7 @@ function getFullSyncStatus(db){ myPostN('full_sync_cmd', {'db':db,'sign':''}, function(rdata){ var rdata = $.parseJSON(rdata.data); layer.open({ - title: "手动执行命令CMD", + title: "手动执行命令CMD", area: ['600px', '180px'], type:1, closeBtn: 1,