diff --git a/templates/about.html b/templates/about.html index edbeb47..944cab8 100644 --- a/templates/about.html +++ b/templates/about.html @@ -1,5 +1,5 @@ {{ define "title"}} -About +关于 {{ end }} {{ define "top_css"}} @@ -10,7 +10,7 @@ About {{ end }} {{ define "page_title"}} -About +关于 {{ end }} {{ define "page_content"}} @@ -22,34 +22,34 @@ About
-

About Wireguard-UI

+

关于 WireGuard-UI

- +
{{ if .gitCommit }}
- +
{{ end }}
- +
- +
- +
@@ -91,7 +91,7 @@ About }, error: function (jqXHR, exception) { - $("#currentReleaseDate").attr("value", "Could not find this version on GitHub.com"); + $("#currentReleaseDate").attr("value", "未能在 GitHub.com 上找到该版本"); } }); @@ -112,9 +112,9 @@ About }, error: function (jqXHR, exception) { - $("#latestRelease").attr("value", "Could not connect to GitHub.com"); - $("#latestReleaseDate").attr("value", "Could not connect to GitHub.com"); - $("#author").attr("value", "Could not connect to GitHub.com"); + $("#latestRelease").attr("value", "无法连接到 GitHub.com"); + $("#latestReleaseDate").attr("value", "无法连接到 GitHub.com"); + $("#author").attr("value", "无法连接到 GitHub.com"); } }); @@ -129,14 +129,14 @@ About "")); }, error: function (jqXHR, exception) { - $("#contributors").html("

Could not connect to GitHub.com

"); + $("#contributors").html("

无法连接到 GitHub.com

"); } }); }); $(document).ajaxStop(function () { if (Date.parse($("#currentReleaseDate").val()) < Date.parse($("#latestReleaseDate").val())) { - $("#currentReleaseDate").after("

Current version is out of date

") + $("#currentReleaseDate").after("

当前版本已过期

") } }); diff --git a/templates/base.html b/templates/base.html index dca5698..2cb595d 100644 --- a/templates/base.html +++ b/templates/base.html @@ -48,8 +48,8 @@
@@ -117,12 +117,12 @@
- + +} @@ -319,8 +323,8 @@ Wireguard Clients $(`${elementID} option`).remove(); $(elementID).append( $("") - .text("Any") - .val("__default_any__") + .text("任意") +} .val("__default_any__") ); $.each(data, function(index, item) { $(elementID).append( @@ -339,23 +343,24 @@ Wireguard Clients function updateSearchList() { $.getJSON("{{.basePath}}/api/subnet-ranges", null, function(data) { $("#status-selector option").remove(); - $("#status-selector").append( - $("") - .text("All") - .val("All"), - $("") - .text("Enabled") - .val("Enabled"), - $("") - .text("Disabled") - .val("Disabled"), - $("") - .text("Connected") - .val("Connected"), - $("") - .text("Disconnected") - .val("Disconnected") - ); + $("#status-selector").append( + $("") + .text("全部") + .val("All"), + $("") + .text("已启用") + .val("Enabled"), + $("") + .text("已禁用") + .val("Disabled"), + $("") + .text("已连接") + .val("Connected"), + $("") + .text("未连接") + .val("Disconnected") + ); +} $.each(data, function(index, item) { $("#status-selector").append( $("") @@ -483,8 +488,8 @@ Wireguard Clients const client_id = button.data('clientid'); const client_name = button.data('clientname'); const modal = $(this); - modal.find('.modal-body').text("You are about to disable client " + client_name); - modal.find('#pause_client_confirm').val(client_id); + modal.find('.modal-body').text("你将禁用客户端 " + client_name); +} modal.find('#pause_client_confirm').val(client_id); }) // pause_client_confirm button event @@ -502,8 +507,8 @@ Wireguard Clients const client_id = button.data('clientid'); const client_name = button.data('clientname'); const modal = $(this); - modal.find('.modal-body').text("You are about to remove client " + client_name); - modal.find('#remove_client_confirm').val(client_id); + modal.find('.modal-body').text("你将删除客户端 " + client_name); +} modal.find('#remove_client_confirm').val(client_id); }) // remove_client_confirm button event @@ -520,8 +525,8 @@ Wireguard Clients data: JSON.stringify(data), success: function(data) { $("#modal_remove_client").modal('hide'); - toastr.success('Removed client successfully'); - const divElement = document.getElementById('client_' + client_id); + toastr.success('已成功删除客户端'); +} const divElement = document.getElementById('client_' + client_id); divElement.style.display = "none"; updateApplyConfigVisibility() }, @@ -588,8 +593,8 @@ Wireguard Clients success: function (resp) { const client = resp.Client; - modal.find(".modal-title").text("Edit Client " + client.name); - modal.find("#_client_id").val(client.id); + modal.find(".modal-title").text("编辑客户端 " + client.name); +} modal.find("#_client_id").val(client.id); modal.find("#_client_name").val(client.name); modal.find("#_client_email").val(client.email); @@ -656,8 +661,8 @@ Wireguard Clients success: function (resp) { const client = resp.Client; - $(".modal-title").text("Scan QR Code for " + client.name + " profile"); - QRCodeImg.attr('src', resp.QRCode).show(); + $(".modal-title").text("扫描 " + client.name + " 配置的二维码"); +} QRCodeImg.attr('src', resp.QRCode).show(); QRCodeA.attr('download', resp.Client.name); QRCodeA.attr('href', resp.QRCode).show(); }, @@ -682,8 +687,11 @@ Wireguard Clients data: JSON.stringify(data), success: function(resp) { $("#modal_email_client").modal('hide'); - toastr.success('Sent email to client successfully'); + toastr.success('已成功发送邮件给客户端'); }, + +} + error: function(jqXHR, exception) { const responseJson = jQuery.parseJSON(jqXHR.responseText); toastr.error(responseJson['message']); @@ -736,7 +744,8 @@ Wireguard Clients data: JSON.stringify(data), success: function(resp) { $("#modal_edit_client").modal('hide'); - toastr.success('Updated client successfully'); + toastr.success('已成功更新客户端'); +} // Refresh the home page (clients page) after updating successfully location.reload(); }, @@ -770,7 +779,7 @@ Wireguard Clients success: function (resp) { const client = resp.Client; - modal.find(".modal-title").text("Send config to client " + client.name); + modal.find(".modal-title").text("发送配置到客户端 " + client.name); modal.find("#e_client_id").val(client.id); modal.find("#e_client_email").val(client.email); }, @@ -806,7 +815,7 @@ Wireguard Clients }, messages: { client_name: { - required: "Please enter a name" + required: "请输入名称" }, }, errorElement: 'span', @@ -831,9 +840,9 @@ Wireguard Clients }, messages: { e_client_email: { - required: "Please enter an email" + required: "请输入邮箱地址" }, - }, +} }, errorElement: 'span', errorPlacement: function (error, element) { error.addClass('invalid-feedback'); diff --git a/templates/global_settings.html b/templates/global_settings.html index 73b3c93..bba3fcb 100644 --- a/templates/global_settings.html +++ b/templates/global_settings.html @@ -1,5 +1,5 @@ {{define "title"}} -Global Settings +全局设置 {{end}} {{define "top_css"}} @@ -10,7 +10,7 @@ Global Settings {{end}} {{define "page_title"}} -Global Settings +全局设置 {{end}} {{define "page_content"}} @@ -22,63 +22,64 @@ Global Settings
-

Wireguard Global Settings

-
+

WireGuard 全局设置

+}
- -
- + +}
+ - + class="nav-icon fas fa-magic"> 建议 +}
- - + +}
- - MTU(最大传输单元) +}
- - 持久 Keepalive +}
- - 防火墙标记 +}
- - 路由表(Table) +}
- - WireGuard 配置文件路径 +}
+ +}
@@ -86,34 +87,28 @@ Global Settings
-

