mirror of
https://github.com/midoks/mdserver-web.git
synced 2026-10-18 23:45:52 +08:00
update
This commit is contained in:
@@ -4,6 +4,7 @@ import sys
|
|||||||
import io
|
import io
|
||||||
import os
|
import os
|
||||||
import time
|
import time
|
||||||
|
import re
|
||||||
|
|
||||||
web_dir = os.getcwd() + "/web"
|
web_dir = os.getcwd() + "/web"
|
||||||
if os.path.exists(web_dir):
|
if os.path.exists(web_dir):
|
||||||
@@ -191,7 +192,25 @@ def getMtproxyUrl():
|
|||||||
conf = getConfEnv()
|
conf = getConfEnv()
|
||||||
content = mw.readFile(conf)
|
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__":
|
if __name__ == "__main__":
|
||||||
func = sys.argv[1]
|
func = sys.argv[1]
|
||||||
|
|||||||
@@ -35,7 +35,27 @@ function mtCommonFunc(){
|
|||||||
|
|
||||||
$('#mtproxy_url').click(function(){
|
$('#mtproxy_url').click(function(){
|
||||||
mtPost('url', '', {}, function(rdata){
|
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);
|
||||||
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -2041,7 +2041,7 @@ function getFullSyncStatus(db){
|
|||||||
myPostN('full_sync_cmd', {'db':db,'sign':''}, function(rdata){
|
myPostN('full_sync_cmd', {'db':db,'sign':''}, function(rdata){
|
||||||
var rdata = $.parseJSON(rdata.data);
|
var rdata = $.parseJSON(rdata.data);
|
||||||
layer.open({
|
layer.open({
|
||||||
title: "手动执行命令CMD",
|
title: "手动执行命令CMD",
|
||||||
area: ['600px', '180px'],
|
area: ['600px', '180px'],
|
||||||
type:1,
|
type:1,
|
||||||
closeBtn: 1,
|
closeBtn: 1,
|
||||||
|
|||||||
Reference in New Issue
Block a user