update local translate
This commit is contained in:
parent
0f26cf6bf7
commit
9d7948417b
|
|
@ -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
|
|||
<div class="col-md-6">
|
||||
<div class="card card-success">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">About Wireguard-UI</h3>
|
||||
<h3 class="card-title">关于 WireGuard-UI</h3>
|
||||
</div>
|
||||
<!-- /.card-header -->
|
||||
<div class="card-body">
|
||||
<div class="form-group">
|
||||
<label for="version" class="control-label">Current version</label>
|
||||
<label for="version" class="control-label">当前版本</label>
|
||||
<input type="text" class="form-control" id="version" value="{{ .appVersion }}" readonly>
|
||||
</div>
|
||||
{{ if .gitCommit }}
|
||||
<div class="form-group">
|
||||
<label for="version" class="control-label">git commit hash</label>
|
||||
<label for="version" class="control-label">Git 提交哈希</label>
|
||||
<input type="text" class="form-control" id="version" value="{{ .gitCommit }}" readonly>
|
||||
</div>
|
||||
{{ end }}
|
||||
<div class="form-group">
|
||||
<label for="currentReleaseDate" class="control-label">Current version release date</label>
|
||||
<label for="currentReleaseDate" class="control-label">当前版本发布日期</label>
|
||||
<input type="text" class="form-control" id="currentReleaseDate" readonly>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="latestRelease" class="control-label">Latest release</label>
|
||||
<label for="latestRelease" class="control-label">最新版本</label>
|
||||
<input type="text" class="form-control" id="latestRelease" readonly>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="latestReleaseDate" class="control-label">Latest release date</label>
|
||||
<label for="latestReleaseDate" class="control-label">最新版本发布日期</label>
|
||||
<input type="text" class="form-control" id="latestReleaseDate" readonly>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="author" class="control-label">Author</label>
|
||||
<label for="author" class="control-label">作者</label>
|
||||
<div id="author">
|
||||
<a id="authorLink">
|
||||
<img id="authorImage"
|
||||
|
|
@ -58,13 +58,13 @@ About
|
|||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="contributors" class="control-label">Contributors</label>
|
||||
<label for="contributors" class="control-label">贡献者</label>
|
||||
<div id="contributors"></div>
|
||||
</div>
|
||||
<strong>Copyright ©
|
||||
<strong>版权所有 ©
|
||||
<script>document.write(new Date().getFullYear())</script>
|
||||
<a href="https://github.com/ngoduykhanh/wireguard-ui">Wireguard UI</a>.
|
||||
</strong> All rights reserved.
|
||||
<a href="https://github.com/ngoduykhanh/wireguard-ui">WireGuard UI</a>。
|
||||
</strong> 保留所有权利。
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -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
|
|||
"<img src=\"" + contributor.avatar_url + "\" style=\"width: 50px; height: 50px; border-radius: 50%; border: 1px solid #000; margin: 5px;\"/></a>"));
|
||||
},
|
||||
error: function (jqXHR, exception) {
|
||||
$("#contributors").html("<p>Could not connect to GitHub.com</p>");
|
||||
$("#contributors").html("<p>无法连接到 GitHub.com</p>");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$(document).ajaxStop(function () {
|
||||
if (Date.parse($("#currentReleaseDate").val()) < Date.parse($("#latestReleaseDate").val())) {
|
||||
$("#currentReleaseDate").after("<p style=\"color:red\">Current version is out of date</p>")
|
||||
$("#currentReleaseDate").after("<p style=\"color:red\">当前版本已过期</p>")
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -48,8 +48,8 @@
|
|||
<!-- SEARCH FORM -->
|
||||
<form class="form-inline ml-3" style="display: none" id="search-form">
|
||||
<div class="input-group input-group-sm">
|
||||
<input class="form-control form-control-navbar" placeholder="Search"
|
||||
aria-label="Search" id="search-input">
|
||||
<input class="form-control form-control-navbar" placeholder="搜索"
|
||||
aria-label="搜索" id="search-input">
|
||||
<div class="input-group-append">
|
||||
<button class="btn-navbar" type="submit" disabled>
|
||||
<i class="fas fa-search"></i>
|
||||
|
|
@ -59,11 +59,11 @@
|
|||
<div class="form-group form-group-sm">
|
||||
<select name="status-selector" id="status-selector" class="custom-select form-control-navbar" style="margin-left: 0.5em; height: 90%; font-size: 14px;">
|
||||
<!-- THIS SECTION IS OVERRIDDEN BY JS. SEE updateSearchList() function in clients.html BEFORE EDITING -->
|
||||
<option value="All">All</option>
|
||||
<option value="Enabled">Enabled</option>
|
||||
<option value="Disabled">Disabled</option>
|
||||
<option value="Connected">Connected</option>
|
||||
<option value="Disconnected">Disconnected</option>
|
||||
<option value="All">全部</option>
|
||||
<option value="Enabled">已启用</option>
|
||||
<option value="Disabled">已禁用</option>
|
||||
<option value="Connected">已连接</option>
|
||||
<option value="Disconnected">已断开</option>
|
||||
<!-- THIS SECTION IS OVERRIDDEN BY JS. SEE updateSearchList() function in clients.html BEFORE EDITING -->
|
||||
</select>
|
||||
</div>
|
||||
|
|
@ -72,14 +72,14 @@
|
|||
<!-- Right navbar links -->
|
||||
<div class="navbar-nav ml-auto">
|
||||
<button style="margin-left: 0.5em;" type="button" class="btn btn-outline-primary btn-sm" data-toggle="modal"
|
||||
data-target="#modal_new_client"><i class="nav-icon fas fa-plus"></i> New
|
||||
Client</button>
|
||||
data-target="#modal_new_client"><i class="nav-icon fas fa-plus"></i> 新增
|
||||
客户端</button>
|
||||
<button id="apply-config-button" style="margin-left: 0.5em; display: none;" type="button" class="btn btn-outline-danger btn-sm" data-toggle="modal"
|
||||
data-target="#modal_apply_config"><i class="nav-icon fas fa-check"></i> Apply
|
||||
Config</button>
|
||||
data-target="#modal_apply_config"><i class="nav-icon fas fa-check"></i> 应用
|
||||
配置</button>
|
||||
{{if .baseData.CurrentUser}}
|
||||
<button onclick="location.href='{{.basePath}}/logout';" style="margin-left: 0.5em;" type="button"
|
||||
class="btn btn-outline-danger btn-sm"><i class="nav-icon fas fa-sign-out-alt"></i> Logout</button>
|
||||
class="btn btn-outline-danger btn-sm"><i class="nav-icon fas fa-sign-out-alt"></i> 退出登录</button>
|
||||
{{end}}
|
||||
</div>
|
||||
</nav>
|
||||
|
|
@ -89,7 +89,7 @@
|
|||
<aside class="main-sidebar sidebar-dark-primary elevation-4">
|
||||
<!-- Brand Logo -->
|
||||
<a href="{{.basePath}}" class="brand-link">
|
||||
<span class="brand-text"> WIREGUARD UI</span>
|
||||
<span class="brand-text"> WIREGUARD UI 管理台</span>
|
||||
</a>
|
||||
|
||||
<!-- Sidebar -->
|
||||
|
|
@ -103,13 +103,13 @@
|
|||
{{if .baseData.CurrentUser}}
|
||||
|
||||
{{if .baseData.Admin}}
|
||||
<a href="{{.basePath}}/profile" class="d-block">Administrator: {{.baseData.CurrentUser}}</a>
|
||||
<a href="{{.basePath}}/profile" class="d-block">管理员:{{.baseData.CurrentUser}}</a>
|
||||
{{else}}
|
||||
<a href="{{.basePath}}/profile" class="d-block">Manager: {{.baseData.CurrentUser}}</a>
|
||||
<a href="{{.basePath}}/profile" class="d-block">管理者:{{.baseData.CurrentUser}}</a>
|
||||
{{end}}
|
||||
|
||||
{{else}}
|
||||
<a href="#" class="d-block">Administrator</a>
|
||||
<a href="#" class="d-block">管理员</a>
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -117,12 +117,12 @@
|
|||
<!-- Sidebar Menu -->
|
||||
<nav class="mt-2">
|
||||
<ul class="nav nav-pills nav-sidebar flex-column" data-widget="treeview" role="menu" data-accordion="false">
|
||||
<li class="nav-header">MAIN</li>
|
||||
<li class="nav-header">主要功能</li>
|
||||
<li class="nav-item">
|
||||
<a href="{{.basePath}}/" class="nav-link {{if eq .baseData.Active ""}}active{{end}}">
|
||||
<i class="nav-icon fas fa-user-secret"></i>
|
||||
<p>
|
||||
Wireguard Clients
|
||||
WireGuard 客户端
|
||||
</p>
|
||||
</a>
|
||||
</li>
|
||||
|
|
@ -132,18 +132,18 @@
|
|||
<a href="{{.basePath}}/wg-server" class="nav-link {{if eq .baseData.Active "wg-server" }}active{{end}}">
|
||||
<i class="nav-icon fas fa-server"></i>
|
||||
<p>
|
||||
Wireguard Server
|
||||
WireGuard 服务器
|
||||
</p>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
<li class="nav-header">SETTINGS</li>
|
||||
<li class="nav-header">设置</li>
|
||||
<li class="nav-item">
|
||||
<a href="{{.basePath}}/global-settings" class="nav-link {{if eq .baseData.Active "global-settings" }}active{{end}}">
|
||||
<i class="nav-icon fas fa-cog"></i>
|
||||
<p>
|
||||
Global Settings
|
||||
全局设置
|
||||
</p>
|
||||
</a>
|
||||
</li>
|
||||
|
|
@ -151,20 +151,21 @@
|
|||
<li class="nav-item">
|
||||
<a href="{{.basePath}}/users-settings" class="nav-link {{if eq .baseData.Active "users-settings" }}active{{end}}">
|
||||
<i class="nav-icon fas fa-cog"></i>
|
||||
<p>
|
||||
Users Settings
|
||||
</p>
|
||||
<p>
|
||||
用户设置
|
||||
</p>
|
||||
|
||||
</a>
|
||||
</li>
|
||||
{{end}}
|
||||
{{end}}
|
||||
|
||||
<li class="nav-header">UTILITIES</li>
|
||||
<li class="nav-header">工具</li>
|
||||
<li class="nav-item">
|
||||
<a href="{{.basePath}}/status" class="nav-link {{if eq .baseData.Active "status" }}active{{end}}">
|
||||
<i class="nav-icon fas fa-signal"></i>
|
||||
<p>
|
||||
Status
|
||||
状态
|
||||
</p>
|
||||
</a>
|
||||
</li>
|
||||
|
|
@ -172,17 +173,18 @@
|
|||
<a href="{{.basePath}}/wake_on_lan_hosts" class="nav-link {{if eq .baseData.Active "wake_on_lan_hosts" }}active{{end}}">
|
||||
<i class="nav-icon fas fa-solid fa-power-off"></i>
|
||||
<p>
|
||||
WoL Hosts
|
||||
网络唤醒主机
|
||||
</p>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-header">ABOUT</li>
|
||||
<li class="nav-header">关于</li>
|
||||
<li class="nav-item">
|
||||
<a href="{{.basePath}}/about" class="nav-link {{if eq .baseData.Active "about" }}active{{end}}">
|
||||
<i class="nav-icon fas fa-solid fa-id-card"></i>
|
||||
<p>
|
||||
About
|
||||
</p>
|
||||
<p>
|
||||
关于
|
||||
</p>
|
||||
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
|
@ -196,7 +198,7 @@
|
|||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title">New Wireguard Client</h4>
|
||||
<h4 class="modal-title">新增 WireGuard 客户端</h4>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
|
|
@ -204,52 +206,50 @@
|
|||
<form name="frm_new_client" id="frm_new_client">
|
||||
<div class="modal-body">
|
||||
<div class="form-group">
|
||||
<label for="client_name" class="control-label">Name</label>
|
||||
<label for="client_name" class="control-label">名称</label>
|
||||
<input type="text" class="form-control" id="client_name" name="client_name">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="client_email" class="control-label">Email</label>
|
||||
<label for="client_email" class="control-label">邮箱</label>
|
||||
<input type="text" class="form-control" id="client_email" name="client_email">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="subnet_ranges" class="control-label">Subnet range</label>
|
||||
<label for="subnet_ranges" class="control-label">子网范围</label>
|
||||
<select id="subnet_ranges" class="select2"
|
||||
data-placeholder="Select a subnet range" style="width: 100%;">
|
||||
data-placeholder="请选择子网范围" style="width: 100%;">
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="client_allocated_ips" class="control-label">IP Allocation</label>
|
||||
<label for="client_allocated_ips" class="control-label">IP 分配</label>
|
||||
<input type="text" data-role="tagsinput" class="form-control" id="client_allocated_ips">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="client_allowed_ips" class="control-label">Allowed IPs
|
||||
<label for="client_allowed_ips" class="control-label">允许的 IP
|
||||
<i class="fas fa-info-circle" data-toggle="tooltip"
|
||||
data-original-title="Specify a list of addresses that will get routed to the
|
||||
server. These addresses will be included in 'AllowedIPs' of client config">
|
||||
data-original-title="指定需要路由到服务器的一组地址,这些地址会写入客户端配置的 'AllowedIPs' 字段">
|
||||
</i>
|
||||
</label>
|
||||
<input type="text" data-role="tagsinput" class="form-control" id="client_allowed_ips"
|
||||
value="{{ StringsJoin .client_defaults.AllowedIps "," }}">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="client_extra_allowed_ips" class="control-label">Extra Allowed IPs
|
||||
<label for="client_extra_allowed_ips" class="control-label">额外允许的 IP
|
||||
<i class="fas fa-info-circle" data-toggle="tooltip"
|
||||
data-original-title="Specify a list of addresses that will get routed to the
|
||||
client. These addresses will be included in 'AllowedIPs' of WG server config">
|
||||
data-original-title="指定需要路由到客户端的一组地址,这些地址会写入 WireGuard 服务端配置的 'AllowedIPs' 字段">
|
||||
</i>
|
||||
</label>
|
||||
<input type="text" data-role="tagsinput" class="form-control" id="client_extra_allowed_ips" value="{{ StringsJoin .client_defaults.ExtraAllowedIps "," }}">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="client_endpoint" class="control-label">Endpoint</label>
|
||||
<label for="client_endpoint" class="control-label">端点</label>
|
||||
<input type="text" class="form-control" id="client_endpoint" name="client_endpoint">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="icheck-primary d-inline">
|
||||
<input type="checkbox" id="use_server_dns" {{ if .client_defaults.UseServerDNS }}checked{{ end }}>
|
||||
<label for="use_server_dns">
|
||||
Use server DNS
|
||||
使用服务器 DNS
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -257,43 +257,41 @@
|
|||
<div class="icheck-primary d-inline">
|
||||
<input type="checkbox" id="enabled" {{ if .client_defaults.EnableAfterCreation }}checked{{ end }}>
|
||||
<label for="enabled">
|
||||
Enable after creation
|
||||
创建后立即启用
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<details>
|
||||
<summary><strong>Public and Preshared Keys</strong>
|
||||
<summary><strong>公钥与预共享密钥</strong>
|
||||
<i class="fas fa-info-circle" data-toggle="tooltip"
|
||||
data-original-title="If you don't want to let the server generate and store the
|
||||
client's private key, you can manually specify its public and preshared key here
|
||||
. Note: QR code will not be generated">
|
||||
data-original-title="如果不希望由服务器生成并保存客户端私钥,可以在此手动提供公钥与预共享密钥。注意:不会生成二维码">
|
||||
</i>
|
||||
</summary>
|
||||
<div class="form-group" style="margin-top: 1rem">
|
||||
<label for="client_public_key" class="control-label">
|
||||
Public Key
|
||||
公钥
|
||||
</label>
|
||||
<input type="text" class="form-control" id="client_public_key" name="client_public_key" placeholder="Autogenerated" aria-invalid="false">
|
||||
<input type="text" class="form-control" id="client_public_key" name="client_public_key" placeholder="自动生成" aria-invalid="false">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="client_preshared_key" class="control-label">
|
||||
Preshared Key
|
||||
预共享密钥
|
||||
</label>
|
||||
<input type="text" class="form-control" id="client_preshared_key" name="client_preshared_key" placeholder="Autogenerated - enter "-" to skip generation">
|
||||
<input type="text" class="form-control" id="client_preshared_key" name="client_preshared_key" placeholder="自动生成 - 输入“-”跳过生成">
|
||||
</div>
|
||||
</details>
|
||||
<details style="margin-top: 0.5rem;">
|
||||
<summary><strong>Additional configuration</strong>
|
||||
<summary><strong>附加配置</strong>
|
||||
</summary>
|
||||
<div class="form-group">
|
||||
<label for="additional_notes" class="control-label">Notes</label>
|
||||
<textarea class="form-control" style="min-height: 6rem;" id="additional_notes" name="additional_notes" placeholder="Additional notes about this client"></textarea>
|
||||
<label for="additional_notes" class="control-label">备注</label>
|
||||
<textarea class="form-control" style="min-height: 6rem;" id="additional_notes" name="additional_notes" placeholder="填写此客户端的补充说明"></textarea>
|
||||
</div>
|
||||
</details>
|
||||
</div>
|
||||
<div class="modal-footer justify-content-between">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
|
||||
<button type="submit" class="btn btn-primary">Submit</button>
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
|
||||
<button type="submit" class="btn btn-primary">提交</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
|
@ -307,17 +305,18 @@
|
|||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title">Apply Config</h4>
|
||||
<h4 class="modal-title">应用配置</h4>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<p>Do you want to write config file and restart WireGuard server?</p>
|
||||
<p>是否写入配置文件并重启 WireGuard 服务器?</p>
|
||||
</div>
|
||||
<div class="modal-footer justify-content-between">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
|
||||
<button type="button" class="btn btn-danger" id="apply_config_confirm">Apply</button>
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
|
||||
<button type="button" class="btn btn-danger" id="apply_config_confirm">应用</button>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
|
|
@ -347,10 +346,9 @@
|
|||
<!--
|
||||
<footer class="main-footer">
|
||||
<div class="float-right d-none d-sm-block">
|
||||
<b>Version</b> {{ .appVersion }}
|
||||
<b>版本</b> {{ .appVersion }}
|
||||
</div>
|
||||
<strong>Copyright © <script>document.write(new Date().getFullYear())</script> <a href="https://github.com/ngoduykhanh/wireguard-ui">Wireguard UI</a>.</strong> All rights
|
||||
reserved.
|
||||
<strong>Copyright © <script>document.write(new Date().getFullYear())</script> <a href="https://github.com/ngoduykhanh/wireguard-ui">Wireguard UI</a>.</strong> 版权所有。
|
||||
</footer>
|
||||
-->
|
||||
<!-- Control Sidebar -->
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
{{define "title"}}
|
||||
Wireguard Clients
|
||||
WireGuard 客户端
|
||||
{{end}}
|
||||
|
||||
{{define "top_css"}}
|
||||
|
|
@ -17,7 +17,7 @@ Wireguard Clients
|
|||
{{end}}
|
||||
|
||||
{{define "page_title"}}
|
||||
Wireguard Clients
|
||||
WireGuard 客户端
|
||||
{{end}}
|
||||
|
||||
{{define "page_content"}}
|
||||
|
|
@ -34,7 +34,7 @@ Wireguard Clients
|
|||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title">Email Configuration</h4>
|
||||
<h4 class="modal-title">邮件配置</h4>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
|
|
@ -43,15 +43,16 @@ Wireguard Clients
|
|||
<div class="modal-body">
|
||||
<input type="hidden" id="e_client_id" name="e_client_id">
|
||||
<div class="form-group">
|
||||
<label for="e_client_email" class="control-label">Email address</label>
|
||||
<label for="e_client_email" class="control-label">邮箱地址</label>
|
||||
<input type="text" class="form-control" id="e_client_email" name="e_client_email">
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer justify-content-between">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
|
||||
<button type="submit" class="btn btn-success">Send</button>
|
||||
</div>
|
||||
</form>
|
||||
<div class="modal-footer justify-content-between">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
|
||||
<button type="submit" class="btn btn-success">保存</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
|
|
@ -63,14 +64,15 @@ Wireguard Clients
|
|||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title">QR Code</h4>
|
||||
<h4 class="modal-title">二维码</h4>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<input type="hidden" id="qr_client_id" name="qr_client_id">
|
||||
<img id="qr_code" class="w-100" style="image-rendering: pixelated;" src="" alt="QR code" />
|
||||
<img id="qr_code" class="w-100" style="image-rendering: pixelated;" src="" alt="二维码" />
|
||||
|
||||
<!-- do not include FwMark in any client configs: it is INVALID. -->
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -86,7 +88,7 @@ Wireguard Clients
|
|||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title">Edit Client</h4>
|
||||
<h4 class="modal-title">编辑客户端</h4>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
|
|
@ -95,41 +97,41 @@ Wireguard Clients
|
|||
<div class="modal-body">
|
||||
<input type="hidden" id="_client_id" name="_client_id">
|
||||
<div class="form-group">
|
||||
<label for="_client_name" class="control-label">Name</label>
|
||||
<label for="_client_name" class="control-label">名称</label>
|
||||
<input type="text" class="form-control" id="_client_name" name="_client_name">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="_client_email" class="control-label">Email</label>
|
||||
<label for="_client_email" class="control-label">邮箱</label>
|
||||
<input type="text" class="form-control" id="_client_email" name="client_email">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="_subnet_ranges" class="control-label">Subnet range</label>
|
||||
<label for="_subnet_ranges" class="control-label">子网范围</label>
|
||||
<select id="_subnet_ranges" class="select2"
|
||||
data-placeholder="Select a subnet range" style="width: 100%;">
|
||||
</select>
|
||||
data-placeholder="选择一个子网范围" style="width: 100%;">
|
||||
} </select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="_client_allocated_ips" class="control-label">IP Allocation</label>
|
||||
<input type="text" data-role="tagsinput" class="form-control" id="_client_allocated_ips">
|
||||
<label for="_client_allocated_ips" class="control-label">IP 分配</label>
|
||||
} <input type="text" data-role="tagsinput" class="form-control" id="_client_allocated_ips">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="_client_allowed_ips" class="control-label">Allowed IPs</label>
|
||||
<input type="text" data-role="tagsinput" class="form-control" id="_client_allowed_ips">
|
||||
<label for="_client_allowed_ips" class="control-label">允许的 IP</label>
|
||||
} <input type="text" data-role="tagsinput" class="form-control" id="_client_allowed_ips">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="_client_extra_allowed_ips" class="control-label">Extra Allowed IPs</label>
|
||||
<input type="text" data-role="tagsinput" class="form-control"
|
||||
<label for="_client_extra_allowed_ips" class="control-label">额外允许的 IP</label>
|
||||
} <input type="text" data-role="tagsinput" class="form-control"
|
||||
id="_client_extra_allowed_ips">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="_client_endpoint" class="control-label">Endpoint</label>
|
||||
<input type="text" class="form-control" id="_client_endpoint" name="client_endpoint">
|
||||
<label for="_client_endpoint" class="control-label">端点</label>
|
||||
} <input type="text" class="form-control" id="_client_endpoint" name="client_endpoint">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="icheck-primary d-inline">
|
||||
<input type="checkbox" id="_use_server_dns">
|
||||
<label for="_use_server_dns">
|
||||
Use server DNS
|
||||
使用服务器 DNS
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -137,26 +139,25 @@ Wireguard Clients
|
|||
<div class="icheck-primary d-inline">
|
||||
<input type="checkbox" id="_enabled">
|
||||
<label for="_enabled">
|
||||
Enable this client
|
||||
启用该客户端
|
||||
</label>
|
||||
</div>
|
||||
} </div>
|
||||
</div>
|
||||
<details>
|
||||
<summary><strong>Public and Preshared Keys</strong>
|
||||
<summary><strong>公钥与预共享密钥</strong>
|
||||
<i class="fas fa-info-circle" data-toggle="tooltip"
|
||||
data-original-title="Update the server stored
|
||||
client Public and Preshared keys.">
|
||||
data-original-title="更新服务器保存的客户端公钥与预共享密钥。">
|
||||
</i>
|
||||
</summary>
|
||||
<div class="form-group" style="margin-top: 1rem">
|
||||
<label for="_client_public_key" class="control-label">
|
||||
Public Key
|
||||
公钥
|
||||
</label>
|
||||
<input type="text" class="form-control" id="_client_public_key" name="_client_public_key" aria-invalid="false">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="_client_preshared_key" class="control-label">
|
||||
Preshared Key
|
||||
预共享密钥
|
||||
</label>
|
||||
<input type="text" class="form-control" id="_client_preshared_key" name="_client_preshared_key">
|
||||
</div>
|
||||
|
|
@ -170,10 +171,11 @@ Wireguard Clients
|
|||
</div>
|
||||
</details>
|
||||
</div>
|
||||
<div class="modal-footer justify-content-between">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
|
||||
<button type="submit" class="btn btn-success">Save</button>
|
||||
</div>
|
||||
<div class="modal-footer justify-content-between">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
|
||||
<button type="submit" class="btn btn-success">发送</button>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
|
|
@ -193,10 +195,11 @@ Wireguard Clients
|
|||
</div>
|
||||
<div class="modal-body">
|
||||
</div>
|
||||
<div class="modal-footer justify-content-between">
|
||||
<button type="button" class="btn btn-outline-dark" data-dismiss="modal">Cancel</button>
|
||||
<button type="button" class="btn btn-outline-dark" id="pause_client_confirm">Apply</button>
|
||||
</div>
|
||||
<div class="modal-footer justify-content-between">
|
||||
<button type="button" class="btn btn-outline-dark" data-dismiss="modal">取消</button>
|
||||
<button type="button" class="btn btn-outline-dark" id="pause_client_confirm">应用</button>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
|
|
@ -215,10 +218,11 @@ Wireguard Clients
|
|||
</div>
|
||||
<div class="modal-body">
|
||||
</div>
|
||||
<div class="modal-footer justify-content-between">
|
||||
<button type="button" class="btn btn-outline-dark" data-dismiss="modal">Cancel</button>
|
||||
<button type="button" class="btn btn-outline-dark" id="remove_client_confirm">Apply</button>
|
||||
</div>
|
||||
<div class="modal-footer justify-content-between">
|
||||
<button type="button" class="btn btn-outline-dark" data-dismiss="modal">取消</button>
|
||||
<button type="button" class="btn btn-outline-dark" id="remove_client_confirm">应用</button>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
|
|
@ -319,8 +323,8 @@ Wireguard Clients
|
|||
$(`${elementID} option`).remove();
|
||||
$(elementID).append(
|
||||
$("<option></option>")
|
||||
.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(
|
||||
$("<option></option>")
|
||||
.text("All")
|
||||
.val("All"),
|
||||
$("<option></option>")
|
||||
.text("Enabled")
|
||||
.val("Enabled"),
|
||||
$("<option></option>")
|
||||
.text("Disabled")
|
||||
.val("Disabled"),
|
||||
$("<option></option>")
|
||||
.text("Connected")
|
||||
.val("Connected"),
|
||||
$("<option></option>")
|
||||
.text("Disconnected")
|
||||
.val("Disconnected")
|
||||
);
|
||||
$("#status-selector").append(
|
||||
$("<option></option>")
|
||||
.text("全部")
|
||||
.val("All"),
|
||||
$("<option></option>")
|
||||
.text("已启用")
|
||||
.val("Enabled"),
|
||||
$("<option></option>")
|
||||
.text("已禁用")
|
||||
.val("Disabled"),
|
||||
$("<option></option>")
|
||||
.text("已连接")
|
||||
.val("Connected"),
|
||||
$("<option></option>")
|
||||
.text("未连接")
|
||||
.val("Disconnected")
|
||||
);
|
||||
}
|
||||
$.each(data, function(index, item) {
|
||||
$("#status-selector").append(
|
||||
$("<option></option>")
|
||||
|
|
@ -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');
|
||||
|
|
|
|||
|
|
@ -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
|
|||
<div class="col-md-6">
|
||||
<div class="card card-success">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">Wireguard Global Settings</h3>
|
||||
</div>
|
||||
<h3 class="card-title">WireGuard 全局设置</h3>
|
||||
} </div>
|
||||
<!-- /.card-header -->
|
||||
<!-- form start -->
|
||||
<form role="form" id="frm_global_settings" name="frm_global_settings">
|
||||
<div class="card-body">
|
||||
<div class="form-group">
|
||||
<label for="endpoint_address">Endpoint Address</label>
|
||||
<div class="input-group input-group">
|
||||
<input type="text" class="form-control" id="endpoint_address" name="endpoint_address" placeholder="Endpoint Address"
|
||||
value="{{ .globalSettings.EndpointAddress }}">
|
||||
<label for="endpoint_address">端点地址</label>
|
||||
} <div class="input-group input-group">
|
||||
<input type="text" class="form-control" id="endpoint_address" name="endpoint_address" placeholder="端点地址"
|
||||
} value="{{ .globalSettings.EndpointAddress }}">
|
||||
<span class="input-group-append">
|
||||
<button type="button" class="btn btn-success btn-flat" data-toggle="modal"
|
||||
data-target="#modal_endpoint_address_suggestion"><i
|
||||
class="nav-icon fas fa-magic"></i> Suggest</button>
|
||||
</span>
|
||||
class="nav-icon fas fa-magic"></i> 建议</button>
|
||||
} </span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="dns_servers" class="control-label">DNS Servers</label>
|
||||
<input type="text" data-role="tagsinput" class="form-control" id="dns_servers" value="">
|
||||
<label for="dns_servers" class="control-label">DNS 服务器</label>
|
||||
} <input type="text" data-role="tagsinput" class="form-control" id="dns_servers" value="">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="mtu">MTU</label>
|
||||
<input type="text" class="form-control" id="mtu" name="mtu" placeholder="MTU"
|
||||
<label for="mtu">MTU(最大传输单元)</label>
|
||||
} <input type="text" class="form-control" id="mtu" name="mtu" placeholder="MTU"
|
||||
value="{{if .globalSettings.MTU}}{{ .globalSettings.MTU }}{{end}}">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="persistent_keepalive">Persistent Keepalive</label>
|
||||
<input type="text" class="form-control" id="persistent_keepalive"
|
||||
<label for="persistent_keepalive">持久 Keepalive</label>
|
||||
} <input type="text" class="form-control" id="persistent_keepalive"
|
||||
name="persistent_keepalive" placeholder="Persistent Keepalive"
|
||||
value="{{if .globalSettings.PersistentKeepalive }}{{ .globalSettings.PersistentKeepalive }}{{end}}">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="firewall_mark">Firewall Mark</label>
|
||||
<input type="text" class="form-control" id="firewall_mark"
|
||||
<label for="firewall_mark">防火墙标记</label>
|
||||
} <input type="text" class="form-control" id="firewall_mark"
|
||||
name="firewall_mark" placeholder="Firewall Mark"
|
||||
value="{{ .globalSettings.FirewallMark }}">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="Table">Table</label>
|
||||
<input type="text" class="form-control" id="table"
|
||||
<label for="Table">路由表(Table)</label>
|
||||
} <input type="text" class="form-control" id="table"
|
||||
name="table" placeholder="auto"
|
||||
value="{{ .globalSettings.Table }}">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="config_file_path">Wireguard Config File Path</label>
|
||||
<input type="text" class="form-control" id="config_file_path"
|
||||
name="config_file_path" placeholder="E.g. /etc/wireguard/wg0.conf"
|
||||
<label for="config_file_path">WireGuard 配置文件路径</label>
|
||||
} <input type="text" class="form-control" id="config_file_path"
|
||||
name="config_file_path" placeholder="例如 /etc/wireguard/wg0.conf"
|
||||
}
|
||||
value="{{ .globalSettings.ConfigFilePath }}">
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.card-body -->
|
||||
|
||||
<div class="card-footer">
|
||||
<button type="submit" class="btn btn-success">Save</button>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-success">保存</button>
|
||||
} </div>
|
||||
</form>
|
||||
</div>
|
||||
<!-- /.card -->
|
||||
|
|
@ -86,34 +87,28 @@ Global Settings
|
|||
<div class="col-md-6">
|
||||
<div class="card card-success">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">Help</h3>
|
||||
</div>
|
||||
<h3 class="card-title">使用说明</h3>
|
||||
} </div>
|
||||
<!-- /.card-header -->
|
||||
<div class="card-body">
|
||||
<dl>
|
||||
<dt>1. Endpoint Address</dt>
|
||||
<dd>The public IP address of your Wireguard server that the client will connect to. Click on
|
||||
<strong>Suggest</strong> button to auto detect the public IP address of your server.</dd>
|
||||
<dt>2. DNS Servers</dt>
|
||||
<dd>The DNS servers will be set to client config.</dd>
|
||||
<dt>3. MTU</dt>
|
||||
<dd>The MTU will be set to server and client config. By default it is <code>1450</code>. You might want
|
||||
to adjust the MTU size if your connection (e.g PPPoE, 3G, satellite network, etc) has a low MTU.</dd>
|
||||
<dd>Leave blank to omit this setting in the configs.</dd>
|
||||
<dt>4. Persistent Keepalive</dt>
|
||||
<dd>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 <code>PersistentKeepalive</code>
|
||||
can ensure that the connection remains open.</dd>
|
||||
<dd>Leave blank to omit this setting in the Client config.</dd>
|
||||
<dt>5. Firewall Mark</dt>
|
||||
<dd>Add a matching <code>fwmark</code> on all packets going out of a WireGuard non-default-route tunnel. Default value: <code>0xca6c</code></dd>
|
||||
<dt>6. Table</dt>
|
||||
<dd>Value for the <code>Table</code> setting in the wg conf file. Default value: <code>auto</code></dd>
|
||||
<dt>7. Wireguard Config File Path</dt>
|
||||
<dd>The path of your Wireguard server config file. Please make sure the parent directory
|
||||
exists and is writable.</dd>
|
||||
</dl>
|
||||
<dt>1. 端点地址</dt>
|
||||
} <dd>客户端将连接到的 WireGuard 服务器公网 IP。点击 <strong>建议</strong> 按钮可自动检测服务器公网地址。</dd>
|
||||
} <dt>2. DNS 服务器</dt>
|
||||
} <dd>这些 DNS 服务器将写入客户端配置。</dd>
|
||||
} <dt>3. MTU</dt>
|
||||
<dd>MTU 会应用到服务器和客户端配置,默认值为 <code>1450</code>。若连接(例如 PPPoE、3G、卫星网络等)MTU 较小,可在此调整。</dd>
|
||||
<dd>留空则在配置中忽略此设置。</dd>
|
||||
} <dt>4. 持久 Keepalive</dt>
|
||||
} <dd>默认情况下,当 WireGuard 节点无需通信时会保持静默,如果节点位于 NAT 或防火墙之后,可能无法被其他节点主动访问,除非先发起请求。设置 <code>PersistentKeepalive</code> 可确保连接保持畅通。</dd>
|
||||
<dd>留空则在客户端配置中忽略此项。</dd>
|
||||
} <dt>5. 防火墙标记</dt>
|
||||
<dd>为 WireGuard 非默认路由通道发出的所有数据包添加匹配的 <code>fwmark</code>。默认值:<code>0xca6c</code></dd>
|
||||
} <dt>6. 路由表(Table)</dt>
|
||||
<dd>wg 配置文件中 <code>Table</code> 选项的值。默认值:<code>auto</code></dd>
|
||||
<dt>7. WireGuard 配置文件路径</dt>
|
||||
<dd>WireGuard 服务器配置文件路径,请确保父目录存在且可写。</dd>
|
||||
} </dl>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.card -->
|
||||
|
|
@ -127,21 +122,21 @@ Global Settings
|
|||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title">Endpoint Address Suggestion</h4>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<h4 class="modal-title">端点地址建议</h4>
|
||||
} <button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<p>Following is the list of public and local IP addresses for your consideration.</p>
|
||||
<select id="ip_suggestion" class="select2"
|
||||
data-placeholder="Select an IP address" style="width: 100%;">
|
||||
</select>
|
||||
<p>以下列出可供选择的公网与本地 IP 地址。</p>
|
||||
} <select id="ip_suggestion" class="select2"
|
||||
data-placeholder="请选择 IP 地址" style="width: 100%;">
|
||||
} </select>
|
||||
</div>
|
||||
<div class="modal-footer justify-content-between">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
|
||||
<button type="button" class="btn btn-success" id="btn_use_ip" disabled>Use selected IP address</button>
|
||||
</div>
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
||||
} <button type="button" class="btn btn-success" id="btn_use_ip" disabled>使用所选 IP 地址</button>
|
||||
} </div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<title>WireGuard UI</title>
|
||||
<title>WireGuard UI 管理台</title>
|
||||
<!-- Tell the browser to be responsive to screen width -->
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<!-- Favicon -->
|
||||
|
|
@ -25,15 +25,15 @@
|
|||
<body class="hold-transition login-page">
|
||||
<div class="login-box">
|
||||
<div class="login-logo">
|
||||
<a href="https://github.com/ngoduykhanh/wireguard-ui">WireGuard UI</a>
|
||||
<a href="https://github.com/ngoduykhanh/wireguard-ui">WireGuard UI 管理台</a>
|
||||
</div>
|
||||
<!-- /.login-logo -->
|
||||
<div class="card">
|
||||
<div class="card-body login-card-body">
|
||||
<p class="login-box-msg">Sign in to start your session</p>
|
||||
<p class="login-box-msg">登录以开始使用</p>
|
||||
<form action="" method="post">
|
||||
<div class="input-group mb-3">
|
||||
<input id="username" type="text" class="form-control" placeholder="Username">
|
||||
<input id="username" type="text" class="form-control" placeholder="用户名">
|
||||
<div class="input-group-append">
|
||||
<div class="input-group-text">
|
||||
<span class="fas fa-envelope"></span>
|
||||
|
|
@ -41,7 +41,7 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class="input-group mb-3">
|
||||
<input id="password" type="password" class="form-control" placeholder="Password">
|
||||
<input id="password" type="password" class="form-control" placeholder="密码">
|
||||
<div class="input-group-append">
|
||||
<div class="input-group-text">
|
||||
<span class="fas fa-lock"></span>
|
||||
|
|
@ -53,13 +53,13 @@
|
|||
<div class="icheck-primary">
|
||||
<input type="checkbox" id="remember">
|
||||
<label for="remember">
|
||||
Remember Me
|
||||
记住我
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.col -->
|
||||
<div class="col-4">
|
||||
<button id="btn_login" type="submit" class="btn btn-primary btn-block">Sign In</button>
|
||||
<button id="btn_login" type="submit" class="btn btn-primary btn-block">登录</button>
|
||||
</div>
|
||||
<!-- /.col -->
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
{{ define "title"}}
|
||||
Profile
|
||||
个人资料
|
||||
{{ end }}
|
||||
|
||||
{{ define "top_css"}}
|
||||
|
|
@ -10,7 +10,7 @@ Profile
|
|||
{{ end }}
|
||||
|
||||
{{ define "page_title"}}
|
||||
Profile
|
||||
个人资料
|
||||
{{ end }}
|
||||
|
||||
{{ define "page_content"}}
|
||||
|
|
@ -22,25 +22,25 @@ Profile
|
|||
<div class="col-md-6">
|
||||
<div class="card card-success">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">Update user information</h3>
|
||||
</div>
|
||||
<h3 class="card-title">更新用户信息</h3>
|
||||
} </div>
|
||||
<!-- /.card-header -->
|
||||
<!-- form start -->
|
||||
<form role="form" id="frm_profile" name="frm_profile">
|
||||
<div class="card-body">
|
||||
<div class="form-group">
|
||||
<label for="username" class="control-label">Username</label>
|
||||
<input type="text" class="form-control" name="username" id="username"
|
||||
<label for="username" class="control-label">用户名</label>
|
||||
} <input type="text" class="form-control" name="username" id="username"
|
||||
value="">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="password" class="control-label">Password</label>
|
||||
<label for="password" class="control-label">密码</label>
|
||||
<input type="password" class="form-control" name="password" id="password"
|
||||
value="" placeholder="Leave empty to keep the password unchanged">
|
||||
value="" placeholder="留空则不修改密码">
|
||||
</div>
|
||||
<!-- /.card-body -->
|
||||
<div class="card-footer">
|
||||
<button type="submit" class="btn btn-success" id="update">Update</button>
|
||||
<button type="submit" class="btn btn-success" id="update">更新</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
|
@ -92,8 +92,8 @@ Profile
|
|||
contentType: "application/json",
|
||||
data: JSON.stringify(data),
|
||||
success: function (data) {
|
||||
toastr.success("Updated user information successfully");
|
||||
location.reload();
|
||||
toastr.success("已成功更新用户信息");
|
||||
} location.reload();
|
||||
},
|
||||
error: function (jqXHR, exception) {
|
||||
const responseJson = jQuery.parseJSON(jqXHR.responseText);
|
||||
|
|
@ -116,8 +116,8 @@ Profile
|
|||
},
|
||||
messages: {
|
||||
username: {
|
||||
required: "Please enter a username",
|
||||
}
|
||||
required: "请输入用户名",
|
||||
} }
|
||||
},
|
||||
errorElement: 'span',
|
||||
errorPlacement: function (error, element) {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
{{define "title"}}
|
||||
Wireguard Server
|
||||
WireGuard 服务器
|
||||
{{end}}
|
||||
|
||||
{{define "top_css"}}
|
||||
|
|
@ -10,7 +10,7 @@ Wireguard Server
|
|||
{{end}}
|
||||
|
||||
{{define "page_title"}}
|
||||
Wireguard Server Settings
|
||||
WireGuard 服务器设置
|
||||
{{end}}
|
||||
|
||||
{{define "page_content"}}
|
||||
|
|
@ -22,42 +22,42 @@ Wireguard Server Settings
|
|||
<div class="col-md-6">
|
||||
<div class="card card-success">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">Interface</h3>
|
||||
</div>
|
||||
<h3 class="card-title">接口</h3>
|
||||
} </div>
|
||||
<!-- /.card-header -->
|
||||
<!-- form start -->
|
||||
<form role="form" id="frm_server_interface" name="frm_server_interface">
|
||||
<div class="card-body">
|
||||
<div class="form-group">
|
||||
<label for="addresses" class="control-label">Server Interface Addresses</label>
|
||||
<label for="addresses" class="control-label">服务器接口地址</label>
|
||||
<input type="text" data-role="tagsinput" class="form-control" id="addresses" value="">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="listen_port">Listen Port</label>
|
||||
<input type="text" class="form-control" id="listen_port" name="listen_port"
|
||||
placeholder="Listen Port" value="{{ .serverInterface.ListenPort }}">
|
||||
<label for="listen_port">监听端口</label>
|
||||
} <input type="text" class="form-control" id="listen_port" name="listen_port"
|
||||
placeholder="监听端口" value="{{ .serverInterface.ListenPort }}">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="post_up">Post Up Script</label>
|
||||
<input type="text" class="form-control" id="post_up" name="post_up"
|
||||
<label for="post_up">Post Up 脚本</label>
|
||||
} <input type="text" class="form-control" id="post_up" name="post_up"
|
||||
placeholder="Post Up Script" value="{{ .serverInterface.PostUp }}">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="pre_down">Pre Down Script</label>
|
||||
<label for="pre_down">Pre Down 脚本</label>
|
||||
<input type="text" class="form-control" id="pre_down" name="pre_down"
|
||||
placeholder="Pre Down Script" value="{{ .serverInterface.PreDown }}">
|
||||
placeholder="Pre Down 脚本" value="{{ .serverInterface.PreDown }}">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="post_down">Post Down Script</label>
|
||||
<label for="post_down">Post Down 脚本</label>
|
||||
<input type="text" class="form-control" id="post_down" name="post_down"
|
||||
placeholder="Post Down Script" value="{{ .serverInterface.PostDown }}">
|
||||
placeholder="Post Down 脚本" value="{{ .serverInterface.PostDown }}">
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.card-body -->
|
||||
|
||||
<div class="card-footer">
|
||||
<button type="submit" class="btn btn-success">Save</button>
|
||||
<button type="submit" class="btn btn-success">保存</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
|
@ -67,26 +67,28 @@ Wireguard Server Settings
|
|||
<div class="col-md-6">
|
||||
<div class="card card-danger">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">Key Pair</h3>
|
||||
</div>
|
||||
<h3 class="card-title">密钥对</h3>
|
||||
} </div>
|
||||
<!-- /.card-header -->
|
||||
<!-- form start -->
|
||||
<form role="form">
|
||||
<div class="card-body">
|
||||
<div class="form-group">
|
||||
<label for="private_key">Private Key</label>
|
||||
<label for="private_key">私钥</label>
|
||||
<div class="input-group input-group">
|
||||
<input type="password" class="form-control" id="private_key" placeholder="Private Key"
|
||||
<input type="password" class="form-control" id="private_key" placeholder="私钥"
|
||||
value="{{ .serverKeyPair.PrivateKey }}" disabled>
|
||||
|
||||
<span class="input-group-append">
|
||||
<button type="button" class="btn btn-danger btn-flat"
|
||||
id="btn_show_private_key">Show</button>
|
||||
<button type="button" class="btn btn-danger btn-flat"
|
||||
id="btn_show_private_key">显示</button>
|
||||
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="public_key">Public Key</label>
|
||||
<input type="text" class="form-control" id="public_key" placeholder="Public Key"
|
||||
<label for="public_key">公钥</label>
|
||||
<input type="text" class="form-control" id="public_key" placeholder="公钥"
|
||||
value="{{ .serverKeyPair.PublicKey }}" disabled>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -94,7 +96,7 @@ Wireguard Server Settings
|
|||
|
||||
<div class="card-footer">
|
||||
<button type="button" class="btn btn-danger" data-toggle="modal"
|
||||
data-target="#modal_keypair_confirmation">Generate</button>
|
||||
data-target="#modal_keypair_confirmation">生成</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
|
@ -109,18 +111,18 @@ Wireguard Server Settings
|
|||
<div class="modal-dialog">
|
||||
<div class="modal-content bg-warning">
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title">KeyPair Generation</h4>
|
||||
<h4 class="modal-title">密钥对生成</h4>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<p>Are you sure to generate a new key pair for the Wireguard server?<br/>
|
||||
The existing Client's peer public key need to be updated to keep the connection working.</p>
|
||||
<p>确定要为 WireGuard 服务器生成新的密钥对吗?<br/>
|
||||
现有客户端对应的公钥需要更新才能保持连接正常。</p>
|
||||
</div>
|
||||
<div class="modal-footer justify-content-between">
|
||||
<button type="button" class="btn btn-outline-dark" data-dismiss="modal">Cancel</button>
|
||||
<button type="button" class="btn btn-outline-dark" id="btn_generate_confirm">Generate</button>
|
||||
<button type="button" class="btn btn-outline-dark" data-dismiss="modal">取消</button>
|
||||
<button type="button" class="btn btn-outline-dark" id="btn_generate_confirm">生成</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
|
|
@ -149,7 +151,7 @@ Wireguard Server Settings
|
|||
data: JSON.stringify(data),
|
||||
success: function(data) {
|
||||
$("#modal_new_client").modal('hide');
|
||||
toastr.success('Updated Wireguard server interface addresses successfully');
|
||||
toastr.success('已成功更新 WireGuard 服务器接口地址');
|
||||
},
|
||||
error: function(jqXHR, exception) {
|
||||
const responseJson = jQuery.parseJSON(jqXHR.responseText);
|
||||
|
|
@ -164,8 +166,8 @@ Wireguard Server Settings
|
|||
'width': '100%',
|
||||
// 'height': '75%',
|
||||
'interactive': true,
|
||||
'defaultText': 'Add More',
|
||||
'removeWithBackspace': true,
|
||||
'defaultText': '添加更多',
|
||||
} 'removeWithBackspace': true,
|
||||
'minChars': 0,
|
||||
'minInputWidth': '100%',
|
||||
'placeholderColor': '#666666'
|
||||
|
|
@ -194,9 +196,9 @@ Wireguard Server Settings
|
|||
},
|
||||
messages: {
|
||||
listen_port: {
|
||||
required: "Please enter a port",
|
||||
digits: "Port must be an integer",
|
||||
range: "Port must be in range 1..65535"
|
||||
required: "请输入端口",
|
||||
digits: "端口必须是整数",
|
||||
range: "端口范围需在 1..65535 之间"
|
||||
}
|
||||
},
|
||||
errorElement: 'span',
|
||||
|
|
@ -224,8 +226,8 @@ Wireguard Server Settings
|
|||
contentType: "application/json",
|
||||
success: function(data) {
|
||||
$("#modal_keypair_confirmation").modal('hide');
|
||||
toastr.success('Generate new key pair successfully');
|
||||
// update the UI
|
||||
toastr.success('已成功生成新的密钥对');
|
||||
} // update the UI
|
||||
$("#private_key").val(data['private_key']);
|
||||
$("#public_key").val(data['public_key']);
|
||||
},
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
{{define "title"}}
|
||||
Connected Peers
|
||||
已连接的节点
|
||||
{{end}}
|
||||
|
||||
{{define "top_css"}}
|
||||
|
|
@ -10,7 +10,7 @@ Connected Peers
|
|||
{{end}}
|
||||
|
||||
{{define "page_title"}}
|
||||
Connected Peers
|
||||
已连接的节点
|
||||
{{end}}
|
||||
|
||||
{{define "page_content"}}
|
||||
|
|
@ -35,7 +35,7 @@ Connected Peers
|
|||
{{ end}}
|
||||
{{ range $dev := .devices }}
|
||||
<table class="table table-sm">
|
||||
<caption>List of connected peers for device with name {{ $dev.Name }} </caption>
|
||||
<caption>设备 {{ $dev.Name }} 的已连接节点列表</caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">#</th>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
{{define "title"}}
|
||||
Users Settings
|
||||
用户设置
|
||||
{{end}}
|
||||
|
||||
{{define "top_css"}}
|
||||
|
|
@ -10,7 +10,7 @@ Users Settings
|
|||
{{end}}
|
||||
|
||||
{{define "page_title"}}
|
||||
Users Settings
|
||||
用户设置
|
||||
{{end}}
|
||||
|
||||
{{define "page_content"}}
|
||||
|
|
@ -25,8 +25,8 @@ Users Settings
|
|||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title">Edit User</h4>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<h4 class="modal-title">编辑用户</h4>
|
||||
} <button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
|
|
@ -37,27 +37,27 @@ Users Settings
|
|||
name="_previous_user_name">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="_user_name" class="control-label">Name</label>
|
||||
<input type="text" class="form-control" id="_user_name" name="_user_name">
|
||||
<label for="_user_name" class="control-label">名称</label>
|
||||
} <input type="text" class="form-control" id="_user_name" name="_user_name">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="_user_password" class="control-label">Password</label>
|
||||
<label for="_user_password" class="control-label">密码</label>
|
||||
<input type="password" class="form-control" id="_user_password" name="_user_password" value=""
|
||||
placeholder="Leave empty to keep the password unchanged">
|
||||
placeholder="留空则不修改密码">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="icheck-primary d-inline">
|
||||
<input type="checkbox" id="_admin">
|
||||
<label for="_admin">
|
||||
Admin
|
||||
管理员
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="modal-footer justify-content-between">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
|
||||
<button type="submit" class="btn btn-success">Save</button>
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
|
||||
<button type="submit" class="btn btn-success">保存</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
|
@ -71,17 +71,18 @@ Users Settings
|
|||
<div class="modal-dialog">
|
||||
<div class="modal-content bg-danger">
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title">Remove</h4>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<h4 class="modal-title">删除</h4>
|
||||
} <button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
</div>
|
||||
<div class="modal-footer justify-content-between">
|
||||
<button type="button" class="btn btn-outline-dark" data-dismiss="modal">Cancel</button>
|
||||
<button type="button" class="btn btn-outline-dark" id="remove_user_confirm">Apply</button>
|
||||
</div>
|
||||
<div class="modal-footer justify-content-between">
|
||||
<button type="button" class="btn btn-outline-dark" data-dismiss="modal">取消</button>
|
||||
<button type="button" class="btn btn-outline-dark" id="remove_user_confirm">应用</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
|
|
@ -116,8 +117,8 @@ Users Settings
|
|||
let newUserHtml = '<div class="col-sm-2 offset-md-4" style=" text-align: right;">' +
|
||||
'<button style="" id="btn_new_user" type="button" class="btn btn-outline-primary btn-sm" ' +
|
||||
'data-toggle="modal" data-target="#modal_edit_user" data-username="">' +
|
||||
'<i class="nav-icon fas fa-plus"></i> New User</button></div>';
|
||||
$('h1').parents(".row").append(newUserHtml);
|
||||
'<i class="nav-icon fas fa-plus"></i> 新建用户</button></div>';
|
||||
} $('h1').parents(".row").append(newUserHtml);
|
||||
})
|
||||
|
||||
// modal_remove_user modal event
|
||||
|
|
@ -125,8 +126,8 @@ Users Settings
|
|||
const button = $(event.relatedTarget);
|
||||
const user_name = button.data('username');
|
||||
const modal = $(this);
|
||||
modal.find('.modal-body').text("You are about to remove user " + user_name);
|
||||
modal.find('#remove_user_confirm').val(user_name);
|
||||
modal.find('.modal-body').text("你将删除用户 " + user_name);
|
||||
} modal.find('#remove_user_confirm').val(user_name);
|
||||
})
|
||||
|
||||
// remove_user_confirm button event
|
||||
|
|
@ -143,11 +144,12 @@ Users Settings
|
|||
data: JSON.stringify(data),
|
||||
success: function (data) {
|
||||
$("#modal_remove_user").modal('hide');
|
||||
toastr.success('Removed user successfully');
|
||||
toastr.success('已成功删除用户');
|
||||
const divElement = document.getElementById('user_' + user_name);
|
||||
divElement.style.display = "none";
|
||||
location.reload()
|
||||
},
|
||||
|
||||
error: function (jqXHR, exception) {
|
||||
const responseJson = jQuery.parseJSON(jqXHR.responseText);
|
||||
toastr.error(responseJson['message']);
|
||||
|
|
@ -174,12 +176,12 @@ Users Settings
|
|||
success: function (resp) {
|
||||
const user = resp;
|
||||
|
||||
modal.find(".modal-title").text("Edit user " + user.username);
|
||||
modal.find("#_user_name").val(user.username);
|
||||
modal.find(".modal-title").text("编辑用户 " + user.username);
|
||||
} modal.find("#_user_name").val(user.username);
|
||||
modal.find("#_previous_user_name").val(user.username);
|
||||
modal.find("#_user_password").val("");
|
||||
modal.find("#_user_password").prop("placeholder", "Leave empty to keep the password unchanged")
|
||||
modal.find("#_admin").prop("checked", user.admin);
|
||||
modal.find("#_user_password").prop("placeholder", "留空则不修改密码")
|
||||
} modal.find("#_admin").prop("checked", user.admin);
|
||||
},
|
||||
error: function (jqXHR, exception) {
|
||||
const responseJson = jQuery.parseJSON(jqXHR.responseText);
|
||||
|
|
@ -187,7 +189,7 @@ Users Settings
|
|||
}
|
||||
});
|
||||
} else {
|
||||
modal.find(".modal-title").text("Add new user");
|
||||
modal.find(".modal-title").text("新增用户");
|
||||
modal.find("#_user_name").val("");
|
||||
modal.find("#_previous_user_name").val("");
|
||||
modal.find("#_user_password").val("");
|
||||
|
|
@ -221,7 +223,7 @@ Users Settings
|
|||
contentType: "application/json",
|
||||
data: JSON.stringify(data),
|
||||
success: function (data) {
|
||||
toastr.success("Updated user information successfully");
|
||||
toastr.success("已成功更新用户信息");
|
||||
location.reload();
|
||||
},
|
||||
error: function (jqXHR, exception) {
|
||||
|
|
@ -238,7 +240,7 @@ Users Settings
|
|||
contentType: "application/json",
|
||||
data: JSON.stringify(data),
|
||||
success: function (data) {
|
||||
toastr.success("Created user successfully");
|
||||
toastr.success("已成功创建用户");
|
||||
location.reload();
|
||||
},
|
||||
error: function (jqXHR, exception) {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
{{define "title"}}
|
||||
Wake On Lan Hosts
|
||||
局域网唤醒主机
|
||||
{{end}}
|
||||
|
||||
{{define "top_css"}}
|
||||
|
|
@ -10,7 +10,7 @@
|
|||
{{end}}
|
||||
|
||||
{{define "page_title"}}
|
||||
Wake On Lan Hosts
|
||||
局域网唤醒主机
|
||||
{{end}}
|
||||
|
||||
{{define "page_content"}}
|
||||
|
|
@ -22,8 +22,8 @@
|
|||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title">New Wake On Lan Host</h4>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<h4 class="modal-title">新建局域网唤醒主机</h4>
|
||||
} <button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
|
|
@ -31,18 +31,18 @@
|
|||
<div class="modal-body">
|
||||
<input type="hidden" id="frm_wake_on_lan_host_old_mac_address" name="old_mac_address">
|
||||
<div class="form-group">
|
||||
<label for="frm_wake_on_lan_host_name" class="control-label">Name</label>
|
||||
<input type="text" class="form-control" id="frm_wake_on_lan_host_name" name="name">
|
||||
<label for="frm_wake_on_lan_host_name" class="control-label">名称</label>
|
||||
} <input type="text" class="form-control" id="frm_wake_on_lan_host_name" name="name">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="frm_wake_on_lan_host_mac_address" class="control-label">Mac Address</label>
|
||||
<input type="text" class="form-control" id="frm_wake_on_lan_host_mac_address"
|
||||
<label for="frm_wake_on_lan_host_mac_address" class="control-label">MAC 地址</label>
|
||||
} <input type="text" class="form-control" id="frm_wake_on_lan_host_mac_address"
|
||||
name="mac_address">
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer justify-content-between">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
|
||||
<button type="submit" class="btn btn-primary">Submit</button>
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
|
||||
<button type="submit" class="btn btn-primary">提交</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
|
@ -54,17 +54,18 @@
|
|||
<div class="modal-dialog">
|
||||
<div class="modal-content bg-danger">
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title">Remove</h4>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<h4 class="modal-title">删除</h4>
|
||||
} <button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
</div>
|
||||
<div class="modal-footer justify-content-between">
|
||||
<button type="button" class="btn btn-outline-dark" data-dismiss="modal">Cancel</button>
|
||||
<button type="button" class="btn btn-outline-dark" id="remove_wake_on_host_confirm">Apply</button>
|
||||
</div>
|
||||
<div class="modal-footer justify-content-between">
|
||||
<button type="button" class="btn btn-outline-dark" data-dismiss="modal">取消</button>
|
||||
<button type="button" class="btn btn-outline-dark" id="remove_wake_on_host_confirm">应用</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
|
|
@ -85,16 +86,16 @@
|
|||
<div class="info-box-content">
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-outline-success btn-sm"
|
||||
data-mac-address="{{ .MacAddress }}">Wake On
|
||||
data-mac-address="{{ .MacAddress }}">唤醒
|
||||
</button>
|
||||
<button type="button"
|
||||
class="btn btn-outline-primary btn-sm btn_modify_wake_on_lan_host"
|
||||
data-toggle="modal" data-target="#modal_wake_on_lan_host"
|
||||
data-name="{{ .Name }}" data-mac-address="{{ .MacAddress }}">Edit
|
||||
data-name="{{ .Name }}" data-mac-address="{{ .MacAddress }}">编辑
|
||||
</button>
|
||||
<button type="button" class="btn btn-outline-danger btn-sm" data-toggle="modal"
|
||||
data-target="#modal_remove_wake_on_lan_host"
|
||||
data-mac-address="{{ .MacAddress }}">Remove
|
||||
data-mac-address="{{ .MacAddress }}">删除
|
||||
</button>
|
||||
</div>
|
||||
<hr>
|
||||
|
|
@ -104,9 +105,10 @@
|
|||
<span class="latest-used">
|
||||
{{ if .LatestUsed }}
|
||||
{{ .LatestUsed.Format "2006-01-02T15:04:05Z07:00"}}
|
||||
{{ else }}
|
||||
Unused
|
||||
{{ end }}
|
||||
{{ else }}
|
||||
未使用
|
||||
{{ end }}
|
||||
|
||||
</span>
|
||||
</span>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Reference in New Issue