diff --git a/assets/lang/en.json b/assets/lang/en.json index 841879a..d17e5fd 100644 --- a/assets/lang/en.json +++ b/assets/lang/en.json @@ -72,5 +72,22 @@ "Last Close": "Last Close", "Network Traffic": "Network Traffic", "today": "today", - "now": "now" + "now": "now", + "Version": "Version", + "Bind Port": "Bind Port", + "KCP Bind Port": "KCP Bind Port", + "QUIC Bind Port": "QUIC Bind Port", + "HTTP Port": "HTTP Port", + "HTTPS Port": "HTTPS Port", + "TCPMUX Port": "TCPMUX Port", + "Subdomain Host": "Subdomain Host", + "Max Pool Count": "Max Pool Count", + "Max Ports Per Client": "Max Ports Per Client", + "Heart Beat Timeout": "Heart Beat Timeout", + "Allow Ports": "Allow Ports", + "TLS Only": "TLS Only", + "Current Connections": "Current Connections", + "Client Counts": "Client Counts", + "Proxy Counts": "Proxy Counts", + "Not Set": "Not Set" } \ No newline at end of file diff --git a/assets/lang/zh.json b/assets/lang/zh.json index 218e299..8e7d46f 100644 --- a/assets/lang/zh.json +++ b/assets/lang/zh.json @@ -72,5 +72,22 @@ "Last Close": "上次断开时间", "Network Traffic": "网络流量", "today": "今日", - "now": "当前" + "now": "当前", + "Version": "版本号", + "Bind Port": "TCP 端口", + "KCP Bind Port": "KCP 端口", + "QUIC Bind Port": "QUIC 端口", + "HTTP Port": "HTTP 端口", + "HTTPS Port": "HTTPS 端口", + "TCPMUX Port": "TCPMUX 端口", + "Subdomain Host": "二级域名后缀", + "Max Pool Count": "每个代理最大连接池大小", + "Max Ports Per Client": "单个客户端最大同时存在代理数", + "Heart Beat Timeout": "心跳连接超时时间", + "Allow Ports": "端口限制", + "TLS Only": "仅接受启用 TLS 的客户端", + "Current Connections": "当前连接数", + "Client Counts": "客户端总数", + "Proxy Counts": "代理总数", + "Not Set": "未配置" } \ No newline at end of file diff --git a/assets/static/js/index-proxy-list.js b/assets/static/js/index-proxy-list.js index baeabc9..becedbc 100644 --- a/assets/static/js/index-proxy-list.js +++ b/assets/static/js/index-proxy-list.js @@ -114,8 +114,8 @@ var loadProxyInfo = (function ($) { 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 + '']; + datum.conf.use_encryption = i18n[useEncryption]; + datum.conf.use_compression = i18n[useCompression]; console.log(datum) var html = layui.laytpl(expandTrTemplateHtml).render({ index: i, diff --git a/assets/static/js/index-server-info.js b/assets/static/js/index-server-info.js index 429b54a..115861c 100644 --- a/assets/static/js/index-server-info.js +++ b/assets/static/js/index-server-info.js @@ -22,6 +22,18 @@ var loadServerInfo = (function ($) { for (var proxy in data.proxy_type_count) { data.proxy_counts = data.proxy_counts + data.proxy_type_count[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]; renderServerInfo(data); } else { layui.layer.msg(result.message); diff --git a/assets/templates/index.html b/assets/templates/index.html index 7cab438..1ac0de2 100644 --- a/assets/templates/index.html +++ b/assets/templates/index.html @@ -71,7 +71,7 @@
Frp | - ${ .FrpsPanel } v${ .version } + ${ .FrpsPanel } ${ .version }
@@ -82,67 +82,67 @@
-
Version
+
${ .Version }
{{= d.version }}
-
BindPort
+
${ .BindPort }
{{= d.bind_port }}
-
KCP Bind Port
+
${ .KCPBindPort }
{{= d.kcp_bind_port }}
-
QUIC Bind Port
+
${ .QUICBindPort }
{{= d.quic_bind_port }}
-
Http Port
+
${ .HTTPPort }
{{= d.vhost_http_port }}
-
Https Port
+
${ .HTTPSPort }
{{= d.vhost_https_port }}
-
TCPMUX Port
+
${ .TCPMUXPort }
{{= d.tcpmux_httpconnect_port }}
-
Subdomain Host
+
${ .SubdomainHost }
{{= d.subdomain_host }}
-
Max PoolCount
+
${ .MaxPoolCount }
{{= d.max_pool_count }}
-
Max Ports Per Client
+
${ .MaxPortsPerClient }
{{= d.max_ports_per_client }}
-
HeartBeat Timeout
+
${ .HeartBeatTimeout }
{{= d.heart_beat_timeout }}
-
Allow Ports
-
{{= d.allow_ports_str || 'Not limit' }}
+
${ .AllowPorts }
+
{{= d.allow_ports_str }}
-
TLS Only
-
{{= d.tls_only || 'No' }}
+
${ .TLSOnly }
+
{{= d.tls_only }}
-
Current Connections
+
${ .CurrentConnections }
{{= d.cur_conns }}
-
Client Counts
+
${ .ClientCounts }
{{= d.client_counts }}
-
Proxy Counts
+
${ .ProxyCounts }
{{= d.proxy_counts }}
diff --git a/config/frps-panel.ini b/config/frps-panel.ini index 6915d97..fa36c15 100644 --- a/config/frps-panel.ini +++ b/config/frps-panel.ini @@ -6,10 +6,10 @@ plugin_port = 7200 admin_user = admin admin_pwd = admin ; frp dashboard info -dashboard_addr = frp.yanghuanglin.com +dashboard_addr = 127.0.0.1 dashboard_port = 7500 dashboard_user = admin -dashboard_pwd = 19910621 +dashboard_pwd = admin ; user tokens [users] diff --git a/pkg/server/controller/controller.go b/pkg/server/controller/controller.go index 0863a24..3340285 100644 --- a/pkg/server/controller/controller.go +++ b/pkg/server/controller/controller.go @@ -176,6 +176,7 @@ func (c *HandleController) MakeHandlerFunc() gin.HandlerFunc { func (c *HandleController) MakeManagerFunc() func(context *gin.Context) { return func(context *gin.Context) { context.HTML(http.StatusOK, "index.html", gin.H{ + "version": c.Version, "FrpsPanel": ginI18n.MustGetMessage(context, "Frps Panel"), "User": ginI18n.MustGetMessage(context, "User"), "Token": ginI18n.MustGetMessage(context, "Token"), @@ -215,7 +216,22 @@ func (c *HandleController) MakeManagerFunc() func(context *gin.Context) { "Addr": ginI18n.MustGetMessage(context, "Addr"), "LastStart": ginI18n.MustGetMessage(context, "Last Start"), "LastClose": ginI18n.MustGetMessage(context, "Last Close"), - "version": c.Version, + "Version": ginI18n.MustGetMessage(context, "Version"), + "BindPort": ginI18n.MustGetMessage(context, "Bind Port"), + "KCPBindPort": ginI18n.MustGetMessage(context, "KCP Bind Port"), + "QUICBindPort": ginI18n.MustGetMessage(context, "QUIC Bind Port"), + "HTTPPort": ginI18n.MustGetMessage(context, "HTTP Port"), + "HTTPSPort": ginI18n.MustGetMessage(context, "HTTPS Port"), + "TCPMUXPort": ginI18n.MustGetMessage(context, "TCPMUX Port"), + "SubdomainHost": ginI18n.MustGetMessage(context, "Subdomain Host"), + "MaxPoolCount": ginI18n.MustGetMessage(context, "Max Pool Count"), + "MaxPortsPerClient": ginI18n.MustGetMessage(context, "Max Ports Per Client"), + "HeartBeatTimeout": ginI18n.MustGetMessage(context, "Heart Beat Timeout"), + "AllowPorts": ginI18n.MustGetMessage(context, "Allow Ports"), + "TLSOnly": ginI18n.MustGetMessage(context, "TLS Only"), + "CurrentConnections": ginI18n.MustGetMessage(context, "Current Connections"), + "ClientCounts": ginI18n.MustGetMessage(context, "Client Counts"), + "ProxyCounts": ginI18n.MustGetMessage(context, "Proxy Counts"), }) } } @@ -248,6 +264,7 @@ func (c *HandleController) MakeLangFunc() func(context *gin.Context) { "ShouldCheckUser": ginI18n.MustGetMessage(context, "Please check at least one user"), "OperationConfirm": ginI18n.MustGetMessage(context, "Operation confirm"), "EmptyData": ginI18n.MustGetMessage(context, "Empty data"), + "NotLimit": ginI18n.MustGetMessage(context, "Not limit"), "AllowedPorts": ginI18n.MustGetMessage(context, "Allowed ports"), "AllowedDomains": ginI18n.MustGetMessage(context, "Allowed domains"), "AllowedSubdomains": ginI18n.MustGetMessage(context, "Allowed subdomains"), @@ -271,6 +288,7 @@ func (c *HandleController) MakeLangFunc() func(context *gin.Context) { "today": ginI18n.MustGetMessage(context, "today"), "now": ginI18n.MustGetMessage(context, "now"), "Proxies": ginI18n.MustGetMessage(context, "Proxies"), + "NotSet": ginI18n.MustGetMessage(context, "Not Set"), }) } }