mirror of
https://github.com/yhl452493373/frps-panel.git
synced 2026-04-04 06:16:59 +08:00
add an api proxy url to access frp server info
This commit is contained in:
@@ -14,6 +14,22 @@ section {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.layui-header{
|
||||
line-height: 60px;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.layui-title{
|
||||
position: absolute;
|
||||
left: 200px;
|
||||
right: 0;
|
||||
top: 0;
|
||||
height: 100%;
|
||||
color: #fff;
|
||||
padding: 0 15px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
#searchForm input {
|
||||
height: 30px;
|
||||
line-height: 28px;
|
||||
|
||||
@@ -5,37 +5,20 @@ var loadServerInfo = (function ($) {
|
||||
* get server info
|
||||
* @param lang {{}} language json
|
||||
*/
|
||||
function loadServerInfo(lang) {
|
||||
function loadServerInfo(lang, title) {
|
||||
console.log(title)
|
||||
$("#title").text(title);
|
||||
$('#content').empty();
|
||||
var loading = layui.layer.load();
|
||||
|
||||
$.ajax({
|
||||
url: 'http://127.0.0.1:7500/api/serverinfo',
|
||||
dataType: 'jsonp',
|
||||
success: function (result) {
|
||||
result = {
|
||||
"version": "0.51.3",
|
||||
"bind_port": 7000,
|
||||
"vhost_http_port": 80,
|
||||
"vhost_https_port": 443,
|
||||
"tcpmux_httpconnect_port": 0,
|
||||
"kcp_bind_port": 7000,
|
||||
"quic_bind_port": 0,
|
||||
"subdomain_host": "frp.yanghuanglin.com",
|
||||
"max_pool_count": 100,
|
||||
"max_ports_per_client": 0,
|
||||
"heart_beat_timeout": 90,
|
||||
"total_traffic_in": 1669491,
|
||||
"total_traffic_out": 54422369,
|
||||
"cur_conns": 0,
|
||||
"client_counts": 1,
|
||||
"proxy_type_count": {"http": 9, "https": 8, "tcp": 7}
|
||||
};
|
||||
renderServerInfo(result);
|
||||
},
|
||||
complete: function () {
|
||||
layui.layer.close(loading);
|
||||
$.getJSON('/proxy/api/serverinfo').done(function (result) {
|
||||
if (result.success) {
|
||||
renderServerInfo(JSON.parse(result.data));
|
||||
} else {
|
||||
layui.layer.msg(result.message);
|
||||
}
|
||||
}).always(function () {
|
||||
layui.layer.close(loading);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -140,7 +140,8 @@ var loadUserList = (function ($) {
|
||||
* load i18n language
|
||||
* @param lang {{}} language json
|
||||
*/
|
||||
function loadUserList(lang) {
|
||||
function loadUserList(lang, title) {
|
||||
$("#title").text(title);
|
||||
var html = layui.laytpl($('#userListTemplate').html()).render();
|
||||
$('#content').html(html);
|
||||
|
||||
|
||||
@@ -4,9 +4,9 @@
|
||||
$.getJSON('/lang').done(function (lang) {
|
||||
layui.element.on('nav(leftNav)', function (elem) {
|
||||
if (elem.attr('id') === 'serverInfo') {
|
||||
loadServerInfo(lang);
|
||||
loadServerInfo(lang, elem.text().trim());
|
||||
} else if (elem.attr('id') === 'userList') {
|
||||
loadUserList(lang);
|
||||
loadUserList(lang, elem.text().trim());
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
Before Width: | Height: | Size: 322 KiB After Width: | Height: | Size: 322 KiB |
Reference in New Issue
Block a user