mirror of
https://github.com/yhl452493373/frpc-panel.git
synced 2026-04-04 14:27:01 +08:00
optimze
This commit is contained in:
@@ -9,7 +9,7 @@
|
|||||||
"Username or password incorrect": "Username or password incorrect",
|
"Username or password incorrect": "Username or password incorrect",
|
||||||
"Empty data": "Empty data",
|
"Empty data": "Empty data",
|
||||||
"Client Info": "Client Info",
|
"Client Info": "Client Info",
|
||||||
"Proxies Status": "Proxies Status",
|
"Overview": "Overview",
|
||||||
"Proxies": "Proxies",
|
"Proxies": "Proxies",
|
||||||
"Server Address": "Server Address",
|
"Server Address": "Server Address",
|
||||||
"Server Port": "Server Port",
|
"Server Port": "Server Port",
|
||||||
@@ -36,7 +36,7 @@
|
|||||||
"Basic": "Basic Params",
|
"Basic": "Basic Params",
|
||||||
"Extra": "Extra Params",
|
"Extra": "Extra Params",
|
||||||
"Proxy Name": "Proxy Name",
|
"Proxy Name": "Proxy Name",
|
||||||
"Customize Domains": "Customize Domains",
|
"Custom Domains": "Custom Domains",
|
||||||
"Subdomain": "Subdomain",
|
"Subdomain": "Subdomain",
|
||||||
"Remote Port": "Remote Port",
|
"Remote Port": "Remote Port",
|
||||||
"Use Encryption": "Use Encryption",
|
"Use Encryption": "Use Encryption",
|
||||||
|
|||||||
@@ -9,8 +9,8 @@
|
|||||||
"Username or password incorrect": "用户名或密码错误",
|
"Username or password incorrect": "用户名或密码错误",
|
||||||
"Empty data": "无数据",
|
"Empty data": "无数据",
|
||||||
"Client Info": "客户端信息",
|
"Client Info": "客户端信息",
|
||||||
"Proxies Status": "代理状态",
|
"Overview": "概览列表",
|
||||||
"Proxies": "代理",
|
"Proxies": "代理列表",
|
||||||
"Server Address": "服务器地址",
|
"Server Address": "服务器地址",
|
||||||
"Server Port": "服务器端口",
|
"Server Port": "服务器端口",
|
||||||
"Protocol": "连接协议",
|
"Protocol": "连接协议",
|
||||||
@@ -36,7 +36,7 @@
|
|||||||
"Basic": "基础参数",
|
"Basic": "基础参数",
|
||||||
"Extra": "附加参数",
|
"Extra": "附加参数",
|
||||||
"Proxy Name": "代理名称",
|
"Proxy Name": "代理名称",
|
||||||
"Customize Domains": "自定义域名",
|
"Custom Domains": "自定义域名",
|
||||||
"Subdomain": "子域名",
|
"Subdomain": "子域名",
|
||||||
"Remote Port": "服务端端口",
|
"Remote Port": "服务端端口",
|
||||||
"Use Encryption": "加密传输",
|
"Use Encryption": "加密传输",
|
||||||
|
|||||||
@@ -81,11 +81,11 @@ section {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.layui-form-label {
|
.layui-form-label {
|
||||||
width: 140px;
|
width: 100px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.layui-input-block {
|
.layui-input-block {
|
||||||
margin-left: 170px;
|
margin-left: 130px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.layui-btn-sm {
|
.layui-btn-sm {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
var loadProxyInfo = (function ($) {
|
var loadProxyInfo = (function ($) {
|
||||||
var i18n = {}, currentProxyType, currentTitle;
|
var i18n = {}, currentProxyType, currentTitle;
|
||||||
//param names in Basic tab
|
//param names in Basic tab
|
||||||
var basicParamNames = ['name', 'type', 'local_ip', 'local_port', 'custom_domains', 'sub_domain', 'remote_port', 'use_encryption', 'use_compression'];
|
var basicParamNames = ['name', 'type', 'local_ip', 'local_port', 'custom_domains', 'subdomain', 'remote_port', 'use_encryption', 'use_compression'];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* get proxy info
|
* get proxy info
|
||||||
@@ -15,7 +15,7 @@ var loadProxyInfo = (function ($) {
|
|||||||
if (title != null)
|
if (title != null)
|
||||||
currentTitle = title;
|
currentTitle = title;
|
||||||
if (proxyType != null)
|
if (proxyType != null)
|
||||||
currentProxyType = proxyType;
|
currentProxyType = proxyType.toLowerCase();
|
||||||
$("#title").text(currentTitle);
|
$("#title").text(currentTitle);
|
||||||
$('#content').empty();
|
$('#content').empty();
|
||||||
var loading = layui.layer.load();
|
var loading = layui.layer.load();
|
||||||
@@ -45,6 +45,11 @@ var loadProxyInfo = (function ($) {
|
|||||||
temp.name = key;
|
temp.name = key;
|
||||||
temp.local_ip = temp.local_ip || '-';
|
temp.local_ip = temp.local_ip || '-';
|
||||||
temp.local_port = temp.local_port || '-';
|
temp.local_port = temp.local_port || '-';
|
||||||
|
temp.use_encryption = temp.use_encryption || false;
|
||||||
|
if (currentProxyType === 'http' || currentProxyType === 'https') {
|
||||||
|
temp.custom_domains = temp.custom_domains || '-';
|
||||||
|
temp.subdomain = temp.subdomain || '-';
|
||||||
|
}
|
||||||
dataList.push(temp);
|
dataList.push(temp);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -52,12 +57,30 @@ var loadProxyInfo = (function ($) {
|
|||||||
var cols = [
|
var cols = [
|
||||||
{type: 'checkbox'},
|
{type: 'checkbox'},
|
||||||
{field: 'name', title: i18n['Name'], sort: true},
|
{field: 'name', title: i18n['Name'], sort: true},
|
||||||
{field: 'type', title: i18n['Type'], sort: true},
|
{field: 'type', title: i18n['Type'], width: 110, sort: true},
|
||||||
{field: 'local_ip', title: i18n['LocalIp'], sort: true},
|
{field: 'local_ip', title: i18n['LocalIp'], width: 150, sort: true},
|
||||||
{field: 'local_port', title: i18n['LocalPort'], sort: true},
|
{field: 'local_port', title: i18n['LocalPort'], width: 120, sort: true},
|
||||||
{title: i18n['Operation'], width: 150, toolbar: '#proxyListOperationTemplate'}
|
|
||||||
];
|
];
|
||||||
|
|
||||||
|
if (currentProxyType === 'tcp' || currentProxyType === 'udp') {
|
||||||
|
cols.push({field: 'remote_port', title: i18n['RemotePort'], width: 130, sort: true});
|
||||||
|
} else if (currentProxyType === 'http' || currentProxyType === 'https') {
|
||||||
|
cols.push({field: 'custom_domains', title: i18n['CustomDomains'], sort: true});
|
||||||
|
cols.push({field: 'subdomain', title: i18n['Subdomain'], width: 150, sort: true});
|
||||||
|
}
|
||||||
|
|
||||||
|
cols.push({
|
||||||
|
field: 'use_encryption', title: i18n['UseEncryption'], width: 170, templet: function (d) {
|
||||||
|
return i18n[d.use_encryption]
|
||||||
|
}, sort: true
|
||||||
|
});
|
||||||
|
cols.push({
|
||||||
|
field: 'use_compression', title: i18n['UseCompression'], width: 170, templet: function (d) {
|
||||||
|
return i18n[d.use_compression]
|
||||||
|
}, sort: true
|
||||||
|
});
|
||||||
|
cols.push({title: i18n['Operation'], width: 150, toolbar: '#proxyListOperationTemplate'});
|
||||||
|
|
||||||
var proxyListTable = layui.table.render({
|
var proxyListTable = layui.table.render({
|
||||||
elem: '#proxyListTable',
|
elem: '#proxyListTable',
|
||||||
height: $section.height(),
|
height: $section.height(),
|
||||||
@@ -157,7 +180,7 @@ var loadProxyInfo = (function ($) {
|
|||||||
type: 1,
|
type: 1,
|
||||||
title: false,
|
title: false,
|
||||||
skin: 'proxy-popup',
|
skin: 'proxy-popup',
|
||||||
area: ['500px', '400px'],
|
area: ['400px', '400px'],
|
||||||
content: content,
|
content: content,
|
||||||
btn: [i18n['Confirm'], i18n['Cancel']],
|
btn: [i18n['Confirm'], i18n['Cancel']],
|
||||||
btn1: function (index) {
|
btn1: function (index) {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
var loadProxiesStatus = (function ($) {
|
var loadOverview = (function ($) {
|
||||||
var i18n = {};
|
var i18n = {};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -6,7 +6,7 @@ var loadProxiesStatus = (function ($) {
|
|||||||
* @param lang {{}} language json
|
* @param lang {{}} language json
|
||||||
* @param title page title
|
* @param title page title
|
||||||
*/
|
*/
|
||||||
function loadProxiesStatus(lang, title) {
|
function loadOverview(lang, title) {
|
||||||
i18n = lang;
|
i18n = lang;
|
||||||
$("#title").text(title);
|
$("#title").text(title);
|
||||||
$('#content').empty();
|
$('#content').empty();
|
||||||
@@ -14,8 +14,8 @@ var loadProxiesStatus = (function ($) {
|
|||||||
|
|
||||||
$.getJSON('/proxy/api/status').done(function (result) {
|
$.getJSON('/proxy/api/status').done(function (result) {
|
||||||
if (result.success) {
|
if (result.success) {
|
||||||
$('#content').html($('#proxiesTableTemplate').html());
|
$('#content').html($('#overviewTableTemplate').html());
|
||||||
renderProxiesTable(JSON.parse(result.data));
|
renderOverviewTable(JSON.parse(result.data));
|
||||||
} else {
|
} else {
|
||||||
layui.layer.msg(result.message);
|
layui.layer.msg(result.message);
|
||||||
}
|
}
|
||||||
@@ -29,7 +29,7 @@ var loadProxiesStatus = (function ($) {
|
|||||||
* @param data {Map<string,Map<string,string>>} proxy data
|
* @param data {Map<string,Map<string,string>>} proxy data
|
||||||
* @param proxyType proxy type
|
* @param proxyType proxy type
|
||||||
*/
|
*/
|
||||||
function renderProxiesTable(data, proxyType) {
|
function renderOverviewTable(data, proxyType) {
|
||||||
var dataList = [];
|
var dataList = [];
|
||||||
for (var type in data) {
|
for (var type in data) {
|
||||||
var temp = data[type];
|
var temp = data[type];
|
||||||
@@ -57,8 +57,8 @@ var loadProxiesStatus = (function ($) {
|
|||||||
{field: 'err', title: i18n['Info'], templet: '<span>{{= d.err || "-" }}</span>', width: 200}
|
{field: 'err', title: i18n['Info'], templet: '<span>{{= d.err || "-" }}</span>', width: 200}
|
||||||
];
|
];
|
||||||
|
|
||||||
var proxiesTable = layui.table.render({
|
var overviewTable = layui.table.render({
|
||||||
elem: '#proxiesTable',
|
elem: '#overviewTable',
|
||||||
height: $section.height(),
|
height: $section.height(),
|
||||||
text: {none: i18n['EmptyData']},
|
text: {none: i18n['EmptyData']},
|
||||||
cols: [cols],
|
cols: [cols],
|
||||||
@@ -73,9 +73,9 @@ var loadProxiesStatus = (function ($) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
window.onresize = function () {
|
window.onresize = function () {
|
||||||
proxiesTable.resize();
|
overviewTable.resize();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return loadProxiesStatus;
|
return loadOverview;
|
||||||
})(layui.$);
|
})(layui.$);
|
||||||
@@ -18,8 +18,8 @@
|
|||||||
var title = elem.text();
|
var title = elem.text();
|
||||||
if (id === 'clientInfo') {
|
if (id === 'clientInfo') {
|
||||||
loadClientInfo(lang, title.trim());
|
loadClientInfo(lang, title.trim());
|
||||||
} else if (id === 'proxiesStatus') {
|
} else if (id === 'overview') {
|
||||||
loadProxiesStatus(lang, title.trim());
|
loadOverview(lang, title.trim());
|
||||||
} else if (elem.closest('.layui-nav-item').attr('id') === 'proxies') {
|
} else if (elem.closest('.layui-nav-item').attr('id') === 'proxies') {
|
||||||
if (id != null && id.trim() !== '') {
|
if (id != null && id.trim() !== '') {
|
||||||
var suffix = elem.closest('.layui-nav-item').children('a').text().trim();
|
var suffix = elem.closest('.layui-nav-item').children('a').text().trim();
|
||||||
|
|||||||
@@ -7,8 +7,8 @@
|
|||||||
<link rel="stylesheet" href="./static/css/index.css?v=${ .version }">
|
<link rel="stylesheet" href="./static/css/index.css?v=${ .version }">
|
||||||
<link rel="stylesheet" href="./static/css/color.css?v=${ .version }">
|
<link rel="stylesheet" href="./static/css/color.css?v=${ .version }">
|
||||||
<script src="./static/lib/layui/layui.js?v=${ .version }"></script>
|
<script src="./static/lib/layui/layui.js?v=${ .version }"></script>
|
||||||
<script src="./static/js/index-proxy-status.js?v=${ .version }"></script>
|
|
||||||
<script src="./static/js/index-client-info.js?v=${ .version }"></script>
|
<script src="./static/js/index-client-info.js?v=${ .version }"></script>
|
||||||
|
<script src="./static/js/index-proxy-overview.js?v=${ .version }"></script>
|
||||||
<script src="./static/js/index-proxy-list.js?v=${ .version }"></script>
|
<script src="./static/js/index-proxy-list.js?v=${ .version }"></script>
|
||||||
<script src="./static/js/index.js?v=${ .version }"></script>
|
<script src="./static/js/index.js?v=${ .version }"></script>
|
||||||
</head>
|
</head>
|
||||||
@@ -30,7 +30,7 @@
|
|||||||
<a href="javascript:void(0)" id="clientInfo">${ .ClientInfo }</a>
|
<a href="javascript:void(0)" id="clientInfo">${ .ClientInfo }</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="layui-nav-item">
|
<li class="layui-nav-item">
|
||||||
<a href="javascript:void(0)" id="proxiesStatus">${ .ProxiesStatus }</a>
|
<a href="javascript:void(0)" id="overview">${ .Overview }</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="layui-nav-item layui-nav-itemed" id="proxies">
|
<li class="layui-nav-item layui-nav-itemed" id="proxies">
|
||||||
<a class="" href="javascript:void(0)">${ .Proxies }</a>
|
<a class="" href="javascript:void(0)">${ .Proxies }</a>
|
||||||
@@ -65,9 +65,9 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!--代理列表-代理表格模板-->
|
<!--代理列表-代理表格模板-->
|
||||||
<script type="text/html" id="proxiesTableTemplate">
|
<script type="text/html" id="overviewTableTemplate">
|
||||||
<section class="proxies">
|
<section class="overview">
|
||||||
<table id="proxiesTable" lay-filter="proxiesTable"></table>
|
<table id="overviewTable" lay-filter="overviewTable"></table>
|
||||||
</section>
|
</section>
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@@ -176,18 +176,18 @@
|
|||||||
class="layui-input"/>
|
class="layui-input"/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{{# if (d.type === 'http' || d.type === 'https') { }}
|
{{# if (d.type.toLowerCase() === 'http' || d.type.toLowerCase() === 'https') { }}
|
||||||
<div class="layui-form-item http https">
|
<div class="layui-form-item http https">
|
||||||
<label class="layui-form-label">${ .CustomizeDomains }</label>
|
<label class="layui-form-label">${ .CustomDomains }</label>
|
||||||
<div class="layui-input-block">
|
<div class="layui-input-block">
|
||||||
<textarea name="custom_domains" placeholder="${ .CustomizeDomains }" autocomplete="off"
|
<textarea name="custom_domains" placeholder="${ .CustomDomains }" autocomplete="off"
|
||||||
class="layui-textarea"></textarea>
|
class="layui-textarea"></textarea>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="layui-form-item layui-form-text http https">
|
<div class="layui-form-item layui-form-text http https">
|
||||||
<label class="layui-form-label">${ .Subdomain }</label>
|
<label class="layui-form-label">${ .Subdomain }</label>
|
||||||
<div class="layui-input-block">
|
<div class="layui-input-block">
|
||||||
<textarea name="sub_domain" placeholder="${ .Subdomain }" autocomplete="off"
|
<textarea name="subdomain" placeholder="${ .Subdomain }" autocomplete="off"
|
||||||
class="layui-textarea"></textarea>
|
class="layui-textarea"></textarea>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ func (c *HandleController) MakeIndexFunc() func(context *gin.Context) {
|
|||||||
"showExit": trimString(c.CommonInfo.AdminUser) != "" && trimString(c.CommonInfo.AdminPwd) != "",
|
"showExit": trimString(c.CommonInfo.AdminUser) != "" && trimString(c.CommonInfo.AdminPwd) != "",
|
||||||
"FrpcPanel": ginI18n.MustGetMessage(context, "Frpc Panel"),
|
"FrpcPanel": ginI18n.MustGetMessage(context, "Frpc Panel"),
|
||||||
"ClientInfo": ginI18n.MustGetMessage(context, "Client Info"),
|
"ClientInfo": ginI18n.MustGetMessage(context, "Client Info"),
|
||||||
"ProxiesStatus": ginI18n.MustGetMessage(context, "Proxies Status"),
|
"Overview": ginI18n.MustGetMessage(context, "Overview"),
|
||||||
"Proxies": ginI18n.MustGetMessage(context, "Proxies"),
|
"Proxies": ginI18n.MustGetMessage(context, "Proxies"),
|
||||||
"ServerAddress": ginI18n.MustGetMessage(context, "Server Address"),
|
"ServerAddress": ginI18n.MustGetMessage(context, "Server Address"),
|
||||||
"ServerPort": ginI18n.MustGetMessage(context, "Server Port"),
|
"ServerPort": ginI18n.MustGetMessage(context, "Server Port"),
|
||||||
@@ -89,7 +89,7 @@ func (c *HandleController) MakeIndexFunc() func(context *gin.Context) {
|
|||||||
"LocalIp": ginI18n.MustGetMessage(context, "Local Ip"),
|
"LocalIp": ginI18n.MustGetMessage(context, "Local Ip"),
|
||||||
"LocalPort": ginI18n.MustGetMessage(context, "Local Port"),
|
"LocalPort": ginI18n.MustGetMessage(context, "Local Port"),
|
||||||
"RemotePort": ginI18n.MustGetMessage(context, "Remote Port"),
|
"RemotePort": ginI18n.MustGetMessage(context, "Remote Port"),
|
||||||
"CustomizeDomains": ginI18n.MustGetMessage(context, "Customize Domains"),
|
"CustomDomains": ginI18n.MustGetMessage(context, "Custom Domains"),
|
||||||
"Subdomain": ginI18n.MustGetMessage(context, "Subdomain"),
|
"Subdomain": ginI18n.MustGetMessage(context, "Subdomain"),
|
||||||
"UseEncryption": ginI18n.MustGetMessage(context, "Use Encryption"),
|
"UseEncryption": ginI18n.MustGetMessage(context, "Use Encryption"),
|
||||||
"true": ginI18n.MustGetMessage(context, "true"),
|
"true": ginI18n.MustGetMessage(context, "true"),
|
||||||
@@ -116,6 +116,11 @@ func (c *HandleController) MakeLangFunc() func(context *gin.Context) {
|
|||||||
"running": ginI18n.MustGetMessage(context, "running"),
|
"running": ginI18n.MustGetMessage(context, "running"),
|
||||||
"LocalIp": ginI18n.MustGetMessage(context, "Local Ip"),
|
"LocalIp": ginI18n.MustGetMessage(context, "Local Ip"),
|
||||||
"LocalPort": ginI18n.MustGetMessage(context, "Local Port"),
|
"LocalPort": ginI18n.MustGetMessage(context, "Local Port"),
|
||||||
|
"RemotePort": ginI18n.MustGetMessage(context, "Remote Port"),
|
||||||
|
"UseEncryption": ginI18n.MustGetMessage(context, "Use Encryption"),
|
||||||
|
"UseCompression": ginI18n.MustGetMessage(context, "Use Compression"),
|
||||||
|
"CustomDomains": ginI18n.MustGetMessage(context, "Custom Domains"),
|
||||||
|
"Subdomain": ginI18n.MustGetMessage(context, "Subdomain"),
|
||||||
"Operation": ginI18n.MustGetMessage(context, "Operation"),
|
"Operation": ginI18n.MustGetMessage(context, "Operation"),
|
||||||
"Confirm": ginI18n.MustGetMessage(context, "Confirm"),
|
"Confirm": ginI18n.MustGetMessage(context, "Confirm"),
|
||||||
"Cancel": ginI18n.MustGetMessage(context, "Cancel"),
|
"Cancel": ginI18n.MustGetMessage(context, "Cancel"),
|
||||||
|
|||||||
Reference in New Issue
Block a user