Help

-
+

使用说明

+}
-
1. Endpoint Address
-
The public IP address of your Wireguard server that the client will connect to. Click on - Suggest button to auto detect the public IP address of your server.
-
2. DNS Servers
-
The DNS servers will be set to client config.
-
3. MTU
-
The MTU will be set to server and client config. By default it is 1450. You might want - to adjust the MTU size if your connection (e.g PPPoE, 3G, satellite network, etc) has a low MTU.
-
Leave blank to omit this setting in the configs.
-
4. Persistent Keepalive
-
By default, WireGuard peers remain silent while they do not need to communicate, - so peers located behind a NAT and/or firewall may be unreachable from other peers - until they reach out to other peers themselves. Adding PersistentKeepalive - can ensure that the connection remains open.
-
Leave blank to omit this setting in the Client config.
-
5. Firewall Mark
-
Add a matching fwmark on all packets going out of a WireGuard non-default-route tunnel. Default value: 0xca6c
-
6. Table
-
Value for the Table setting in the wg conf file. Default value: auto
-
7. Wireguard Config File Path
-
The path of your Wireguard server config file. Please make sure the parent directory - exists and is writable.
-
+
1. 端点地址
+}
客户端将连接到的 WireGuard 服务器公网 IP。点击 建议 按钮可自动检测服务器公网地址。
+}
2. DNS 服务器
+}
这些 DNS 服务器将写入客户端配置。
+}
3. MTU
+
MTU 会应用到服务器和客户端配置,默认值为 1450。若连接(例如 PPPoE、3G、卫星网络等)MTU 较小,可在此调整。
+
留空则在配置中忽略此设置。
+}
4. 持久 Keepalive
+}
默认情况下,当 WireGuard 节点无需通信时会保持静默,如果节点位于 NAT 或防火墙之后,可能无法被其他节点主动访问,除非先发起请求。设置 PersistentKeepalive 可确保连接保持畅通。
+
留空则在客户端配置中忽略此项。
+}
5. 防火墙标记
+
为 WireGuard 非默认路由通道发出的所有数据包添加匹配的 fwmark。默认值:0xca6c
+}
6. 路由表(Table)
+
wg 配置文件中 Table 选项的值。默认值:auto
+
7. WireGuard 配置文件路径
+
WireGuard 服务器配置文件路径,请确保父目录存在且可写。
+}
@@ -127,21 +122,21 @@ Global Settings diff --git a/templates/login.html b/templates/login.html index c0a96b9..4c123bd 100644 --- a/templates/login.html +++ b/templates/login.html @@ -4,7 +4,7 @@ - WireGuard UI + WireGuard UI 管理台 @@ -25,15 +25,15 @@