diff --git a/plugins/xui/index.py b/plugins/xui/index.py index 14bdae0b6..b63c9b341 100755 --- a/plugins/xui/index.py +++ b/plugins/xui/index.py @@ -161,11 +161,14 @@ def getXuiInfo(): info = user.field('username,password').where("id=?", (1,)).find() setting = pSqliteDb('settings') - setting_data = setting.field('id,key,value').where("key=?", ('webPort',)).find() - + port_data = setting.field('id,key,value').where("key=?", ('webPort',)).find() + path_data = setting.field('id,key,value').where("key=?", ('webBasePath',)).find() data['username'] = info['username'] data['password'] = info['password'] - data['port'] = setting_data['value'] + data['port'] = port_data['value'] + data['path'] = path_data['value'] + + data['ip'] = mw.getHostAddr() return mw.returnJson(True, 'ok', data) def installPreInspection(): diff --git a/plugins/xui/js/xui.js b/plugins/xui/js/xui.js index aa0d7aca8..c5d82d019 100644 --- a/plugins/xui/js/xui.js +++ b/plugins/xui/js/xui.js @@ -45,36 +45,20 @@ function xuiCommonFunc(){ \

'; + con += '

\ + 路径\ + \ +

'; + con += '

\ \

'; $(".soft-man-con").html(con); + $('#open_url').click(function(){ + var url = 'http://' + data.ip + ':' + data.port; + window.open(url); + copyText(url); + }); }); - - // $('#mtproxy_url').click(function(){ - // mtPost('url', '', {}, function(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/web/core/mw.py b/web/core/mw.py index 9f618c3b8..a92ed095f 100644 --- a/web/core/mw.py +++ b/web/core/mw.py @@ -704,7 +704,8 @@ def getCpuType(): def getLanguage(): - path = 'data/language.pl' + panel_dir = getPanelDir() + path = panel_dir+'/data/language.pl' if not os.path.exists(path): return 'Simplified_Chinese' return readFile(path).strip() @@ -965,8 +966,8 @@ def writeDbLog(stype, msg, args=(), uid=1): return False def writeSpeed(title, used, total, speed=0): - path = getPanelDir() - speed_file= path + '/data/panel_speed.pl' + panel_dir = getPanelDir() + speed_file= panel_dir + '/data/panel_speed.pl' # 写进度 if not title: data = {'title': None, 'progress': 0,'total': 0, 'used': 0, 'speed': 0} @@ -978,8 +979,8 @@ def writeSpeed(title, used, total, speed=0): def getSpeed(): - path = getPanelDir() - speed_file= path + '/data/panel_speed.pl' + panel_dir = getPanelDir() + speed_file= panel_dir + '/data/panel_speed.pl' # 取进度 path = getPanelDir() data = readFile(speed_file)