mirror of
https://github.com/yhl452493373/frps-panel.git
synced 2026-04-04 06:16:59 +08:00
1.support frps>=0.52.3
2.add page for english
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -35,28 +35,30 @@ var loadProxyInfo = (function ($) {
|
||||
proxyType = proxyType.toLowerCase();
|
||||
data.forEach(function (temp) {
|
||||
temp.conf = temp.conf || {
|
||||
remote_port: 0,
|
||||
use_encryption: false,
|
||||
use_compression: false,
|
||||
custom_domains: null,
|
||||
remotePort: 0,
|
||||
transport: {
|
||||
useEncryption: false,
|
||||
useCompression: false
|
||||
},
|
||||
customDomains: null,
|
||||
subdomain: null,
|
||||
locations: null,
|
||||
host_header_rewrite: null
|
||||
hostHeaderRewrite: null
|
||||
};
|
||||
|
||||
temp.client_version = temp.client_version || '-';
|
||||
temp.conf.custom_domains = temp.conf.custom_domains || '-';
|
||||
temp.clientVersion = temp.clientVersion || '-';
|
||||
temp.conf.customDomains = temp.conf.customDomains || '-';
|
||||
temp.conf.subdomain = temp.conf.subdomain || '-';
|
||||
temp.conf.locations = temp.conf.locations || '-';
|
||||
temp.conf.host_header_rewrite = temp.conf.host_header_rewrite || '-';
|
||||
temp.conf.hostHeaderRewrite = temp.conf.hostHeaderRewrite || '-';
|
||||
|
||||
if (temp.conf.custom_domains !== '-') {
|
||||
temp.conf.custom_domains = JSON.stringify(temp.conf.custom_domains);
|
||||
if (temp.conf.customDomains !== '-') {
|
||||
temp.conf.customDomains = JSON.stringify(temp.conf.customDomains);
|
||||
}
|
||||
if (proxyType === 'http') {
|
||||
temp.conf.remote_port = http_port;
|
||||
temp.conf.remotePort = httpPort;
|
||||
} else if (proxyType === 'https') {
|
||||
temp.conf.remote_port = https_port;
|
||||
temp.conf.remotePort = httpsPort;
|
||||
}
|
||||
});
|
||||
var $section = $('#content > section');
|
||||
@@ -68,30 +70,30 @@ var loadProxyInfo = (function ($) {
|
||||
title: i18n['Port'],
|
||||
width: '12%',
|
||||
sort: true,
|
||||
templet: '<span>{{= d.conf.remote_port }}</span>'
|
||||
templet: '<span>{{= d.conf.remotePort }}</span>'
|
||||
},
|
||||
{field: 'cur_conns', title: i18n['Connections'], minWidth: 140, width: '12%', sort: true},
|
||||
{field: 'curConns', title: i18n['Connections'], minWidth: 140, width: '12%', sort: true},
|
||||
{
|
||||
field: 'today_traffic_in',
|
||||
field: 'todayTrafficIn',
|
||||
title: i18n['TrafficIn'],
|
||||
minWidth: 140,
|
||||
width: '12%',
|
||||
sort: true,
|
||||
templet: function (d) {
|
||||
return size(d.today_traffic_in);
|
||||
return size(d.todayTrafficIn);
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'today_traffic_out',
|
||||
field: 'todayTrafficOut',
|
||||
title: i18n['TrafficOut'],
|
||||
minWidth: 140,
|
||||
width: '12%',
|
||||
sort: true,
|
||||
templet: function (d) {
|
||||
return size(d.today_traffic_out);
|
||||
return size(d.todayTrafficOut);
|
||||
}
|
||||
},
|
||||
{field: 'client_version', title: i18n['ClientVersion'], minWidth: 140, width: '12%', sort: true},
|
||||
{field: 'clientVersion', title: i18n['ClientVersion'], minWidth: 140, width: '12%', sort: true},
|
||||
{
|
||||
field: 'status', title: i18n['Status'], width: '12%', sort: true, templet: function (d) {
|
||||
return '<span class="' + d.status + '">' + i18n[d.status] + '</span>';
|
||||
@@ -104,7 +106,7 @@ var loadProxyInfo = (function ($) {
|
||||
height: $section.height(),
|
||||
text: {none: i18n['EmptyData']},
|
||||
cols: [cols],
|
||||
page: navigator.language.indexOf("zh") !== -1,
|
||||
page: pageOptions,
|
||||
data: data,
|
||||
initSort: {
|
||||
field: 'name',
|
||||
@@ -116,10 +118,10 @@ var loadProxyInfo = (function ($) {
|
||||
var expandTrTemplateHtml = $('#expandTrTemplate').html();
|
||||
for (var i = 0; i < $tr.length; i++) {
|
||||
var datum = res.data[i];
|
||||
var useEncryption = datum.conf.use_encryption;
|
||||
var useCompression = datum.conf.use_compression;
|
||||
datum.conf.use_encryption = i18n[useEncryption];
|
||||
datum.conf.use_compression = i18n[useCompression];
|
||||
var useEncryption = datum.conf.transport.useEncryption || false;
|
||||
var useCompression = datum.conf.transport.useCompression || false;
|
||||
datum.conf.transport.useEncryption = i18n[useEncryption];
|
||||
datum.conf.transport.useCompression = i18n[useCompression];
|
||||
var html = layui.laytpl(expandTrTemplateHtml).render({
|
||||
index: i,
|
||||
colspan: cols.length - 1,
|
||||
@@ -169,7 +171,7 @@ var loadProxyInfo = (function ($) {
|
||||
var html = layui.laytpl($('#trafficStaticTemplate').html()).render();
|
||||
var dates = [];
|
||||
var now = new Date();
|
||||
for (var i = 0; i < data.traffic_in.length; i++) {
|
||||
for (var i = 0; i < data.trafficIn.length; i++) {
|
||||
dates.push(now.getFullYear() + "/" + (now.getMonth() + 1) + "/" + now.getDate());
|
||||
now.setDate(now.getDate() - 1);
|
||||
}
|
||||
@@ -232,12 +234,12 @@ var loadProxyInfo = (function ($) {
|
||||
{
|
||||
name: i18n['TrafficIn'],
|
||||
type: 'bar',
|
||||
data: data.traffic_in.reverse(),
|
||||
data: data.trafficIn.reverse(),
|
||||
},
|
||||
{
|
||||
name: i18n['TrafficOut'],
|
||||
type: 'bar',
|
||||
data: data.traffic_out.reverse(),
|
||||
data: data.trafficOut.reverse(),
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
@@ -16,24 +16,24 @@ var loadServerInfo = (function ($) {
|
||||
$.getJSON('/proxy/api/serverinfo').done(function (result) {
|
||||
if (result.success) {
|
||||
var data = JSON.parse(result.data);
|
||||
data.proxy_counts = 0;
|
||||
http_port = data.vhost_http_port;
|
||||
https_port = data.vhost_https_port;
|
||||
for (var proxy in data.proxy_type_count) {
|
||||
data.proxy_counts = data.proxy_counts + data.proxy_type_count[proxy];
|
||||
data.proxyCounts = 0;
|
||||
httpPort = data.vhostHTTPPort;
|
||||
httpsPort = data.vhostHTTPSPort;
|
||||
for (var proxy in data.proxyTypeCount) {
|
||||
data.proxyCounts = data.proxyCounts + data.proxyTypeCount[proxy];
|
||||
}
|
||||
data.bind_port = data.bind_port || i18n['Disable'];
|
||||
data.kcp_bind_port = data.kcp_bind_port || i18n['Disable'];
|
||||
data.quic_bind_port = data.quic_bind_port || i18n['Disable'];
|
||||
data.vhost_http_port = data.vhost_http_port || i18n['Disable'];
|
||||
data.vhost_https_port = data.vhost_https_port || i18n['Disable'];
|
||||
data.tcpmux_httpconnect_port = data.tcpmux_httpconnect_port || i18n['Disable'];
|
||||
data.subdomain_host = data.subdomain_host || i18n['NotSet'];
|
||||
data.max_pool_count = data.max_pool_count || i18n['NotSet'];
|
||||
data.max_ports_per_client = data.max_ports_per_client || i18n['NotLimit'];
|
||||
data.heart_beat_timeout = data.heart_beat_timeout || i18n['NotSet'];
|
||||
data.allow_ports_str = data.allow_ports_str || i18n['NotLimit'];
|
||||
data.tls_only = i18n[data.tls_only || false];
|
||||
data.bindPort = data.bindPort || i18n['Disable'];
|
||||
data.kcpBindPort = data.kcpBindPort || i18n['Disable'];
|
||||
data.quicBindPort = data.quicBindPort || i18n['Disable'];
|
||||
data.vhostHTTPPort = data.vhostHTTPPort || i18n['Disable'];
|
||||
data.vhostHTTPSPort = data.vhostHTTPSPort || i18n['Disable'];
|
||||
data.tcpmuxHTTPConnectPort = data.tcpmuxHTTPConnectPort || i18n['Disable'];
|
||||
data.subdomainHost = data.subdomainHost || i18n['NotSet'];
|
||||
data.maxPoolCount = data.maxPoolCount || i18n['NotSet'];
|
||||
data.maxPortsPerClient = data.maxPortsPerClient || i18n['NotLimit'];
|
||||
data.heartbeatTimeout = data.heartbeatTimeout || i18n['NotSet'];
|
||||
data.allowPortsStr = data.allowPortsStr || i18n['NotLimit'];
|
||||
data.tlsForce = i18n[data.tlsForce || false];
|
||||
renderServerInfo(data);
|
||||
} else {
|
||||
layui.layer.msg(result.message);
|
||||
@@ -63,8 +63,8 @@ var loadServerInfo = (function ($) {
|
||||
function renderTrafficChart(data) {
|
||||
var chartLegend = [i18n['TrafficIn'], i18n['TrafficOut']];
|
||||
var chartData = [
|
||||
{value: data.total_traffic_in, name: i18n['TrafficIn']},
|
||||
{value: data.total_traffic_out, name: i18n['TrafficOut']}
|
||||
{value: data.totalTrafficIn, name: i18n['TrafficIn']},
|
||||
{value: data.totalTrafficOut, name: i18n['TrafficOut']}
|
||||
];
|
||||
var chartDom = document.getElementById('trafficPieChart');
|
||||
var chart = echarts.init(chartDom);
|
||||
@@ -122,7 +122,7 @@ var loadServerInfo = (function ($) {
|
||||
* @param data proxy count data
|
||||
*/
|
||||
function renderCountChart(data) {
|
||||
var proxies = data.proxy_type_count;
|
||||
var proxies = data.proxyTypeCount;
|
||||
var chartLegend = [];
|
||||
var chartData = [];
|
||||
|
||||
|
||||
@@ -251,9 +251,7 @@ var loadUserList = (function ($) {
|
||||
where: {},
|
||||
dataType: 'json',
|
||||
editTrigger: 'dblclick',
|
||||
page: {
|
||||
layout: navigator.language.indexOf("zh") === -1 ? ['first', 'prev', 'next', 'last'] : ['prev', 'page', 'next', 'skip', 'count', 'limit']
|
||||
},
|
||||
page: pageOptions,
|
||||
toolbar: '#userListToolbarTemplate',
|
||||
defaultToolbar: false,
|
||||
cols: [[
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
var http_port, https_port;
|
||||
var httpPort, httpsPort;
|
||||
(function ($) {
|
||||
$(function () {
|
||||
function init() {
|
||||
@@ -47,4 +47,15 @@ var http_port, https_port;
|
||||
|
||||
init();
|
||||
});
|
||||
})(layui.$);
|
||||
})(layui.$);
|
||||
|
||||
var pageOptions = {
|
||||
layout: navigator.language.indexOf("zh") === -1 ? ['prev', 'page', 'next', 'skip', 'limit'] : ['prev', 'page', 'next', 'skip', 'count', 'limit'],
|
||||
limitTemplet: function (item) {
|
||||
if (navigator.language.indexOf("zh") === -1) {
|
||||
return item + ' / Page';
|
||||
}
|
||||
return item + ' 条/页';
|
||||
},
|
||||
skipText: navigator.language.indexOf("zh") === -1 ? ['Go to', '', 'Confirm'] : ['到第', '页', '确定']
|
||||
};
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -87,63 +87,63 @@
|
||||
</div>
|
||||
<div class="text-row">
|
||||
<div class="text-col">${ .BindPort }</div>
|
||||
<div class="text-col">{{= d.bind_port }}</div>
|
||||
<div class="text-col">{{= d.bindPort }}</div>
|
||||
</div>
|
||||
<div class="text-row">
|
||||
<div class="text-col">${ .KCPBindPort }</div>
|
||||
<div class="text-col">{{= d.kcp_bind_port }}</div>
|
||||
<div class="text-col">{{= d.kcpBindPort }}</div>
|
||||
</div>
|
||||
<div class="text-row">
|
||||
<div class="text-col">${ .QUICBindPort }</div>
|
||||
<div class="text-col">{{= d.quic_bind_port }}</div>
|
||||
<div class="text-col">{{= d.quicBindPort }}</div>
|
||||
</div>
|
||||
<div class="text-row">
|
||||
<div class="text-col">${ .HTTPPort }</div>
|
||||
<div class="text-col">{{= d.vhost_http_port }}</div>
|
||||
<div class="text-col">{{= d.vhostHTTPPort }}</div>
|
||||
</div>
|
||||
<div class="text-row">
|
||||
<div class="text-col">${ .HTTPSPort }</div>
|
||||
<div class="text-col">{{= d.vhost_https_port }}</div>
|
||||
<div class="text-col">{{= d.vhostHTTPSPort }}</div>
|
||||
</div>
|
||||
<div class="text-row">
|
||||
<div class="text-col">${ .TCPMUXPort }</div>
|
||||
<div class="text-col">{{= d.tcpmux_httpconnect_port }}</div>
|
||||
<div class="text-col">{{= d.tcpmuxHTTPConnectPort }}</div>
|
||||
</div>
|
||||
<div class="text-row">
|
||||
<div class="text-col">${ .SubdomainHost }</div>
|
||||
<div class="text-col">{{= d.subdomain_host }}</div>
|
||||
<div class="text-col">{{= d.subdomainHost }}</div>
|
||||
</div>
|
||||
<div class="text-row">
|
||||
<div class="text-col">${ .MaxPoolCount }</div>
|
||||
<div class="text-col">{{= d.max_pool_count }}</div>
|
||||
<div class="text-col">{{= d.maxPoolCount }}</div>
|
||||
</div>
|
||||
<div class="text-row">
|
||||
<div class="text-col">${ .MaxPortsPerClient }</div>
|
||||
<div class="text-col">{{= d.max_ports_per_client }}</div>
|
||||
<div class="text-col">{{= d.maxPortsPerClient }}</div>
|
||||
</div>
|
||||
<div class="text-row">
|
||||
<div class="text-col">${ .HeartBeatTimeout }</div>
|
||||
<div class="text-col">{{= d.heart_beat_timeout }}</div>
|
||||
<div class="text-col">{{= d.heartbeatTimeout }}</div>
|
||||
</div>
|
||||
<div class="text-row">
|
||||
<div class="text-col">${ .AllowPorts }</div>
|
||||
<div class="text-col">{{= d.allow_ports_str }}</div>
|
||||
<div class="text-col">{{= d.allowPortsStr }}</div>
|
||||
</div>
|
||||
<div class="text-row">
|
||||
<div class="text-col">${ .TLSOnly }</div>
|
||||
<div class="text-col">{{= d.tls_only }}</div>
|
||||
<div class="text-col">{{= d.tlsForce }}</div>
|
||||
</div>
|
||||
<div class="text-row">
|
||||
<div class="text-col">${ .CurrentConnections }</div>
|
||||
<div class="text-col">{{= d.cur_conns }}</div>
|
||||
<div class="text-col">{{= d.curConns }}</div>
|
||||
</div>
|
||||
<div class="text-row">
|
||||
<div class="text-col">${ .ClientCounts }</div>
|
||||
<div class="text-col">{{= d.client_counts }}</div>
|
||||
<div class="text-col">{{= d.clientCounts }}</div>
|
||||
</div>
|
||||
<div class="text-row">
|
||||
<div class="text-col">${ .ProxyCounts }</div>
|
||||
<div class="text-col">{{= d.proxy_counts }}</div>
|
||||
<div class="text-col">{{= d.proxyCounts }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="chart-info">
|
||||
@@ -317,7 +317,7 @@
|
||||
<div class="layui-col-xs6">
|
||||
<div class="layui-row">
|
||||
<div class="layui-col-md3">${ .Domains }</div>
|
||||
<div class="layui-col-md9">{{= d.data.conf.custom_domains }}</div>
|
||||
<div class="layui-col-md9">{{= d.data.conf.customDomains }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-col-xs6">
|
||||
@@ -337,7 +337,7 @@
|
||||
<div class="layui-col-xs6">
|
||||
<div class="layui-row">
|
||||
<div class="layui-col-md3">${ .HostRewrite }</div>
|
||||
<div class="layui-col-md9">{{= d.data.conf.host_header_rewrite }}</div>
|
||||
<div class="layui-col-md9">{{= d.data.conf.hostHeaderRewrite }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -345,13 +345,13 @@
|
||||
<div class="layui-col-xs6">
|
||||
<div class="layui-row">
|
||||
<div class="layui-col-md3">${ .Encryption }</div>
|
||||
<div class="layui-col-md9">{{= d.data.conf.use_encryption }}</div>
|
||||
<div class="layui-col-md9">{{= d.data.conf.transport.useEncryption }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-col-xs6">
|
||||
<div class="layui-row">
|
||||
<div class="layui-col-md3">${ .Compression }</div>
|
||||
<div class="layui-col-md9">{{= d.data.conf.use_compression }}</div>
|
||||
<div class="layui-col-md9">{{= d.data.conf.transport.useCompression }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -359,13 +359,13 @@
|
||||
<div class="layui-col-xs6">
|
||||
<div class="layui-row">
|
||||
<div class="layui-col-md3">${ .LastStart }</div>
|
||||
<div class="layui-col-md9">{{= d.data.last_start_time }}</div>
|
||||
<div class="layui-col-md9">{{= d.data.lastStartTime }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-col-xs6">
|
||||
<div class="layui-row">
|
||||
<div class="layui-col-md3">${ .LastClose }</div>
|
||||
<div class="layui-col-md9">{{= d.data.last_close_time }}</div>
|
||||
<div class="layui-col-md9">{{= d.data.lastCloseTime }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -388,13 +388,13 @@
|
||||
<div class="layui-col-xs6">
|
||||
<div class="layui-row">
|
||||
<div class="layui-col-md3">${ .Addr }</div>
|
||||
<div class="layui-col-md9">{{= d.data.conf.remote_port }}</div>
|
||||
<div class="layui-col-md9">{{= d.data.conf.remotePort }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-col-xs6">
|
||||
<div class="layui-row">
|
||||
<div class="layui-col-md3">${ .Encryption }</div>
|
||||
<div class="layui-col-md9">{{= d.data.conf.use_encryption }}</div>
|
||||
<div class="layui-col-md9">{{= d.data.conf.transport.useEncryption }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -402,13 +402,13 @@
|
||||
<div class="layui-col-xs6">
|
||||
<div class="layui-row">
|
||||
<div class="layui-col-md3">${ .Compression }</div>
|
||||
<div class="layui-col-md9">{{= d.data.conf.use_compression }}</div>
|
||||
<div class="layui-col-md9">{{= d.data.conf.transport.useCompression }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-col-xs6">
|
||||
<div class="layui-row">
|
||||
<div class="layui-col-md3">${ .LastStart }</div>
|
||||
<div class="layui-col-md9">{{= d.data.last_start_time }}</div>
|
||||
<div class="layui-col-md9">{{= d.data.lastStartTime }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -416,7 +416,7 @@
|
||||
<div class="layui-col-xs6">
|
||||
<div class="layui-row">
|
||||
<div class="layui-col-md3">${ .LastClose }</div>
|
||||
<div class="layui-col-md9">{{= d.data.last_close_time }}</div>
|
||||
<div class="layui-col-md9">{{= d.data.lastCloseTime }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user