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+'\ - //