This commit is contained in:
Mr Chen
2024-12-01 23:42:01 +08:00
parent 8ed608e9cd
commit 12c90f5e6e
3 changed files with 42 additions and 3 deletions
+20 -1
View File
@@ -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]
+21 -1
View File
@@ -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: '<div class="pd15">\
<div class="divtable">\
<pre class="layui-code">'+data.data+'</pre>\
</div>\
</div>',
success:function(){
copyText(data.data);
},
yes:function(){
copyText(data.data);
}
});
});
});
}
+1 -1
View File
@@ -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,