mirror of
https://github.com/ehang-io/nps.git
synced 2025-10-18 19:23:53 +00:00
hzgjq
This commit is contained in:
101
web/views/client/add.html
Executable file → Normal file
101
web/views/client/add.html
Executable file → Normal file
@@ -1,126 +1,116 @@
|
||||
<div class="row">
|
||||
<div class="col-md-12 col-md-auto">
|
||||
<div class="ibox float-e-margins">
|
||||
<h3 class="ibox-title">add client</h3>
|
||||
<h3 class="ibox-title" langtag="page-clientadd"></h3>
|
||||
<div class="ibox-content">
|
||||
<form class="form-horizontal">
|
||||
<div class="form-group" id="remark">
|
||||
<label class="col-sm-2 control-label" langtag="info-remark">备注</label>
|
||||
<label class="control-label font-bold" langtag="word-remark"></label>
|
||||
<div class="col-sm-10">
|
||||
<input class="form-control" type="text" name="remark"
|
||||
placeholder="remark">
|
||||
<input class="form-control" type="text" name="remark" placeholder="" langtag="word-remark">
|
||||
</div>
|
||||
</div>
|
||||
{{if eq true .allow_flow_limit}}
|
||||
<div class="form-group" id="flow_limit">
|
||||
<label class="col-sm-2 control-label" langtag="info-flow-limit">流量限制</label>
|
||||
<label class="control-label font-bold" langtag="word-flowlimit"></label>
|
||||
<div class="col-sm-10">
|
||||
<input class="form-control" type="text" name="flow_limit"
|
||||
placeholder="empty means to be unrestricted">
|
||||
<span class="help-block m-b-none" langtag="info-flow-limit-unit">unit: M</span>
|
||||
<input class="form-control" type="text" name="flow_limit" placeholder="" langtag="info-unrestricted">
|
||||
<span class="help-block m-b-none" langtag="word-unit"></span>: M
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
{{if eq true .allow_rate_limit}}
|
||||
<div class="form-group" id="rate_limit">
|
||||
<label class="control-label col-sm-2" langtag="info-bandwidth">带宽限制</label>
|
||||
<label class="control-label font-bold" langtag="word-ratelimit"></label>
|
||||
<div class="col-sm-10">
|
||||
<input class="form-control" type="text" name="rate_limit"
|
||||
placeholder="empty means to be unrestricted">
|
||||
<span class="help-block m-b-none" langtag="info-bandwidth-unit">unit: KB/S</span>
|
||||
<input class="form-control" type="text" name="rate_limit" placeholder="" langtag="info-unrestricted">
|
||||
<span class="help-block m-b-none" langtag="word-unit"></span>: KB/S
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
{{if eq true .allow_connection_num_limit}}
|
||||
<div class="form-group" id="max_conn">
|
||||
<label class="control-label col-sm-2" langtag="info-max-conn-num">客户端最大连接数量</label>
|
||||
<label class="control-label font-bold" langtag="word-maxconnections"></label>
|
||||
<div class="col-sm-10">
|
||||
<input class="form-control" type="text" name="max_conn"
|
||||
placeholder="empty means to be unrestricted">
|
||||
<input class="form-control" type="text" name="max_conn" placeholder="" langtag="info-unrestricted">
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
{{if eq true .allow_tunnel_num_limit}}
|
||||
<div class="form-group" id="max_tunnel">
|
||||
<label class="control-label col-sm-2" langtag="info-max-tunnel-num">客户端最大隧道数量</label>
|
||||
<label class="control-label font-bold" langtag="word-maxtunnels"></label>
|
||||
<div class="col-sm-10">
|
||||
<input class="form-control" type="text" name="max_tunnel"
|
||||
placeholder="empty means to be unrestricted">
|
||||
<input class="form-control" type="text" name="max_tunnel" placeholder="" langtag="info-unrestricted">
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
<div class="form-group" id="u">
|
||||
<label class="control-label col-sm-2" langtag="info-web-auth-username">basic权限认证用户名</label>
|
||||
<label class="control-label font-bold" langtag="word-basicusername"></label>
|
||||
<div class="col-sm-10">
|
||||
<input class="form-control" type="text" name="u"
|
||||
placeholder="empty means to be unrestricted">
|
||||
<span class="help-block m-b-none">only socks5 , web, HTTP forward proxy </span>
|
||||
<input class="form-control" type="text" name="u" placeholder="" langtag="info-unrestricted">
|
||||
<span class="help-block m-b-none" langtag="info-onlyproxy"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" id="p">
|
||||
<label class="control-label col-sm-2" langtag="info-web-auth-password">basic权限认证密码 </label>
|
||||
<label class="control-label font-bold" langtag="word-basicpassword"></label>
|
||||
<div class="col-sm-10">
|
||||
<input class="form-control" type="text" name="p"
|
||||
placeholder="empty means to be unrestricted">
|
||||
<span class="help-block m-b-none">only socks5 , web, HTTP forward proxy </span>
|
||||
<input class="form-control" type="text" name="p" placeholder="" langtag="info-unrestricted">
|
||||
<span class="help-block m-b-none" langtag="info-onlyproxy"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" id="vkey">
|
||||
<label class="control-label col-sm-2" langtag="info-client-vkey">客户端验证密钥</label>
|
||||
<label class="control-label font-bold" langtag="word-verifyKey"></label>
|
||||
<div class="col-sm-10">
|
||||
<input class="form-control" type="text" name="vkey"
|
||||
placeholder="empty means to be unrestricted">
|
||||
<span class="help-block m-b-none">unique, non-filling will be generated automatically</span>
|
||||
<input class="form-control" type="text" name="vkey" placeholder="" langtag="info-unrestricted">
|
||||
<span class="help-block m-b-none" langtag="info-autogenerated"></span>
|
||||
</div>
|
||||
</div>
|
||||
{{if eq true .allow_user_login}}
|
||||
<div class="form-group" id="web_username">
|
||||
<label class="control-label col-sm-2" langtag="info-client-web-username">web登陆用户名</label>
|
||||
<label class="control-label font-bold" langtag="word-webusername"></label>
|
||||
<div class="col-sm-10">
|
||||
<input class="form-control" type="text" name="web_username"
|
||||
placeholder="empty means to be unrestricted">
|
||||
<input class="form-control" type="text" name="web_username" placeholder="" langtag="info-unrestricted">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" id="web_password">
|
||||
<label class="control-label col-sm-2" langtag="info-client-web-password">web登陆密码</label>
|
||||
<label class="control-label font-bold" langtag="word-webpassword"></label>
|
||||
<div class="col-sm-10">
|
||||
<input class="form-control" type="text" name="web_password"
|
||||
placeholder="empty means to be unrestricted">
|
||||
<input class="form-control" type="text" name="web_password" placeholder="" langtag="info-unrestricted">
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
<div class="form-group" id="config_conn_allow">
|
||||
<label class="control-label col-sm-2" langtag="info-config-conn-allow">是否允许客户端以配置文件模式连接</label>
|
||||
<label class="control-label font-bold" langtag="word-connectbyconfig"></label>
|
||||
<div class="col-sm-10">
|
||||
<select class="form-control" name="config_conn_allow">
|
||||
<option value="1">yes</option>
|
||||
<option value="0">no</option>
|
||||
<option value="1" langtag="word-yes"></option>
|
||||
<option value="0" langtag="word-no"></option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" id="compress">
|
||||
<label class="control-label col-sm-2" langtag="info-compress">压缩</label>
|
||||
<label class="control-label font-bold" langtag="word-compress"></label>
|
||||
<div class="col-sm-10">
|
||||
<select class="form-control" name="compress">
|
||||
<option value="0">no</option>
|
||||
<option value="1">yes</option>
|
||||
<option value="0" langtag="word-no"></option>
|
||||
<option value="1" langtag="word-yes"></option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" id="compress">
|
||||
<label class="control-label col-sm-2" langtag="info-crypt">加密</label>
|
||||
<label class="control-label font-bold" langtag="word-crypt"></label>
|
||||
<div class="col-sm-10">
|
||||
<select class="form-control" name="crypt">
|
||||
<option value="0">no</option>
|
||||
<option value="1">yes</option>
|
||||
<option value="0" langtag="word-no"></option>
|
||||
<option value="1" langtag="word-yes"></option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hr-line-dashed"></div>
|
||||
<div class="form-group">
|
||||
<div class="col-sm-4 col-sm-offset-2">
|
||||
<button class="btn btn-success" type="button" id="add"><i
|
||||
class="fa fa-fw fa-lg fa-eye"></i>新增
|
||||
<button class="btn btn-success" type="button" onclick="submitform('add', '{{.web_base_url}}/client/add', $('form').serializeArray())">
|
||||
<i class="fa fa-fw fa-lg fa-check-circle"></i> <span langtag="word-add"></span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -129,20 +119,3 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$(function () {
|
||||
$("#add").on("click", function () {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "{{.web_base_url}}/client/add",
|
||||
data: $("form").serializeArray(),
|
||||
success: function (res) {
|
||||
alert(res.msg)
|
||||
if (res.status) {
|
||||
history.back(-1)
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
})
|
||||
</script>
|
103
web/views/client/edit.html
Executable file → Normal file
103
web/views/client/edit.html
Executable file → Normal file
@@ -1,135 +1,125 @@
|
||||
<div class="row">
|
||||
<div class="col-md-12 col-md-auto">
|
||||
<div class="ibox float-e-margins">
|
||||
<h3 class="ibox-title">add client</h3>
|
||||
<h3 class="ibox-title" langtag="page-clientedit"></h3>
|
||||
<div class="ibox-content">
|
||||
<form class="form-horizontal">
|
||||
<input type="hidden" name="id" value="{{.c.Id}}">
|
||||
<div class="form-group" id="remark">
|
||||
<label class="col-sm-2 control-label" langtag="info-remark">备注</label>
|
||||
<label class="control-label font-bold" langtag="word-remark"></label>
|
||||
<div class="col-sm-10">
|
||||
<input class="form-control" value="{{.c.Remark}}" type="text" name="remark"
|
||||
placeholder="remark">
|
||||
<input class="form-control" value="{{.c.Remark}}" type="text" name="remark" placeholder="" langtag="word-remark">
|
||||
</div>
|
||||
</div>
|
||||
{{if eq true .isAdmin}}
|
||||
{{if eq true .allow_flow_limit}}
|
||||
<div class="form-group" id="flow_limit">
|
||||
<label class="col-sm-2 control-label" langtag="info-flow-limit">流量限制</label>
|
||||
<label class="control-label font-bold" langtag="word-flowlimit"></label>
|
||||
<div class="col-sm-10">
|
||||
<input class="form-control" value="{{.c.Flow.FlowLimit}}" type="text" name="flow_limit"
|
||||
placeholder="empty means to be unrestricted">
|
||||
<span class="help-block m-b-none">unit: M</span>
|
||||
<input class="form-control" value="{{.c.Flow.FlowLimit}}" type="text" name="flow_limit" placeholder="" langtag="info-unrestricted">
|
||||
<span class="help-block m-b-none" langtag="word-unit"></span>: M
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
{{if eq true .allow_rate_limit}}
|
||||
|
||||
<div class="form-group" id="rate_limit">
|
||||
<label class="control-label col-sm-2" langtag="info-bandwidth">带宽限制</label>
|
||||
<label class="control-label font-bold" langtag="word-ratelimit"></label>
|
||||
<div class="col-sm-10">
|
||||
<input class="form-control" value="{{.c.RateLimit}}" type="text" name="rate_limit"
|
||||
placeholder="empty means to be unrestricted">
|
||||
<span class="help-block m-b-none">unit: KB/S</span>
|
||||
<input class="form-control" value="{{.c.RateLimit}}" type="text" name="rate_limit" placeholder="" langtag="info-unrestricted">
|
||||
<span class="help-block m-b-none" langtag="word-unit"></span>: KB/S
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
{{if eq true .allow_connection_num_limit}}
|
||||
|
||||
<div class="form-group" id="max_conn">
|
||||
<label class="control-label col-sm-2" langtag="info-max-conn-num">客户端最大连接数</label>
|
||||
<label class="control-label font-bold" langtag="word-maxconnections"></label>
|
||||
<div class="col-sm-10">
|
||||
<input class="form-control" value="{{.c.MaxConn}}" type="text" name="max_conn"
|
||||
placeholder="empty means to be unrestricted">
|
||||
<input class="form-control" value="{{.c.MaxConn}}" type="text" name="max_conn" placeholder="" langtag="info-unrestricted">
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
{{if eq true .allow_tunnel_num_limit}}
|
||||
<div class="form-group" id="max_tunnel">
|
||||
<label class="control-label col-sm-2" langtag="info-max-tunnel-num">客户端最大隧道数量</label>
|
||||
<label class="control-label font-bold" langtag="word-maxtunnels"></label>
|
||||
<div class="col-sm-10">
|
||||
<input class="form-control" value="{{.c.MaxTunnelNum}}" type="text" name="max_tunnel"
|
||||
placeholder="empty means to be unrestricted">
|
||||
<input class="form-control" value="{{.c.MaxTunnelNum}}" type="text" name="max_tunnel" placeholder="" langtag="info-unrestricted">
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
{{end}}
|
||||
<div class="form-group" id="u">
|
||||
<label class="control-label col-sm-2" langtag="info-web-auth-username">basic权限认证用户名</label>
|
||||
<label class="control-label font-bold" langtag="word-basicusername"></label>
|
||||
<div class="col-sm-10">
|
||||
<input class="form-control" value="{{.c.Cnf.U}}" type="text" name="u"
|
||||
placeholder="empty means to be unrestricted">
|
||||
<span class="help-block m-b-none">only socks5 , web, HTTP forward proxy </span>
|
||||
<input class="form-control" value="{{.c.Cnf.U}}" type="text" name="u" placeholder="" langtag="info-unrestricted">
|
||||
<span class="help-block m-b-none" langtag="info-onlyproxy"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" id="p">
|
||||
<label class="control-label col-sm-2" langtag="info-web-auth-password">basic权限认证密码 </label>
|
||||
<label class="control-label font-bold" langtag="word-basicpassword"></label>
|
||||
<div class="col-sm-10">
|
||||
<input class="form-control" value="{{.c.Cnf.P}}" type="text" name="p"
|
||||
placeholder="empty means to be unrestricted">
|
||||
<span class="help-block m-b-none">only socks5 , web, HTTP forward proxy </span>
|
||||
<input class="form-control" value="{{.c.Cnf.P}}" type="text" name="p" placeholder="" langtag="info-unrestricted">
|
||||
<span class="help-block m-b-none" langtag="info-onlyproxy"></span>
|
||||
</div>
|
||||
</div>
|
||||
{{if eq true .isAdmin}}
|
||||
<div class="form-group" id="vkey">
|
||||
<label class="control-label col-sm-2" langtag="info-client-vkey">客户端验证密钥</label>
|
||||
<label class="control-label font-bold" langtag="word-verifyKey"></label>
|
||||
<div class="col-sm-10">
|
||||
<input class="form-control" value="{{.c.VerifyKey}}" type="text" name="vkey"
|
||||
placeholder="empty means to be unrestricted">
|
||||
<span class="help-block m-b-none">unique, non-filling will be generated automatically</span>
|
||||
<input class="form-control" value="{{.c.VerifyKey}}" type="text" name="vkey" placeholder="" langtag="info-unrestricted">
|
||||
<span class="help-block m-b-none" langtag="info-autogenerated"></span>
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
{{if eq true .allow_user_login}}
|
||||
{{if or (eq true .allow_user_change_username) (eq true .isAdmin)}}
|
||||
<div class="form-group" id="web_username">
|
||||
<label class="control-label col-sm-2" langtag="info-client-web-username">web登陆用户名</label>
|
||||
<label class="control-label font-bold" langtag="word-webusername"></label>
|
||||
<div class="col-sm-10">
|
||||
<input class="form-control" value="{{.c.WebUserName}}" type="text" name="web_username"
|
||||
placeholder="empty means to be unrestricted">
|
||||
<input class="form-control" value="{{.c.WebUserName}}" type="text" name="web_username" placeholder="" langtag="info-unrestricted">
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
<div class="form-group" id="web_password">
|
||||
<label class="control-label col-sm-2" langtag="info-client-web-password">web登陆密码</label>
|
||||
<label class="control-label font-bold" langtag="word-webpassword"></label>
|
||||
<div class="col-sm-10">
|
||||
<input class="form-control" value="{{.c.WebPassword}}" type="text" name="web_password"
|
||||
placeholder="empty means to be unrestricted">
|
||||
<input class="form-control" value="{{.c.WebPassword}}" type="text" name="web_password" placeholder="" langtag="info-unrestricted">
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
<div class="form-group" id="config_conn_allow">
|
||||
<label class="control-label col-sm-2" langtag="info-config-conn-allow">是否允许客户端以配置文件模式连接</label>
|
||||
<label class="control-label font-bold" langtag="word-connectbyconfig"></label>
|
||||
<div class="col-sm-10">
|
||||
<select class="form-control" name="config_conn_allow">
|
||||
<option {{if eq true .c.ConfigConnAllow}}selected{{end}} value="1">yes</option>
|
||||
<option {{if eq false .c.ConfigConnAllow}}selected{{end}} value="0">no</option>
|
||||
<option {{if eq true .c.ConfigConnAllow}}selected{{end}} value="1" langtag="word-yes"></option>
|
||||
<option {{if eq false .c.ConfigConnAllow}}selected{{end}} value="0" langtag="word-no"></option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" id="compress">
|
||||
<label class="control-label col-sm-2" langtag="info-compress">压缩</label>
|
||||
<label class="control-label font-bold" langtag="word-compress"></label>
|
||||
<div class="col-sm-10">
|
||||
<select class="form-control" name="compress">
|
||||
<option {{if eq false .c.Cnf.Compress}}selected{{end}} value="0">no</option>
|
||||
<option {{if eq true .c.Cnf.Compress}}selected{{end}} value="1">yes</option>
|
||||
<option {{if eq false .c.Cnf.Compress}}selected{{end}} value="0" langtag="word-no"></option>
|
||||
<option {{if eq true .c.Cnf.Compress}}selected{{end}} value="1" langtag="word-yes"></option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" id="compress">
|
||||
<label class="control-label col-sm-2" langtag="info-crypt">加密</label>
|
||||
<label class="control-label font-bold" langtag="word-crypt"></label>
|
||||
<div class="col-sm-10">
|
||||
<select class="form-control" name="crypt">
|
||||
<option {{if eq false .c.Cnf.Crypt}}selected{{end}} value="0">no</option>
|
||||
<option {{if eq true .c.Cnf.Crypt}}selected{{end}} value="1">yes</option>
|
||||
<option {{if eq false .c.Cnf.Crypt}}selected{{end}} value="0" langtag="word-no"></option>
|
||||
<option {{if eq true .c.Cnf.Crypt}}selected{{end}} value="1" langtag="word-yes"></option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hr-line-dashed"></div>
|
||||
<div class="form-group">
|
||||
<div class="col-sm-4 col-sm-offset-2">
|
||||
<button class="btn btn-success" type="button" id="add"><i
|
||||
class="fa fa-fw fa-lg fa-eye"></i><span langtag="info-save">保存</span>
|
||||
<button class="btn btn-success" type="button" onclick="submitform('add', '{{.web_base_url}}/client/edit', $('form').serializeArray())"> <i
|
||||
class="fa fa-fw fa-lg fa-save"></i><span langtag="word-save"></span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -138,22 +128,3 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
|
||||
$(function () {
|
||||
$("#add").on("click", function () {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "{{.web_base_url}}/client/edit",
|
||||
data: $("form").serializeArray(),
|
||||
success: function (res) {
|
||||
alert(res.msg)
|
||||
if (res.status) {
|
||||
history.back(-1)
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
})
|
||||
</script>
|
190
web/views/client/list.html
Executable file → Normal file
190
web/views/client/list.html
Executable file → Normal file
@@ -4,7 +4,7 @@
|
||||
<div class="col-lg-12">
|
||||
<div class="ibox float-e-margins">
|
||||
<div class="ibox-title">
|
||||
<h5>client list</h5>
|
||||
<h5 langtag="page-clientlist"></h5>
|
||||
|
||||
<div class="ibox-tools">
|
||||
<a class="collapse-link">
|
||||
@@ -20,10 +20,10 @@
|
||||
|
||||
<div class="table-responsive">
|
||||
<div id="toolbar">
|
||||
<a href="{{.web_base_url}}/client/add" class="btn btn-primary dim" type="button" langtag="info-new">新增</a>
|
||||
<a href="{{.web_base_url}}/client/add" class="btn btn-primary dim">
|
||||
<i class="fa fa-fw fa-lg fa-plus"></i> <span langtag="word-add"></span></a>
|
||||
</div>
|
||||
<table id="taskList_table" class="table-striped table-hover"
|
||||
data-mobile-responsive="true"></table>
|
||||
<table id="taskList_table" class="table-striped table-hover" data-mobile-responsive="true"></table>
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
@@ -38,73 +38,6 @@
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function del(id) {
|
||||
if (confirm("Are you sure you want to delete it??")) {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "{{.web_base_url}}/client/del",
|
||||
data: {"id": id},
|
||||
success: function (res) {
|
||||
alert(res.msg)
|
||||
if (res.status) {
|
||||
document.location.reload();
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
function start(id) {
|
||||
if (confirm("Are you sure you want to start it??")) {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "{{.web_base_url}}/client/changestatus",
|
||||
data: {"id": id, "status": 1},
|
||||
success: function (res) {
|
||||
alert(res.msg)
|
||||
if (res.status) {
|
||||
document.location.reload();
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
function stop(id) {
|
||||
if (confirm("Are you sure you want to stop it?")) {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "{{.web_base_url}}/client/changestatus",
|
||||
data: {
|
||||
"id": id, "status": 0
|
||||
},
|
||||
success:
|
||||
function (res) {
|
||||
alert(res.msg)
|
||||
if (res.status) {
|
||||
document.location.reload();
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
function edit(id) {
|
||||
window.location.href = "{{.web_base_url}}/client/edit?id=" + id
|
||||
}
|
||||
|
||||
function add() {
|
||||
window.location.href = "{{.web_base_url}}/client/add"
|
||||
}
|
||||
|
||||
function tunnel(id) {
|
||||
window.location.href = "{{.web_base_url}}/index/all?client_id=" + id
|
||||
}
|
||||
|
||||
function host(id) {
|
||||
window.location.href = "{{.web_base_url}}/index/hostlist?client_id=" + id
|
||||
}
|
||||
|
||||
/*bootstrap table*/
|
||||
$('#table').bootstrapTable({
|
||||
toolbar: "#toolbar",
|
||||
@@ -122,131 +55,158 @@
|
||||
pageList: [5, 10, 20, 50],//分页步进值
|
||||
detailView: true,
|
||||
smartDisplay: true, // 智能显示 pagination 和 cardview 等
|
||||
onExpandRow: function () {$('body').setLang ('.detail-view');},
|
||||
onPostBody: function (data) { if ($(this)[0].locale != undefined ) $('body').setLang ('#table'); },
|
||||
detailFormatter: function (index, row, element) {
|
||||
return '<b langtag="info-max-conn-num">最大连接数</b>:' + row.MaxConn + `       `
|
||||
+ '<b langtag="info-now-conn-num">当前连接数</b>:' + row.NowConn + `       `
|
||||
+ '<b langtag="info-flow-limit">流量限制</b>:' + row.Flow.FlowLimit + `m       `
|
||||
+ '<b langtag="info-rate-limit">带宽限制</b>:' + row.RateLimit + `kb/s       `
|
||||
+ '<b langtag="info-max-tunnel-num">隧道数限制</b>:' + row.MaxTunnelNum + `       `
|
||||
+ '<b langtag="info-client-web-username">web登陆用户名</b>:' + row.WebUserName + `       `
|
||||
+ '<b langtag="info-client-web-password">web登陆密码</b>:' + row.WebPassword + `       `
|
||||
+ `       ` + "<br/><br>"
|
||||
+ '<b langtag="info-crypt">加密</b>:' + row.Cnf.Crypt + `       `
|
||||
+ '<b langtag="info-compress">压缩</b>:' + row.Cnf.Compress + `       `
|
||||
+ '<b langtag="info-config-conn-allow">是否允许配置文件模式连接</b>:' + row.ConfigConnAllow + `       `
|
||||
+ '<b langtag="info-web-auth-username">basic认证用户名</b>:' + row.Cnf.U + `       `
|
||||
+ '<b langtag="info-web-auth-password">basic认证密码</b>:' + row.Cnf.P + `       ` + "<br/><br>"
|
||||
+ '<b langtag="info-command">命令</b>:' + "<code>./npc{{.win}} -server={{.ip}}:{{.p}} -vkey=" + row.VerifyKey + " -type=" +{{.bridgeType}} +"</code>"
|
||||
return '<b langtag="word-maxconnections"></b>: ' + row.MaxConn + ' '
|
||||
+ '<b langtag="word-curconnections"></b>: ' + row.NowConn + ' '
|
||||
+ '<b langtag="word-flowlimit"></b>: ' + row.Flow.FlowLimit + 'm '
|
||||
+ '<b langtag="word-ratelimit"></b>: ' + row.RateLimit + 'kb/s '
|
||||
+ '<b langtag="word-maxtunnels"></b>: ' + row.MaxTunnelNum + ' <br/><br/>'
|
||||
+ '<b langtag="word-webusername"></b>: ' + row.WebUserName + ' '
|
||||
+ '<b langtag="word-webpassword"></b>: ' + row.WebPassword + ' '
|
||||
+ '<b langtag="word-basicusername"></b>: ' + row.Cnf.U + ' '
|
||||
+ '<b langtag="word-basicpassword"></b>: ' + row.Cnf.P + ' <br/><br/>'
|
||||
+ '<b langtag="word-crypt"></b>: <span langtag="word-' + row.Cnf.Crypt + '"></span> '
|
||||
+ '<b langtag="word-compress"></b>: <span langtag="word-' + row.Cnf.Compress + '"></span> '
|
||||
+ '<b langtag="word-connectbyconfig"></b>: <span langtag="word-' + row.ConfigConnAllow + '"></span> <br/><br/>'
|
||||
+ '<b langtag="word-commandclient"></b>: ' + "<code>./npc{{.win}} -server={{.ip}}:{{.p}} -vkey=" + row.VerifyKey + " -type=" +{{.bridgeType}} +"</code>"
|
||||
},
|
||||
//表格的列
|
||||
columns: [
|
||||
{
|
||||
field: 'Id',//域值
|
||||
title: 'id',//标题
|
||||
visible: true,//false表示不显示
|
||||
title: '<span langtag="word-id"></span>',//标题
|
||||
halign: 'center',
|
||||
visible: true//false表示不显示
|
||||
},
|
||||
{
|
||||
field: 'Remark',//域值
|
||||
title: 'remark',//标题
|
||||
visible: true,//false表示不显示
|
||||
title: '<span langtag="word-remark"></span>',//标题
|
||||
halign: 'center',
|
||||
visible: true//false表示不显示
|
||||
},
|
||||
{
|
||||
field: 'Version',//域值
|
||||
title: 'version',//标题
|
||||
visible: true,//false表示不显示
|
||||
title: '<span langtag="word-version"></span>',//标题
|
||||
halign: 'center',
|
||||
visible: true//false表示不显示
|
||||
},
|
||||
{
|
||||
field: 'VerifyKey',//域值
|
||||
title: 'vkey',//标题
|
||||
title: '<span langtag="word-verifykey"></span>',//标题
|
||||
halign: 'center',
|
||||
visible: true,//false表示不显示
|
||||
formatter: function (value, row, index) {
|
||||
if (!row.NoStore) {
|
||||
return value
|
||||
} else {
|
||||
return "public vkey"
|
||||
return '<span langtag="word-publicvkey"></span>'
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'Addr',//域值
|
||||
title: 'client addr',//标题
|
||||
visible: true,//false表示不显示
|
||||
title: '<span langtag="word-address"></span>',//标题
|
||||
halign: 'center',
|
||||
visible: true//false表示不显示
|
||||
},
|
||||
{
|
||||
field: 'InletFlow',//域值
|
||||
title: 'in flow',//标题
|
||||
title: '<span langtag="word-inletflow"></span>',//标题
|
||||
halign: 'center',
|
||||
visible: true,//false表示不显示
|
||||
sortable: true,//启用排序
|
||||
formatter: function (value, row, index) {
|
||||
return change(row.Flow.InletFlow)
|
||||
return changeunit(row.Flow.InletFlow)
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'ExportFlow',//域值
|
||||
title: 'out flow',//标题
|
||||
title: '<span langtag="word-exportflow"></span>',//标题
|
||||
halign: 'center',
|
||||
visible: true,//false表示不显示
|
||||
sortable: true,//启用排序
|
||||
formatter: function (value, row, index) {
|
||||
return change(row.Flow.ExportFlow)
|
||||
return changeunit(row.Flow.ExportFlow)
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'IsConnect',//域值
|
||||
title: 'speed',//内容
|
||||
title: '<span langtag="word-speed"></span>',//内容
|
||||
halign: 'center',
|
||||
visible: true,//false表示不显示
|
||||
formatter: function (value, row, index) {
|
||||
return change(row.Rate.NowRate) + "/S"
|
||||
return changeunit(row.Rate.NowRate) + "/S"
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'Status',//域值
|
||||
title: 'run',//内容
|
||||
title: '<span langtag="word-status"></span>',//内容
|
||||
align: 'center',
|
||||
halign: 'center',
|
||||
visible: true,//false表示不显示
|
||||
formatter: function (value, row, index) {
|
||||
if (value) {
|
||||
return '<span class="badge badge-primary">open</span>'
|
||||
return '<span class="badge badge-primary" langtag="word-open"></span>'
|
||||
} else {
|
||||
return '<span class="badge badge-badge">close</span>'
|
||||
return '<span class="badge badge-badge" langtag="word-close"></span>'
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'IsConnect',//域值
|
||||
title: 'status',//内容
|
||||
title: '<span langtag="word-connect"></span>',//内容
|
||||
align: 'center',
|
||||
halign: 'center',
|
||||
visible: true,//false表示不显示
|
||||
formatter: function (value, row, index) {
|
||||
if (value) {
|
||||
return '<span class="badge badge-primary">online</span>'
|
||||
return '<span class="badge badge-primary" langtag="word-online"></span>'
|
||||
} else {
|
||||
return '<span class="badge badge-badge">offline</span>'
|
||||
return '<span class="badge badge-badge" langtag="word-offline"></span>'
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'option',//域值
|
||||
title: 'option',//内容
|
||||
title: '<span langtag="word-option"></span>',//内容
|
||||
align: 'center',
|
||||
halign: 'center',
|
||||
visible: true,//false表示不显示
|
||||
formatter: function (value, row, index) {
|
||||
btn_group = '<div class="btn-group">'
|
||||
btn = `{{if eq true .isAdmin}}<button onclick="del(` + row.Id + `)" class="btn-danger"><i class="fa fa-trash"></i></button>{{end}}<button onclick="edit(` + row.Id + `)" class="btn-primary"><i class="fa fa-edit"></i></button></div>`
|
||||
|
||||
{{if eq true .isAdmin}}
|
||||
if (row.Status) {
|
||||
return btn_group {{if eq true .isAdmin}}+ `<button onclick="stop(` + row.Id + `)" class="btn-warning"><i class="fa fa-close"></i></button>`{{end}}+ btn
|
||||
btn_group += '<a onclick="submitform(\'stop\', \'{{.web_base_url}}/client/changestatus\', {\'id\':' + row.Id
|
||||
btn_group += ', \'status\': 0})" class="btn btn-outline btn-warning"><i class="fa fa-pause"></i></a>'
|
||||
} else {
|
||||
return btn_group {{if eq true .isAdmin}}+ `<button onclick="start(` + row.Id + `)" class="btn-warning"><i class="fa fa-check"></i></button>`{{end}}+ btn
|
||||
btn_group += '<a onclick="submitform(\'start\', \'{{.web_base_url}}/client/changestatus\', {\'id\':' + row.Id
|
||||
btn_group += ', \'status\': 1})" class="btn btn-outline btn-primary"><i class="fa fa-play"></i></a>'
|
||||
}
|
||||
btn_group += '<a onclick="submitform(\'delete\', \'{{.web_base_url}}/client/del\', {\'id\':' + row.Id
|
||||
btn_group += '})" class="btn btn-outline btn-danger"><i class="fa fa-trash"></i></a>'
|
||||
{{end}}
|
||||
|
||||
btn_group += '<a href="{{.web_base_url}}/client/edit?id=' + row.Id
|
||||
btn_group += '" class="btn btn-outline btn-success"><i class="fa fa-edit"></i></a></div>'
|
||||
return btn_group
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'show',//域值
|
||||
title: 'show',//内容
|
||||
title: '<span langtag="word-show">',//内容
|
||||
align: 'center',
|
||||
halign: 'center',
|
||||
visible: true,//false表示不显示
|
||||
formatter: function (value, row, index) {
|
||||
return `<button onclick="tunnel(` + row.Id + `)" class="btn-info">tunnel</button><button onclick="host(` + row.Id + `)" class="btn-primary">host</button>`
|
||||
return '<div class="btn-group"><a href="{{.web_base_url}}/index/all?client_id=' + row.Id
|
||||
+ '" class="btn btn-outline btn-primary" langtag="word-tunnel"></a>'
|
||||
+ '<a href="{{.web_base_url}}/index/hostlist?client_id=' + row.Id
|
||||
+ '" class="btn btn-outline btn-success" langtag="word-host"></a></div>'
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
|
||||
</script>
|
||||
|
114
web/views/index/add.html
Executable file → Normal file
114
web/views/index/add.html
Executable file → Normal file
@@ -1,128 +1,119 @@
|
||||
<div class="row tile">
|
||||
<div class="col-md-12 col-md-auto">
|
||||
<div class="ibox float-e-margins">
|
||||
<h3 class="ibox-title">add</h3>
|
||||
<h3 class="ibox-title" langtag="page-add"></h3>
|
||||
<div class="ibox-content">
|
||||
<form class="form-horizontal">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label" langtag="info-mode">类型 </label>
|
||||
<label class="control-label font-bold" langtag="word-scheme"></label>
|
||||
<div class="col-sm-10">
|
||||
<select class="form-control" name="type" id="type">
|
||||
<option {{if eq "tcp" .type}}selected{{end}} value="tcp">tcp</option>
|
||||
<option {{if eq "udp" .type}}selected{{end}} value="udp">udp</option>
|
||||
<option {{if eq "socks5" .type}}selected{{end}} value="socks5">socks5
|
||||
<option {{if eq "tcp" .type}}selected{{end}} value="tcp" langtag="scheme-tcp"></option>
|
||||
<option {{if eq "udp" .type}}selected{{end}} value="udp" langtag="scheme-udp"></option>
|
||||
<option {{if eq "httpProxy" .type}}selected{{end}} value="httpProxy" langtag="scheme-httpProxy"></option>
|
||||
<option {{if eq "socks5" .type}}selected{{end}} value="socks5" langtag="scheme-socks5">
|
||||
</option>
|
||||
<option {{if eq "httpProxy" .type}}selected{{end}} value="httpProxy">http</option>
|
||||
<option {{if eq "secret" .type}}selected{{end}} value="secret">secret</option>
|
||||
<option {{if eq "p2p" .type}}selected{{end}} value="p2p">p2p</option>
|
||||
{{/*<option {{if eq "file" .type}}selected{{end}} value="file">file*/}}
|
||||
<option {{if eq "secret" .type}}selected{{end}} value="secret" langtag="scheme-secret"></option>
|
||||
<option {{if eq "p2p" .type}}selected{{end}} value="p2p" langtag="scheme-p2p"></option>
|
||||
{{/*<option {{if eq "file" .type}}selected{{end}} value="file" langtag="scheme-file"></option>*/}}
|
||||
</select>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group" id="client_id">
|
||||
<label class="control-label font-bold" langtag="word-clientid"></label>
|
||||
<div class="col-sm-10">
|
||||
<input value="{{.client_id}}" class="form-control" type="text" name="client_id" placeholder="" langtag="word-clientid">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label" langtag="info-remark">备注</label>
|
||||
<label class="control-label font-bold" langtag="word-remark"></label>
|
||||
<div class="col-sm-10">
|
||||
<input class="form-control" type="text" name="remark"
|
||||
placeholder="empty means to be unrestricted">
|
||||
<input class="form-control" type="text" name="remark" placeholder="" langtag="info-unrestricted">
|
||||
</div>
|
||||
</div>
|
||||
{{if eq true .allow_multi_ip}}
|
||||
<div class="form-group" id="server_ip">
|
||||
<label class="col-sm-2 control-label" langtag="info-server-ip">服务端ip</label>
|
||||
<label class="control-label font-bold" langtag="word-serverip"></label>
|
||||
<div class="col-sm-10">
|
||||
<input class="form-control" type="text" value="0.0.0.0" name="server_ip"
|
||||
placeholder="such as 0.0.0.0">
|
||||
<input class="form-control" type="text" value="0.0.0.0" name="server_ip" placeholder="" langtag="info-suchasip">
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
<div class="form-group" id="port">
|
||||
<label class="col-sm-2 control-label" langtag="info-server-port">服务端端口</label>
|
||||
<label class="control-label font-bold" langtag="word-serverport"></label>
|
||||
<div class="col-sm-10">
|
||||
<input class="form-control" type="text" name="port" placeholder="such as 8024">
|
||||
<input class="form-control" type="text" name="port" placeholder="" langtag="info-suchasport">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{if eq true .allow_local_proxy}}
|
||||
<div class="form-group" id="local_proxy">
|
||||
<label class="control-label col-sm-2" langtag="info-local-proxy">是否代理为服务端本地</label>
|
||||
<label class="control-label font-bold" langtag="word-proxytolocal"></label>
|
||||
<div class="col-sm-10">
|
||||
<select class="form-control" name="local_proxy">
|
||||
<option value="0">no</option>
|
||||
<option value="1">yes</option>
|
||||
<option value="0" langtag="word-no"></option>
|
||||
<option value="1" langtag="word-yes"></option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
<div class="form-group" id="target">
|
||||
<label class="col-sm-2 control-label" langtag="info-target">目标(ip:端口)</label>
|
||||
<label class="control-label font-bold" langtag="word-target"></label>
|
||||
<div class="col-sm-10">
|
||||
<textarea class="form-control" name="target" rows="4" placeholder="10.1.50.203:22
|
||||
10.1.50.202:22"></textarea>
|
||||
<span class="help-block m-b-none">can only fill in ports if it is local machine proxy, only tcp supports load balancing
|
||||
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group" id="client_id">
|
||||
<label class="col-sm-2 control-label" langtag="info-client-id">客户端id</label>
|
||||
<div class="col-sm-10">
|
||||
<input value="{{.client_id}}" class="form-control" type="text" name="client_id"
|
||||
placeholder="id of client">
|
||||
<textarea class="form-control" name="target" rows="4" placeholder="" langtag="info-suchasiplist"></textarea>
|
||||
<span class="help-block m-b-none" langtag="info-targettunnel"></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group" id="local_path">
|
||||
<label class="col-sm-2 control-label" langtag="info-local-path">本地路径</label>
|
||||
<label class="control-label font-bold" langtag="word-localpath"></label>
|
||||
<div class="col-sm-10">
|
||||
<input class="form-control" type="text" name="local_path"
|
||||
placeholder="such as /tmp">
|
||||
<input class="form-control" type="text" name="local_path" placeholder="" langtag="info-suchaslocalpath">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group" id="strip_pre">
|
||||
<label class="col-sm-2 control-label" langtag="info-strip-pre">访问前缀</label>
|
||||
<label class="control-label font-bold" langtag="word-stripprefix"></label>
|
||||
<div class="col-sm-10">
|
||||
<input class="form-control" type="text" name="strip_pre"
|
||||
placeholder="such as static">
|
||||
<input class="form-control" type="text" name="strip_pre" placeholder="" langtag="info-suchasstripprefix">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group" id="password">
|
||||
<label class="col-sm-2 control-label" langtag="info-unique-vkey">唯一验证密钥</label>
|
||||
<label class="control-label font-bold" langtag="word-identificationkey"></label>
|
||||
<div class="col-sm-10">
|
||||
<input class="form-control" type="text" name="password"
|
||||
placeholder="unique identification key">
|
||||
<span class="help-block m-b-none">when p2p or secret</span>
|
||||
<input class="form-control" type="text" name="password" placeholder="" langtag="word-identificationkey">
|
||||
<span class="help-block m-b-none" langtag="info-identificationkey"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hr-line-dashed"></div>
|
||||
<div class="form-group">
|
||||
<div class="col-sm-4 col-sm-offset-2">
|
||||
<button class="btn btn-success" type="button" id="add"><i
|
||||
class="fa fa-fw fa-lg fa-eye"></i>新增
|
||||
<button class="btn btn-success" type="button" onclick="submitform('add', '{{.web_base_url}}/index/add', $('form').serializeArray())">
|
||||
<i class="fa fa-fw fa-lg fa-check-circle"></i> <span langtag="word-add"></span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
var arr = []
|
||||
arr["all"] = ["type", "port", "compress", "u", "p", "target", "password", "strip_pre", "local_path", "local_proxy"]
|
||||
arr["tcp"] = ["type", "port", "target", "compress", "u", "p", "local_proxy", "tcp隧道模式,提供一条tcp隧道,适用于ssh、远程桌面等,添加后会自动生成一个客户端验证key<br>在内网机器执行<span style='color: red'>./easyProxy -vkey=生成的key -server=公网服务器ip:下面设定的端口</span><br>建立成功后,访问公网服务器的设定端口,则相当于访问内网目标地址的目标端口"]
|
||||
arr["udp"] = ["type", "port", "target", "compress", "local_proxy", "udp隧道模式,提供一条udp隧道,适用于dns、内网dns访问等,添加后会自动生成一个客户端验证key<br>在内网机器执行<span style='color: red'>./easyProxy -vkey=生成的key -server=公网服务器ip:下面设定的端口</span><br>建立成功后,访问公网服务器的设定端口,则相当于访问内网目标地址的udp目标端口"]
|
||||
arr["socks5"] = ["type", "port", "compress", "u", "p", "socks5代理模式,内网socks5代理,配合proxifer,可如同使用vpn一样访问内网设备或资源,添加后会自动生成一个客户端验证key<br>在内网机器执行<span style='color: red'>./easyProxy -vkey=生成的key -server=公网服务器ip:下面设定的端口</span><br>建立成功后,在外网环境下本机配置socks5代理,即访问内网设备或者资源 "]
|
||||
arr["httpProxy"] = ["type", "port", "compress", "u", "p", " http代理模式,内网http代理,可访问内网网站,添加后会自动生成一个客户端验证key<br>在内网机器执行<span style='color: red'>./easyProxy -vkey=生成的key -server=公网服务器ip:下面设定的端口</span><br>建立成功后,在外网环境下本机配置http代理,即访问内网站点"]
|
||||
arr["secret"] = ["type", "target", "compress", "password", "u", "p", " http代理模式,内网http代理,可访问内网网站,添加后会自动生成一个客户端验证key<br>在内网机器执行<span style='color: red'>./easyProxy -vkey=生成的key -server=公网服务器ip:下面设定的端口</span><br>建立成功后,在外网环境下本机配置http代理,即访问内网站点"]
|
||||
arr["p2p"] = ["type", "target", "compress", "password", "u", "p", " http代理模式,内网http代理,可访问内网网站,添加后会自动生成一个客户端验证key<br>在内网机器执行<span style='color: red'>./easyProxy -vkey=生成的key -server=公网服务器ip:下面设定的端口</span><br>建立成功后,在外网环境下本机配置http代理,即访问内网站点"]
|
||||
arr["file"] = ["type", "strip_pre", "local_path", "port", " http代理模式,内网http代理,可访问内网网站,添加后会自动生成一个客户端验证key<br>在内网机器执行<span style='color: red'>./easyProxy -vkey=生成的key -server=公网服务器ip:下面设定的端口</span><br>建立成功后,在外网环境下本机配置http代理,即访问内网站点"]
|
||||
arr["all"] = ["type", "port", "compress", "u", "p", "target", "password", "local_path", "strip_pre", "local_proxy"]
|
||||
arr["tcp"] = ["type", "port", "target", "u", "p", "compress", "local_proxy"]
|
||||
arr["udp"] = ["type", "port", "target", "compress", "local_proxy"]
|
||||
arr["socks5"] = ["type", "port", "compress", "u", "p"]
|
||||
arr["httpProxy"] = ["type", "port", "compress", "u", "p"]
|
||||
arr["secret"] = ["type", "target", "compress", "u", "p", "password"]
|
||||
arr["p2p"] = ["type", "target", "password"]
|
||||
arr["file"] = ["type", "port", "local_path", "strip_pre"]
|
||||
arrClientHide = ["compress", "u", "p", "crypt", "mux"]
|
||||
|
||||
function resetForm() {
|
||||
@@ -159,18 +150,5 @@
|
||||
resetForm()
|
||||
resetClientCnf()
|
||||
})
|
||||
$("#add").on("click", function () {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "{{.web_base_url}}/index/add",
|
||||
data: $("form").serializeArray(),
|
||||
success: function (res) {
|
||||
alert(res.msg)
|
||||
if (res.status) {
|
||||
history.back(-1)
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
})
|
||||
</script>
|
101
web/views/index/edit.html
Executable file → Normal file
101
web/views/index/edit.html
Executable file → Normal file
@@ -1,108 +1,98 @@
|
||||
<div class="row tile">
|
||||
<div class="col-md-12 col-md-auto">
|
||||
<div class="ibox float-e-margins">
|
||||
<h3 class="ibox-title">编辑</h3>
|
||||
<h3 class="ibox-title" langtag="page-edit"></h3>
|
||||
<div class="ibox-content">
|
||||
<form class="form-horizontal">
|
||||
<input type="hidden" name="id" value="{{.t.Id}}">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label" langtag="info-mode">类型 </label>
|
||||
<label class="col-sm-2 control-label" langtag="word-scheme"></label>
|
||||
<div class="col-sm-10">
|
||||
<select class="form-control" name="type" id="type">
|
||||
<option {{if eq "tcp" .t.Mode}}selected{{end}} value="tcp">tcp</option>
|
||||
<option {{if eq "udp" .t.Mode}}selected{{end}} value="udp">udp</option>
|
||||
<option {{if eq "socks5" .t.Mode}}selected{{end}} value="socks5">socks5
|
||||
</option>
|
||||
<option {{if eq "httpProxy" .t.Mode}}selected{{end}} value="httpProxy">http</option>
|
||||
<option {{if eq "secret" .t.Mode}}selected{{end}} value="secret">secret</option>
|
||||
<option {{if eq "p2p" .t.Mode}}selected{{end}} value="p2p">p2p</option>
|
||||
<option {{if eq "file" .t.Mode}}selected{{end}} value="file">file</option>
|
||||
<option {{if eq "tcp" .t.Mode}}selected{{end}} value="tcp" langtag="scheme-tcp"></option>
|
||||
<option {{if eq "udp" .t.Mode}}selected{{end}} value="udp" langtag="scheme-udp"></option>
|
||||
<option {{if eq "httpProxy" .t.Mode}}selected{{end}} value="httpProxy" langtag="scheme-httpProxy"></option>
|
||||
<option {{if eq "socks5" .t.Mode}}selected{{end}} value="socks5" langtag="scheme-socks5"></option>
|
||||
<option {{if eq "secret" .t.Mode}}selected{{end}} value="secret" langtag="scheme-secret"></option>
|
||||
<option {{if eq "p2p" .t.Mode}}selected{{end}} value="p2p" langtag="scheme-p2p"></option>
|
||||
<option {{if eq "file" .t.Mode}}selected{{end}} value="file" langtag="scheme-file"></option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label" langtag="info-remark">备注</label>
|
||||
<div class="form-group" id="client_id">
|
||||
<label class="col-sm-2 control-label" langtag="word-clientid"></label>
|
||||
<div class="col-sm-10">
|
||||
<input value="{{.t.Remark}}" class="form-control" type="text" name="remark"
|
||||
placeholder="empty means to be unrestricted">
|
||||
<input value="{{.t.Client.Id}}" value="{{.client_id}}" class="form-control" type="text" name="client_id" placeholder="" langtag="word-clientid">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label" langtag="word-remark"></label>
|
||||
<div class="col-sm-10">
|
||||
<input value="{{.t.Remark}}" class="form-control" type="text" name="remark" placeholder="" langtag="info-unrestricted">
|
||||
</div>
|
||||
</div>
|
||||
{{if eq true .allow_multi_ip}}
|
||||
<div class="form-group" id="server_ip">
|
||||
<label class="col-sm-2 control-label" langtag="info-server-ip">服务端ip</label>
|
||||
<label class="col-sm-2 control-label" langtag="word-serverip"></label>
|
||||
<div class="col-sm-10">
|
||||
<input class="form-control" type="text" value="{{.t.ServerIp}}" name="server_ip"
|
||||
placeholder="such as 0.0.0.0">
|
||||
<input class="form-control" type="text" value="{{.t.ServerIp}}" name="server_ip" placeholder="" langtag="info-suchasip">
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
<div class="form-group" id="port">
|
||||
<label class="col-sm-2 control-label" langtag="info-server-port">服务端端口</label>
|
||||
<label class="col-sm-2 control-label" langtag="word-serverport"></label>
|
||||
<div class="col-sm-10">
|
||||
<input value="{{.t.Port}}" class="form-control" type="text" name="port"
|
||||
placeholder="such as 8024">
|
||||
<input value="{{.t.Port}}" class="form-control" type="text" name="port" placeholder="" langtag="info-suchasport">
|
||||
</div>
|
||||
</div>
|
||||
{{if eq true .allow_local_proxy}}
|
||||
<div class="form-group" id="local_proxy">
|
||||
<label class="control-label col-sm-2" langtag="info-local-proxy">是否代理为服务端本地</label>
|
||||
<label class="control-label col-sm-2" langtag="word-proxytolocal"></label>
|
||||
<div class="col-sm-10">
|
||||
<select class="form-control" name="local_proxy">
|
||||
<option {{if eq false .t.Target.LocalProxy}}selected{{end}} value="0">no</option>
|
||||
<option {{if eq true .t.Target.LocalProxy}}selected{{end}} value="1">yes</option>
|
||||
<option {{if eq false .t.Target.LocalProxy}}selected{{end}} value="0" langtag="word-no"></option>
|
||||
<option {{if eq true .t.Target.LocalProxy}}selected{{end}} value="1" langtag="word-yes"></option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
<div class="form-group" id="target">
|
||||
<label class="col-sm-2 control-label" langtag="info-target">内网目标(ip:端口)</label>
|
||||
<label class="col-sm-2 control-label" langtag="word-target"></label>
|
||||
<div class="col-sm-10">
|
||||
<textarea class="form-control" name="target" rows="4" placeholder="10.1.50.203:22
|
||||
10.1.50.202:22">{{.t.Target.TargetStr}}</textarea>
|
||||
<span class="help-block m-b-none">can only fill in ports if it is local machine proxy, only tcp supports load balancing
|
||||
|
||||
</span></div>
|
||||
</div>
|
||||
|
||||
<div class="form-group" id="client_id">
|
||||
<label class="col-sm-2 control-label" langtag="info-client-id">客户端id</label>
|
||||
<div class="col-sm-10">
|
||||
<input value="{{.t.Client.Id}}" value="{{.client_id}}" class="form-control" type="text"
|
||||
name="client_id"
|
||||
placeholder="id of client">
|
||||
<textarea class="form-control" name="target" rows="4" placeholder="" langtag="info-suchasiplist">{{.t.Target.TargetStr}}</textarea>
|
||||
<span class="help-block m-b-none" langtag="info-targettunnel"></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group" id="local_path">
|
||||
<label class="col-sm-2 control-label" langtag="info-local-path">本地路径</label>
|
||||
<label class="col-sm-2 control-label" langtag="word-localpath"></label>
|
||||
<div class="col-sm-10">
|
||||
<input value="{{.t.LocalPath}}" class="form-control" type="text" name="local_path"
|
||||
placeholder="such as /tmp">
|
||||
<input value="{{.t.LocalPath}}" class="form-control" type="text" name="local_path" placeholder="" langtag="info-suchaslocalpath">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group" id="strip_pre">
|
||||
<label class="col-sm-2 control-label" langtag="info-strip-pre">访问前缀</label>
|
||||
<label class="col-sm-2 control-label" langtag="word-stripprefix"></label>
|
||||
<div class="col-sm-10">
|
||||
<input value="{{.t.StripPre}}" class="form-control" type="text" name="strip_pre"
|
||||
placeholder="such as static">
|
||||
<input value="{{.t.StripPre}}" class="form-control" type="text" name="strip_pre" placeholder="" langtag="info-suchasstripprefix">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group" id="password">
|
||||
<label class="col-sm-2 control-label" langtag="info-unique-vkey">唯一验证密钥</label>
|
||||
<label class="col-sm-2 control-label" langtag="word-identificationkey"></label>
|
||||
<div class="col-sm-10">
|
||||
<input value="{{.t.Password}}" class="form-control" type="text" name="password"
|
||||
placeholder="unique identification key">
|
||||
<span class="help-block m-b-none">when p2p or secret</span>
|
||||
<input value="{{.t.Password}}" class="form-control" type="text" name="password" placeholder="" langtag="word-identificationkey">
|
||||
<span class="help-block m-b-none" langtag="info-identificationkey"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hr-line-dashed"></div>
|
||||
<div class="form-group">
|
||||
<div class="col-sm-4 col-sm-offset-2">
|
||||
<button class="btn btn-success" type="button" id="add"><i
|
||||
class="fa fa-fw fa-lg fa-eye"></i><span langtag="info-save">保存</span>
|
||||
<button class="btn btn-success" type="button" onclick="submitform('edit', '{{.web_base_url}}/index/edit', $('form').serializeArray())">
|
||||
<i class="fa fa-fw fa-lg fa-check-circle"></i> <span langtag="word-save"></span>
|
||||
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -157,18 +147,5 @@
|
||||
resetForm()
|
||||
resetClientCnf()
|
||||
})
|
||||
$("#add").on("click", function () {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "{{.web_base_url}}/index/edit",
|
||||
data: $("form").serializeArray(),
|
||||
success: function (res) {
|
||||
alert(res.msg)
|
||||
if (res.status) {
|
||||
history.back(-1)
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
})
|
||||
</script>
|
92
web/views/index/hadd.html
Executable file → Normal file
92
web/views/index/hadd.html
Executable file → Normal file
@@ -1,105 +1,96 @@
|
||||
<div class="row tile">
|
||||
<div class="col-md-12 col-md-auto">
|
||||
<div class="ibox float-e-margins">
|
||||
<h3 class="ibox-title">add host</h3>
|
||||
<h3 class="ibox-title" langtag="page-hostadd"></h3>
|
||||
<div class="ibox-content">
|
||||
<form class="form-horizontal">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label" langtag="info-remark">备注</label>
|
||||
<label class="control-label font-bold" langtag="word-clientid"></label>
|
||||
<div class="col-sm-10">
|
||||
<input class="form-control" type="text" name="remark" placeholder="remark">
|
||||
<input value="{{.client_id}}" class="form-control" type="text" name="client_id" placeholder="" langtag="word-clientid">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label" langtag="info-host">域名</label>
|
||||
<label class="control-label font-bold" langtag="word-remark"></label>
|
||||
<div class="col-sm-10">
|
||||
<input class="form-control" type="text" name="host" placeholder="such as a.proxy.com">
|
||||
<input class="form-control" type="text" name="remark" placeholder="" langtag="word-remark">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label font-bold" langtag="word-host"></label>
|
||||
<div class="col-sm-10">
|
||||
<input class="form-control" type="text" name="host" placeholder="" langtag="info-suchashost">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" id="scheme">
|
||||
<label class="control-label col-sm-2" langtag="info-scheme">协议类型</label>
|
||||
<label class="control-label font-bold" langtag="word-scheme"></label>
|
||||
<div class="col-sm-10">
|
||||
<select id="scheme_select" class="form-control" name="scheme">
|
||||
<option value="all">all</option>
|
||||
<option value="http">http</option>
|
||||
<option value="https">https</option>
|
||||
<option value="all" langtag="word-all"></option>
|
||||
<option value="http" langtag="word-http"></option>
|
||||
<option value="https" langtag="word-https"></option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
{{if eq false .https_just_proxy}}
|
||||
<div class="form-group" id="cert_file">
|
||||
<label class="col-sm-2 control-label" langtag="info-https-cert">https cert file路径</label>
|
||||
<label class="control-label font-bold" langtag="word-httpscert"></label>
|
||||
<div class="col-sm-10">
|
||||
<input class="form-control" type="text" name="cert_file_path"
|
||||
placeholder="empty means to be unrestricted">
|
||||
<input class="form-control" type="text" name="cert_file_path" placeholder="" langtag="info-unrestricted">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" id="key_file">
|
||||
<label class="col-sm-2 control-label" langtag="info-https-key">https key file路径</label>
|
||||
<label class="control-label font-bold" langtag="word-httpskey"></label>
|
||||
<div class="col-sm-10">
|
||||
<input class="form-control" type="text" name="key_file_path"
|
||||
placeholder="empty means to be unrestricted">
|
||||
<input class="form-control" type="text" name="key_file_path" placeholder="" langtag="info-unrestricted">
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label" langtag="info-url-router">url路由</label>
|
||||
<label class="control-label font-bold" langtag="word-urlroute"></label>
|
||||
<div class="col-sm-10">
|
||||
<input class="form-control" type="text" name="location"
|
||||
placeholder="empty means to be unrestricted">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label" langtag="info-client-id">客户端id</label>
|
||||
<div class="col-sm-10">
|
||||
<input value="{{.client_id}}" class="form-control" type="text" name="client_id"
|
||||
placeholder="client id">
|
||||
<input class="form-control" type="text" name="location" placeholder="" langtag="info-unrestricted">
|
||||
</div>
|
||||
</div>
|
||||
{{if eq true .allow_local_proxy}}
|
||||
<div class="form-group" id="local_proxy">
|
||||
<label class="control-label col-sm-2" langtag="info-local-proxy">是否代理为服务端本地</label>
|
||||
<label class="control-label font-bold" langtag="word-proxytolocal"></label>
|
||||
<div class="col-sm-10">
|
||||
<select class="form-control" name="local_proxy">
|
||||
<option value="0">no</option>
|
||||
<option value="1">yes</option>
|
||||
<option value="0" langtag="word-no"></option>
|
||||
<option value="1" langtag="word-yes"></option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label" langtag="info-target">内网目标(ip:端口)</label>
|
||||
<label class="control-label font-bold" langtag="word-target"></label>
|
||||
<div class="col-sm-10">
|
||||
<textarea class="form-control" rows="4" type="text" name="target"
|
||||
placeholder="such as
|
||||
10.1.50.203:80
|
||||
10.1.50.202:80"></textarea>
|
||||
<span class="help-block m-b-none">Line break if load balancing</span>
|
||||
<textarea class="form-control" rows="4" type="text" name="target" placeholder="" langtag="info-suchasiplist"></textarea>
|
||||
<span class="help-block m-b-none" langtag="info-targethost"></span>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" id="header">
|
||||
<label class="col-sm-2 control-label" langtag="info-header-modify">request header修改</label>
|
||||
<label class="control-label font-bold" langtag="word-requestheader"></label>
|
||||
<div class="col-sm-10">
|
||||
<textarea class="form-control" rows="4" type="text" name="header"
|
||||
placeholder="Cache-Control: no-cache"></textarea>
|
||||
<span class="help-block m-b-none"> Colon separated, multiple lines please fill in</span>
|
||||
<textarea class="form-control" rows="4" type="text" name="header" placeholder="Cache-Control: no-cache"></textarea>
|
||||
<span class="help-block m-b-none" langtag="info-header"></span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="form-group" id="hostchange">
|
||||
<label class="col-sm-2 control-label" langtag="info-host-change">request host修改</label>
|
||||
<label class="control-label font-bold" langtag="word-requesthost"></label>
|
||||
<div class="col-sm-10">
|
||||
<input class="form-control" value="" type="text" name="hostchange"
|
||||
placeholder="host modify">
|
||||
<input class="form-control" value="" type="text" name="hostchange" placeholder="" langtag="word-requesthost">
|
||||
</div>
|
||||
</div>
|
||||
<div class="hr-line-dashed"></div>
|
||||
<div class="form-group">
|
||||
<div class="col-sm-4 col-sm-offset-2">
|
||||
<button class="btn btn-success" type="button" id="add"><i
|
||||
class="fa fa-fw fa-lg fa-eye"></i>新增
|
||||
</button>
|
||||
<button class="btn btn-success" type="button" onclick="submitform('add', '{{.web_base_url}}/index/addhost', $('form').serializeArray())">
|
||||
<i class="fa fa-fw fa-lg fa-check-circle"></i> <span langtag="word-add"></span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
@@ -109,19 +100,6 @@
|
||||
</div>
|
||||
<script>
|
||||
$(function () {
|
||||
$("#add").on("click", function () {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "{{.web_base_url}}/index/addhost",
|
||||
data: $("form").serializeArray(),
|
||||
success: function (res) {
|
||||
alert(res.msg)
|
||||
if (res.status) {
|
||||
history.back(-1)
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
$("#scheme_select").on("change", function () {
|
||||
if ($("#scheme_select").val() == "all" || $("#scheme_select").val() == "https") {
|
||||
$("#cert_file").css("display", "block")
|
||||
|
@@ -1,108 +1,98 @@
|
||||
<div class="row tile">
|
||||
<div class="col-md-12 col-md-auto">
|
||||
<div class="ibox float-e-margins">
|
||||
<h3 class="ibox-title">add host</h3>
|
||||
<h3 class="ibox-title" langtag="page-hostedit"></h3>
|
||||
<div class="ibox-content">
|
||||
<form class="form-horizontal">
|
||||
<input type="hidden" name="id" value="{{.h.Id}}">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label" langtag="info-remark">备注</label>
|
||||
<label class="control-label font-bold" langtag="word-clientid"></label>
|
||||
<div class="col-sm-10">
|
||||
<input value="{{.h.Client.Id}}" class="form-control" type="text" name="client_id" placeholder="" langtag="word-clientid">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label font-bold" langtag="word-remark"></label>
|
||||
<div class="col-sm-10">
|
||||
<input value="{{.h.Remark}}" class="form-control" type="text" name="remark"
|
||||
placeholder="remark">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label" langtag="info-host">域名</label>
|
||||
<label class="control-label font-bold" langtag="word-host"></label>
|
||||
<div class="col-sm-10">
|
||||
<input value="{{.h.Host}}" class="form-control" type="text" name="host"
|
||||
placeholder="such as a.proxy.com">
|
||||
<input value="{{.h.Host}}" class="form-control" type="text" name="host" placeholder="" langtag="info-suchashost">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" id="scheme">
|
||||
<label class="control-label col-sm-2" langtag="info-scheme">协议类型</label>
|
||||
<label class="control-label font-bold" langtag="word-scheme"></label>
|
||||
<div class="col-sm-10">
|
||||
<select id="scheme_select" class="form-control" name="scheme">
|
||||
<option {{if eq "all" .h.Scheme}}selected{{end}} value="all">all</option>
|
||||
<option {{if eq "http" .h.Scheme}}selected{{end}} value="http">http</option>
|
||||
<option {{if eq "https" .h.Scheme}}selected{{end}} value="https">https</option>
|
||||
<option {{if eq "all" .h.Scheme}}selected{{end}} value="all" langtag="word-all"></option>
|
||||
<option {{if eq "http" .h.Scheme}}selected{{end}} value="http" langtag="word-http"></option>
|
||||
<option {{if eq "https" .h.Scheme}}selected{{end}} value="https" langtag="word-https"></option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
{{if eq false .https_just_proxy}}
|
||||
<div class="form-group" id="cert_file">
|
||||
<label class="col-sm-2 control-label" langtag="info-https-cert">https cert file路径</label>
|
||||
<label class="control-label font-bold" langtag="word-httpscert"></label>
|
||||
<div class="col-sm-10">
|
||||
<input value="{{.h.CertFilePath}}" class="form-control" type="text" name="cert_file_path"
|
||||
placeholder="empty means to be unrestricted">
|
||||
<input value="{{.h.CertFilePath}}" class="form-control" type="text" name="cert_file_path" placeholder="" langtag="info-unrestricted">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" id="key_file">
|
||||
<label class="col-sm-2 control-label" langtag="info-https-key">https key file路径</label>
|
||||
<label class="control-label font-bold" langtag="word-httpskey"></label>
|
||||
<div class="col-sm-10">
|
||||
<input value="{{.h.KeyFilePath}}" class="form-control" type="text" name="key_file_path"
|
||||
placeholder="empty means to be unrestricted">
|
||||
<input value="{{.h.KeyFilePath}}" class="form-control" type="text" name="key_file_path" placeholder="" langtag="info-unrestricted">
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label" langtag="info-url-router">url路由</label>
|
||||
<label class="control-label font-bold" langtag="word-urlroute"></label>
|
||||
<div class="col-sm-10">
|
||||
<input value="{{.h.Location}}" class="form-control" type="text" name="location"
|
||||
placeholder="empty means to be unrestricted">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label" langtag="info-client-id">客户端id</label>
|
||||
<div class="col-sm-10">
|
||||
<input value="{{.h.Client.Id}}" class="form-control" type="text" name="client_id"
|
||||
placeholder="client id">
|
||||
<input value="{{.h.Location}}" class="form-control" type="text" name="location" placeholder="" langtag="info-unrestricted">
|
||||
</div>
|
||||
</div>
|
||||
{{if eq true .allow_local_proxy}}
|
||||
<div class="form-group" id="local_proxy">
|
||||
<label class="control-label col-sm-2" langtag="info-local-proxy">是否代理为服务端本地</label>
|
||||
<label class="control-label font-bold" langtag="word-proxytolocal"></label>
|
||||
<div class="col-sm-10">
|
||||
<select class="form-control" name="local_proxy">
|
||||
<option {{if eq false .h.Target.LocalProxy}}selected{{end}} value="0">no</option>
|
||||
<option {{if eq true .h.Target.LocalProxy}}selected{{end}} value="1">yes</option>
|
||||
<option {{if eq false .h.Target.LocalProxy}}selected{{end}} value="0" langtag="word-no"></option>
|
||||
<option {{if eq true .h.Target.LocalProxy}}selected{{end}} value="1" langtag="word-yes"></option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label" langtag="info-target">内网目标(ip:端口)</label>
|
||||
<label class="control-label font-bold" langtag="word-target"></label>
|
||||
<div class="col-sm-10">
|
||||
<textarea class="form-control" rows="4" type="text" name="target"
|
||||
placeholder="such as
|
||||
10.1.50.203:80
|
||||
10.1.50.202:80">{{.h.Target.TargetStr}}</textarea>
|
||||
<span class="help-block m-b-none">Line break if load balancing</span>
|
||||
<textarea class="form-control" rows="4" type="text" name="target" placeholder="" langtag="info-suchasiplist">{{.h.Target.TargetStr}}</textarea>
|
||||
<span class="help-block m-b-none" langtag="info-targethost"></span>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" id="header">
|
||||
<label class="col-sm-2 control-label" langtag="info-header-modify">request header修改</label>
|
||||
<label class="control-label font-bold" langtag="word-requestheader"></label>
|
||||
<div class="col-sm-10">
|
||||
<textarea class="form-control" rows="4" type="text" name="header"
|
||||
placeholder="Cache-Control: no-cache">{{.h.HeaderChange}}</textarea>
|
||||
<span class="help-block m-b-none"> Colon separated, multiple lines please fill in</span>
|
||||
<textarea class="form-control" rows="4" type="text" name="header" placeholder="Cache-Control: no-cache">{{.h.HeaderChange}}</textarea>
|
||||
<span class="help-block m-b-none" langtag="info-header"></span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="form-group" id="hostchange">
|
||||
<label class="col-sm-2 control-label" langtag="info-host-change">request host修改</label>
|
||||
<label class="control-label font-bold" langtag="word-requesthost"></label>
|
||||
<div class="col-sm-10">
|
||||
<input value="{{.h.HostChange}}" class="form-control" value="" type="text" name="hostchange"
|
||||
placeholder="host modify">
|
||||
<input value="{{.h.HostChange}}" class="form-control" value="" type="text" name="hostchange" placeholder="" langtag="word-requesthost">
|
||||
</div>
|
||||
</div>
|
||||
<div class="hr-line-dashed"></div>
|
||||
<div class="form-group">
|
||||
<div class="col-sm-4 col-sm-offset-2">
|
||||
<button class="btn btn-success" type="button" id="add"><i
|
||||
class="fa fa-fw fa-lg fa-eye"></i><span langtag="info-save">保存</span>
|
||||
</button>
|
||||
<button class="btn btn-success" type="button" onclick="submitform('edit', '{{.web_base_url}}/index/edithost', $('form').serializeArray())">
|
||||
<i class="fa fa-fw fa-lg fa-save"></i> <span langtag="word-save"></span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
@@ -113,19 +103,6 @@
|
||||
|
||||
<script>
|
||||
$(function () {
|
||||
$("#add").on("click", function () {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "{{.web_base_url}}/index/edithost",
|
||||
data: $("form").serializeArray(),
|
||||
success: function (res) {
|
||||
alert(res.msg)
|
||||
if (res.status) {
|
||||
history.back(-1)
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
$("#scheme_select").on("change", function () {
|
||||
if ($("#scheme_select").val() == "all" || $("#scheme_select").val() == "https") {
|
||||
$("#cert_file").css("display", "block")
|
||||
|
@@ -136,6 +136,3 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</main>
|
||||
|
115
web/views/index/hlist.html
Executable file → Normal file
115
web/views/index/hlist.html
Executable file → Normal file
@@ -4,7 +4,7 @@
|
||||
<div class="col-lg-12">
|
||||
<div class="ibox float-e-margins">
|
||||
<div class="ibox-title">
|
||||
<h5>host list</h5>
|
||||
<h5 langtag="page-hostlist"></h5>
|
||||
|
||||
<div class="ibox-tools">
|
||||
<a class="collapse-link">
|
||||
@@ -18,9 +18,8 @@
|
||||
<div class="content">
|
||||
<div class="table-responsive">
|
||||
<div id="toolbar">
|
||||
<a href="{{.web_base_url}}/index/addhost?vkey={{.task_id}}&client_id={{.client_id}}"
|
||||
class="btn btn-primary dim"
|
||||
type="button" langtag="info-new">新增</a>
|
||||
<a href="{{.web_base_url}}/index/addhost?vkey={{.task_id}}&client_id={{.client_id}}" class="btn btn-primary dim">
|
||||
<i class="fa fa-fw fa-lg fa-plus"></i> <span langtag="word-add"></span></a>
|
||||
</div>
|
||||
<table id="taskList_table" class="table-striped table-hover"
|
||||
data-mobile-responsive="true"></table>
|
||||
@@ -61,118 +60,102 @@
|
||||
pageList: [5, 10, 20, 50],//分页步进值
|
||||
detailView: true,
|
||||
smartDisplay: true, // 智能显示 pagination 和 cardview 等
|
||||
onExpandRow: function () {$('body').setLang ('.detail-view');},
|
||||
onPostBody: function (data) { if ($(this)[0].locale != undefined ) $('body').setLang ('#table'); },
|
||||
detailFormatter: function (index, row, element) {
|
||||
return '<b langtag="info-export-flow">出口流量</b>:' + change(row.Flow.ExportFlow) + `       `
|
||||
+ '<b langtag="info-inlet-flow">入口流量</b>:' + change(row.Flow.InletFlow) + `       `
|
||||
+ '<b langtag="info-crypt">加密</b>:' + row.Client.Cnf.Crypt + `       `
|
||||
+ '<b langtag="info-compress">压缩</b>:' + row.Client.Cnf.Compress + `       ` + "<br/><br>"
|
||||
+ '<b langtag="info-web-auth-username">basic权限认证用户名</b>:' + row.Client.Cnf.U + `       `
|
||||
+ '<b langtag="info-web-auth-password">basic权限认证密码</b>:' + row.Client.Cnf.P + `       ` + "<br/><br>"
|
||||
+ '<b langtag="info-https-cert">cert file路径</b>:' + row.CertFilePath + `       `
|
||||
+ '<b langtag="info-https-key">key file路径</b>:' + row.KeyFilePath + `       ` + "<br/><br>"
|
||||
+ '<b langtag="info-header-change">request header修改</b>:' + row.HeaderChange + `       ` + "<br/><br>"
|
||||
+ '<b langtag="info-host-change">request host 修改</b>:' + row.HostChange + `       `
|
||||
return '<b langtag="word-exportflow"></b>: ' + changeunit(row.Flow.ExportFlow) + ' '
|
||||
+ '<b langtag="word-inletflow"></b>: ' + changeunit(row.Flow.InletFlow) + ' '
|
||||
+ '<b langtag="word-crypt"></b>: ' + row.Client.Cnf.Crypt + ' '
|
||||
+ '<b langtag="word-compress"></b>: ' + row.Client.Cnf.Compress + ' '
|
||||
+ '<b langtag="word-basicusername"></b>: ' + row.Client.Cnf.U + ' '
|
||||
+ '<b langtag="word-basicpassword"></b>: ' + row.Client.Cnf.P + ' <br/><br>'
|
||||
+ '<b langtag="word-httpscert"></b>: ' + row.CertFilePath + ' '
|
||||
+ '<b langtag="word-httpskey"></b>: ' + row.KeyFilePath + ' <br/><br>'
|
||||
+ '<b langtag="word-requestheader"></b>: ' + row.HeaderChange + ' <br/><br>'
|
||||
+ '<b langtag="word-requesthost"></b>: ' + row.HostChange + ' '
|
||||
},
|
||||
//表格的列
|
||||
columns: [
|
||||
{
|
||||
field: 'Id',//域值
|
||||
title: 'id',//标题
|
||||
visible: true,//false表示不显示
|
||||
|
||||
title: '<span langtag="word-id"></span>',//标题
|
||||
halign: 'center',
|
||||
visible: true//false表示不显示
|
||||
},
|
||||
{
|
||||
field: 'Id',//域值
|
||||
title: 'client id',//标题
|
||||
title: '<span langtag="word-clientid"></span>',//标题
|
||||
halign: 'center',
|
||||
visible: true,//false表示不显示
|
||||
|
||||
formatter: function (value, row, index) {
|
||||
return row.Client.Id
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'Remark',//域值
|
||||
title: 'remark',//标题
|
||||
visible: true,//false表示不显示
|
||||
|
||||
title: '<span langtag="word-remark"></span>',//标题
|
||||
halign: 'center',
|
||||
visible: true//false表示不显示
|
||||
},
|
||||
{
|
||||
field: 'Host',//域值
|
||||
title: 'host',//标题
|
||||
visible: true,//false表示不显示
|
||||
|
||||
title: '<span langtag="word-host"></span>',//标题
|
||||
halign: 'center',
|
||||
visible: true//false表示不显示
|
||||
},
|
||||
{
|
||||
field: 'Scheme',//域值
|
||||
title: 'scheme',//标题
|
||||
title: '<span langtag="word-scheme"></span>',//标题
|
||||
halign: 'center',
|
||||
visible: true,//false表示不显示
|
||||
|
||||
formatter: function (value, row, index) {
|
||||
return '<span langtag="word-' +value+ '"></span>'
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'Target',//域值
|
||||
title: 'target',//标题
|
||||
title: '<span langtag="word-target"></span>',//标题
|
||||
halign: 'center',
|
||||
visible: true,//false表示不显示
|
||||
|
||||
formatter: function (value, row, index) {
|
||||
return row.Target.TargetStr
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'Location',//域值
|
||||
title: 'location',//标题
|
||||
visible: true,//false表示不显示
|
||||
|
||||
title: '<span langtag="word-location"></span>',//标题
|
||||
halign: 'center',
|
||||
visible: true//false表示不显示
|
||||
},
|
||||
{
|
||||
field: '',//域值
|
||||
title: 'client status',//内容
|
||||
title: '<span langtag="word-clientstatus"></span>',//内容
|
||||
align: 'center',
|
||||
halign: 'center',
|
||||
visible: true,//false表示不显示
|
||||
|
||||
formatter: function (value, row, index) {
|
||||
if (row.Client.IsConnect) {
|
||||
return '<span class="badge badge-primary">online</span>'
|
||||
return '<span class="badge badge-primary" langtag="word-online"></span>'
|
||||
} else {
|
||||
return '<span class="badge badge-badge">offline</span>'
|
||||
return '<span class="badge badge-badge" langtag="word-offline"></span>'
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'option',//域值
|
||||
title: 'option',//内容
|
||||
title: '<span langtag="word-option"></span>',//内容
|
||||
align: 'center',
|
||||
halign: 'center',
|
||||
visible: true,//false表示不显示
|
||||
|
||||
formatter: function (value, row, index) {
|
||||
btn_group = '<div class="btn-group">'
|
||||
btn = `<button onclick="del(` + row.Id + `)" class="btn-danger"><i class="fa fa-trash"></i></button><button onclick="edit(` + row.Id + `)" class="btn-primary"><i class="fa fa-edit"></i></button></div>`
|
||||
return btn_group + btn
|
||||
btn_group += "<a onclick=\"submitform('delete', '{{.web_base_url}}/index/delhost', {'id':" + row.Id
|
||||
btn_group += '})" class="btn btn-outline btn-danger"><i class="fa fa-trash"></i></a>'
|
||||
btn_group += '<a href="{{.web_base_url}}/index/edithost?id=' + row.Id
|
||||
btn_group += '" class="btn btn-outline btn-success"><i class="fa fa-edit"></i></a></div>'
|
||||
return btn_group
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
function del(id) {
|
||||
if (confirm("Are you sure you want to delete it??")) {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "{{.web_base_url}}/index/delhost",
|
||||
data: {"id": id},
|
||||
success: function (res) {
|
||||
alert(res.msg)
|
||||
if (res.status) {
|
||||
document.location.reload();
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
function edit(id) {
|
||||
window.location.href = "{{.web_base_url}}/index/edithost?id=" + id
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
|
835
web/views/index/index.html
Executable file → Normal file
835
web/views/index/index.html
Executable file → Normal file
File diff suppressed because it is too large
Load Diff
176
web/views/index/list.html
Executable file → Normal file
176
web/views/index/list.html
Executable file → Normal file
@@ -4,7 +4,7 @@
|
||||
<div class="col-lg-12">
|
||||
<div class="ibox float-e-margins">
|
||||
<div class="ibox-title">
|
||||
<h5>{{.name}}</h5>
|
||||
<h5><span id="langtag"></span><span></span></h5>
|
||||
|
||||
<div class="ibox-tools">
|
||||
<a class="collapse-link">
|
||||
@@ -18,11 +18,10 @@
|
||||
<div class="content">
|
||||
<div class="table-responsive">
|
||||
<div id="toolbar">
|
||||
<a href="{{.web_base_url}}/index/add?type={{.type}}&client_id={{.client_id}}" class="btn btn-primary dim"
|
||||
type="button" langtag="info-new">新增</a>
|
||||
<a href="{{.web_base_url}}/index/add?type={{.type}}&client_id={{.client_id}}" class="btn btn-primary dim">
|
||||
<i class="fa fa-fw fa-lg fa-plus"></i> <span langtag="word-add"></span></a>
|
||||
</div>
|
||||
<table id="taskList_table" class="table-striped table-hover"
|
||||
data-mobile-responsive="true"></table>
|
||||
<table id="taskList_table" class="table-striped table-hover" data-mobile-responsive="true"></table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ibox-content">
|
||||
@@ -36,6 +35,9 @@
|
||||
</div>
|
||||
|
||||
<script>
|
||||
name = '{{.name}}:'.replace(/\s*/g,"")
|
||||
$('#langtag').attr('langtag','page-list' + name.replace(/:.*/,"")).next().text(name.split(":")[1])
|
||||
|
||||
/*bootstrap table*/
|
||||
$('#table').bootstrapTable({
|
||||
toolbar: "#toolbar",
|
||||
@@ -62,22 +64,29 @@
|
||||
pageList: [5, 10, 20, 50],//分页步进值
|
||||
detailView: true,
|
||||
smartDisplay: true, // 智能显示 pagination 和 cardview 等
|
||||
onExpandRow: function () {$('body').setLang ('.detail-view');},
|
||||
onLoadSuccess:function (data) {$('body').setLang ('.detail-view');},
|
||||
onPostBody: function (data) { if ($(this)[0].locale != undefined ) $('body').setLang ('#table'); },
|
||||
detailFormatter: function (index, row, element) {
|
||||
tmp = '<b langtag="info-export-flow">出口流量</b>:' + change(row.Flow.ExportFlow) + `       `
|
||||
+ '<b langtag="info-inlet-flow">入口流量</b>:' + change(row.Flow.InletFlow) + `       `
|
||||
+ '<b langtag="info-crypt">加密</b>:' + row.Client.Cnf.Crypt + `       `
|
||||
+ '<b langtag="info-compress">压缩</b>:' + row.Client.Cnf.Compress + `       `
|
||||
+ '<b langtag="info-web-auth-username">basic权限认证用户名</b>:' + row.Client.Cnf.U + `       `
|
||||
+ '<b langtag="info-web-auth-password">basic权限认证密码</b>:' + row.Client.Cnf.P + `       `
|
||||
tmp = '<b langtag="word-exportflow"></b>: ' + changeunit(row.Flow.ExportFlow) + ' '
|
||||
+ '<b langtag="word-inletflow"></b>: ' + changeunit(row.Flow.InletFlow) + ' '
|
||||
+ '<b langtag="word-crypt"></b>: ' + row.Client.Cnf.Crypt + ' '
|
||||
+ '<b langtag="word-compress"></b>: ' + row.Client.Cnf.Compress + ' '
|
||||
+ '<b langtag="word-basicusername"></b>: ' + row.Client.Cnf.U + ' '
|
||||
+ '<b langtag="word-basicpassword"></b>: ' + row.Client.Cnf.P + ' '
|
||||
if (row.Mode == "p2p") {
|
||||
return tmp + "<br/><br>"
|
||||
+ '<b langtag="info-command">访问端命令(tcp)</b>:' + "<code>./npc{{.win}} -server={{.ip}}:{{.p}} -vkey=" + row.Client.VerifyKey + " -type=" +{{.bridgeType}} +" -password=" + row.Password + " -target=" + row.Target.TargetStr + "</code>" + "<br/><br>"
|
||||
+ '<b langtag="info-command">访问端命令(socks5)</b>:' + "<code>./npc{{.win}} -server={{.ip}}:{{.p}} -vkey=" + row.Client.VerifyKey + " -type=" +{{.bridgeType}} +" -password=" + row.Password + " -local_type=p2ps" + "</code>" + "<br/><br>"
|
||||
+ '<b langtag="info-command">访问端命令(透明代理)</b>:' + "<code>./npc{{.win}} -server={{.ip}}:{{.p}} -vkey=" + row.Client.VerifyKey + " -type=" +{{.bridgeType}} +" -password=" + row.Password + " -local_type=p2pt" + "</code>"
|
||||
+ '<b langtag="word-commandaccessp2p"></b>: ' + "<code>./npc{{.win}} -server={{.ip}}:{{.p}} -vkey=" + row.Client.VerifyKey
|
||||
+ " -type=" +{{.bridgeType}} +" -password=" + row.Password + " -target=" + row.Target.TargetStr + "</code>" + "<br/><br>"
|
||||
+ '<b langtag="word-commandaccessp2ps"></b>: ' + "<code>./npc{{.win}} -server={{.ip}}:{{.p}} -vkey=" + row.Client.VerifyKey
|
||||
+ " -type=" +{{.bridgeType}} +" -password=" + row.Password + " -local_type=p2ps" + "</code>" + "<br/><br>"
|
||||
+ '<b langtag="word-commandaccessp2pt"></b>: ' + "<code>./npc{{.win}} -server={{.ip}}:{{.p}} -vkey=" + row.Client.VerifyKey
|
||||
+ " -type=" +{{.bridgeType}} +" -password=" + row.Password + " -local_type=p2pt" + "</code>"
|
||||
|
||||
}
|
||||
if (row.Mode = "secret") {
|
||||
return tmp + "<br/><br>" + '<b langtag="info-command">访问端命令</b>:' + "<code>./npc{{.win}} -server={{.ip}}:{{.p}} -vkey=" + row.Client.VerifyKey + " -type=" +{{.bridgeType}} +" -password=" + row.Password + " -local_type=secret" + "</code>"
|
||||
if (row.Mode == "secret") {
|
||||
return tmp + "<br/><br>" + '<b langtag="word-commandaccess"></b>: ' + "<code>./npc{{.win}} -server={{.ip}}:{{.p}} -vkey=" + row.Client.VerifyKey
|
||||
+ " -type=" +{{.bridgeType}} +" -password=" + row.Password + " -local_type=secret" + "</code>"
|
||||
}
|
||||
return tmp
|
||||
},
|
||||
@@ -85,12 +94,14 @@
|
||||
columns: [
|
||||
{
|
||||
field: 'Id',//域值
|
||||
title: 'id',//标题
|
||||
visible: true,//false表示不显示
|
||||
title: '<span langtag="word-id"></span>',//标题
|
||||
halign: 'center',
|
||||
visible: true//false表示不显示
|
||||
},
|
||||
{
|
||||
field: 'Id',//域值
|
||||
title: 'client id',//标题
|
||||
title: '<span langtag="word-clientid"></span>',//标题
|
||||
halign: 'center',
|
||||
visible: true,//false表示不显示
|
||||
formatter: function (value, row, index) {
|
||||
return row.Client.Id
|
||||
@@ -98,22 +109,29 @@
|
||||
},
|
||||
{
|
||||
field: 'Remark',//域值
|
||||
title: 'remark',//标题
|
||||
visible: true,//false表示不显示
|
||||
title: '<span langtag="word-remark"></span>',//标题
|
||||
halign: 'center',
|
||||
visible: true//false表示不显示
|
||||
},
|
||||
{
|
||||
field: 'Mode',//域值
|
||||
title: 'mode',//标题
|
||||
title: '<span langtag="word-scheme"></span>',//标题
|
||||
halign: 'center',
|
||||
visible: true,//false表示不显示
|
||||
formatter: function (value, row, index) {
|
||||
return '<span langtag="scheme-' + value + '"></span>'
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'Port',//域值
|
||||
title: 'port',//标题
|
||||
visible: true,//false表示不显示
|
||||
title: '<span langtag="word-port"></span>',//标题
|
||||
halign: 'center',
|
||||
visible: true//false表示不显示
|
||||
},
|
||||
{
|
||||
field: 'Target',//域值
|
||||
title: 'target',//标题
|
||||
title: '<span langtag="word-target"></span>',//标题
|
||||
halign: 'center',
|
||||
visible: true,//false表示不显示
|
||||
formatter: function (value, row, index) {
|
||||
return row.Target.TargetStr
|
||||
@@ -121,122 +139,74 @@
|
||||
},
|
||||
{
|
||||
field: 'Password',//域值
|
||||
title: 'secret',//标题
|
||||
visible: true,//false表示不显示
|
||||
|
||||
title: '<span langtag="word-identificationkey"></span>',//标题
|
||||
halign: 'center',
|
||||
visible: true//false表示不显示
|
||||
},
|
||||
{
|
||||
field: 'Status',//域值
|
||||
title: 'setting',//内容
|
||||
title: '<span langtag="word-status"></span>',//内容
|
||||
align: 'center',
|
||||
halign: 'center',
|
||||
visible: true,//false表示不显示
|
||||
|
||||
formatter: function (value, row, index) {
|
||||
if (value) {
|
||||
return '<span class="badge badge-primary">open</span>'
|
||||
return '<span class="badge badge-primary" langtag="word-open"></span>'
|
||||
} else {
|
||||
return '<span class="badge badge-badge">close</span>'
|
||||
return '<span class="badge badge-badge" langtag="word-close"></span>'
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'RunStatus',//域值
|
||||
title: 'run',//内容
|
||||
title: '<span langtag="word-runstatus"></span>',//内容
|
||||
align: 'center',
|
||||
halign: 'center',
|
||||
visible: true,//false表示不显示
|
||||
|
||||
formatter: function (value, row, index) {
|
||||
if (value) {
|
||||
return '<span class="badge badge-primary">open</span>'
|
||||
return '<span class="badge badge-primary" langtag="word-open"></span>'
|
||||
} else {
|
||||
return '<span class="badge badge-badge">close</span>'
|
||||
return '<span class="badge badge-badge" langtag="word-close"></span>'
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
field: '',//域值
|
||||
title: 'client',//内容
|
||||
title: '<span langtag="word-clientstatus"></span>',//内容
|
||||
align: 'center',
|
||||
halign: 'center',
|
||||
visible: true,//false表示不显示
|
||||
|
||||
formatter: function (value, row, index) {
|
||||
if (row.Client.IsConnect) {
|
||||
return '<span class="badge badge-primary">online</span>'
|
||||
return '<span class="badge badge-primary" langtag="word-online"></span>'
|
||||
} else {
|
||||
return '<span class="badge badge-badge">offline</span>'
|
||||
return '<span class="badge badge-badge" langtag="word-offline"></span>'
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'option',//域值
|
||||
title: 'option',//内容
|
||||
title: '<span langtag="word-option"></span>',//内容
|
||||
align: 'center',
|
||||
halign: 'center',
|
||||
visible: true,//false表示不显示
|
||||
|
||||
formatter: function (value, row, index) {
|
||||
btn_group = '<div class="btn-group">'
|
||||
btn = `<button onclick="del(` + row.Id + `)" class="btn-danger"><i class="fa fa-trash"></i></button><button onclick="edit(` + row.Id + `)" class="btn-primary"><i class="fa fa-edit"></i></button></div>`
|
||||
if (row.Status) {
|
||||
return btn_group + `<button onclick="stop(` + row.Id + `)" class="btn-dark"><i class="fa fa-close"></i></button>` + btn
|
||||
btn_group += "<a onclick=\"submitform('stop', '{{.web_base_url}}/index/stop', {'id':" + row.Id
|
||||
btn_group += '})" class="btn btn-outline btn-warning"><i class="fa fa-pause"></i></a>'
|
||||
} else {
|
||||
return btn_group + `<button onclick="start(` + row.Id + `)" class="btn-outline-primary"><i class="fa fa-check"></i></button>` + btn
|
||||
btn_group += "<a onclick=\"submitform('start', '{{.web_base_url}}/index/start', {\'id\':" + row.Id
|
||||
btn_group += '})" class="btn btn-outline btn-primary"><i class="fa fa-play"></i></a>'
|
||||
}
|
||||
btn_group += "<a onclick=\"submitform('delete', '{{.web_base_url}}/index/del', {'id':" + row.Id
|
||||
btn_group += '})" class="btn btn-outline btn-danger"><i class="fa fa-trash"></i></a>'
|
||||
btn_group += '<a href="{{.web_base_url}}/index/edit?id=' + row.Id
|
||||
btn_group += '" class="btn btn-outline btn-success"><i class="fa fa-edit"></i></a></div>'
|
||||
return btn_group
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
function del(id) {
|
||||
if (confirm("Are you sure you want to delete it??")) {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "{{.web_base_url}}/index/del",
|
||||
data: {"id": id},
|
||||
success: function (res) {
|
||||
alert(res.msg)
|
||||
if (res.status) {
|
||||
document.location.reload();
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
function start(id) {
|
||||
if (confirm("Are you sure you want to start it??")) {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "{{.web_base_url}}/index/start",
|
||||
data: {"id": id},
|
||||
success: function (res) {
|
||||
alert(res.msg)
|
||||
if (res.status) {
|
||||
document.location.reload();
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
function stop(id) {
|
||||
if (confirm("Are you sure you want to stop it??")) {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "{{.web_base_url}}/index/stop",
|
||||
data: {"id": id},
|
||||
success: function (res) {
|
||||
alert(res.msg)
|
||||
if (res.status) {
|
||||
document.location.reload();
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
function edit(id) {
|
||||
window.location.href = "{{.web_base_url}}/index/edit?id=" + id
|
||||
}
|
||||
|
||||
</script>
|
||||
|
70
web/views/login/index.html
Executable file → Normal file
70
web/views/login/index.html
Executable file → Normal file
@@ -6,64 +6,86 @@
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>nps admin login</title>
|
||||
<title langtag="title-login"></title>
|
||||
|
||||
<!-- Mainly scripts -->
|
||||
<!-- Latest compiled and minified CSS -->
|
||||
<link href="{{.web_base_url}}/static/css/fontawesome.min.css" rel="stylesheet">
|
||||
<link href="{{.web_base_url}}/static/css/solid.min.css" rel="stylesheet">
|
||||
<link href="{{.web_base_url}}/static/css/bootstrap.min.css" rel="stylesheet">
|
||||
<link href="{{.web_base_url}}/static/font-awesome/css/font-awesome.css" rel="stylesheet">
|
||||
|
||||
<link href="{{.web_base_url}}/static/css/style.css" rel="stylesheet">
|
||||
|
||||
<!-- Latest compiled and minified JavaScript -->
|
||||
<script src="{{.web_base_url}}/static/js/jquery-3.4.1.min.js"></script>
|
||||
<script src="{{.web_base_url}}/static/js/bootstrap.min.js"></script>
|
||||
<!-- Latest compiled and minified Locales -->
|
||||
<script src="{{.web_base_url}}/static/js/language.js" type="text/javascript"></script>
|
||||
|
||||
</head>
|
||||
|
||||
<body class="gray-bg">
|
||||
|
||||
<div class="row border-bottom">
|
||||
<nav class="navbar navbar-static-top navbar-right" role="navigation" style="margin: 20px 40px">
|
||||
<div></div>
|
||||
<h1 style="margin:0px" class="navbar-header font-bold" langtag="application"></h1>
|
||||
<span class="btn-group dropdown">
|
||||
<button id="languagemenu" class="btn btn-primary dropdown-toggle" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><i class="fa fa-globe-asia fa-lg"></i><span></span></button>
|
||||
<ul class="dropdown-menu"></ul>
|
||||
</span>
|
||||
</nav>
|
||||
</div>
|
||||
<div class="loginColumns animated fadeInDown">
|
||||
<div class="row">
|
||||
|
||||
|
||||
<div class="col-md-offset-3 col-md-6">
|
||||
<h2 class="font-bold">nps</h2>
|
||||
<div class="col-md-6">
|
||||
|
||||
<p>
|
||||
A convenient proxy server
|
||||
</p>
|
||||
<h3 langtag="info-tagline"></h3>
|
||||
|
||||
<p>
|
||||
Using it, it can penetrate the intranet tcp、udp、socks5、http、p2p and so on
|
||||
</p>
|
||||
<li langtag="info-feature1"></li>
|
||||
<li langtag="info-feature2"></li>
|
||||
<li langtag="info-feature3"></li>
|
||||
<li langtag="info-feature4"></li>
|
||||
<li langtag="info-feature5"></li>
|
||||
<li langtag="info-feature6"></li>
|
||||
<li langtag="info-feature7"></li>
|
||||
<li langtag="info-feature8"></li>
|
||||
<li langtag="info-feature9"></li>
|
||||
|
||||
<p>
|
||||
and more?
|
||||
</p>
|
||||
|
||||
<p>
|
||||
goto <a href="//ehang.io/nps">nps</a>
|
||||
</p>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="ibox-content">
|
||||
<form class="m-t" onsubmit="return false">
|
||||
<div class="form-group">
|
||||
<input name="username" class="form-control" placeholder="username" required="">
|
||||
<input name="username" class="form-control" placeholder="username" required="" langtag="word-username">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input name="password" type="password" class="form-control" placeholder="password" required="">
|
||||
<input name="password" type="password" class="form-control" placeholder="password" required="" langtag="word-password">
|
||||
</div>
|
||||
<button onclick="login()" class="btn btn-primary block full-width m-b">login</button>
|
||||
<button onclick="login()" class="btn btn-primary block full-width m-b" langtag="word-login"></button>
|
||||
{{if eq true .register_allow}}
|
||||
<a class="btn btn-sm btn-white btn-block" href="{{.web_base_url}}/login/register">register</a>
|
||||
<p class="text-muted text-center"><small langtag="info-noaccount"></small></p>
|
||||
<a class="btn btn-sm btn-white btn-block" href="{{.web_base_url}}/login/register" langtag="word-register"></a>
|
||||
{{end}}
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<hr/>
|
||||
<div class="footer">
|
||||
<div class="pull-right">
|
||||
<span langtag="word-readmore"></span> <strong><a href="https://ehang.io/nps" langtag="word-go"></a></strong>
|
||||
</div>
|
||||
<div><strong langtag="word-copyright"></strong> <span langtag="application"></span> © 2018-2019</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
<script src="{{.web_base_url}}/static/js/jquery-2.1.1.js"></script>
|
||||
</html>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
window.nps = { "web_base_url": {{.web_base_url}} }
|
||||
// Login Page Flipbox control
|
||||
function login() {
|
||||
$.ajax({
|
||||
|
@@ -6,41 +6,60 @@
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>nps register</title>
|
||||
<title langtag="title-register"></title>
|
||||
|
||||
<!-- Mainly scripts -->
|
||||
<!-- Latest compiled and minified CSS -->
|
||||
<link href="{{.web_base_url}}/static/css/fontawesome.min.css" rel="stylesheet">
|
||||
<link href="{{.web_base_url}}/static/css/solid.min.css" rel="stylesheet">
|
||||
<link href="{{.web_base_url}}/static/css/bootstrap.min.css" rel="stylesheet">
|
||||
<link href="{{.web_base_url}}/static/font-awesome/css/font-awesome.css" rel="stylesheet">
|
||||
|
||||
<link href="{{.web_base_url}}/static/css/style.css" rel="stylesheet">
|
||||
|
||||
<!-- Latest compiled and minified JavaScript -->
|
||||
<script src="{{.web_base_url}}/static/js/jquery-3.4.1.min.js"></script>
|
||||
<script src="{{.web_base_url}}/static/js/bootstrap.min.js"></script>
|
||||
<!-- Latest compiled and minified Locales -->
|
||||
<script src="{{.web_base_url}}/static/js/language.js" type="text/javascript"></script>
|
||||
|
||||
</head>
|
||||
|
||||
<body class="gray-bg">
|
||||
|
||||
<div class="middle-box text-center loginscreen animated fadeInDown">
|
||||
<div>
|
||||
<div class="row border-bottom">
|
||||
<nav class="navbar navbar-static-top navbar-right" role="navigation" style="margin: 20px 40px">
|
||||
<div></div>
|
||||
<span class="btn-group dropdown">
|
||||
<button id="languagemenu" class="btn btn-primary dropdown-toggle" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><i class="fa fa-globe-asia fa-lg"></i><span></span></button>
|
||||
<ul class="dropdown-menu"></ul>
|
||||
</span>
|
||||
</nav>
|
||||
</div>
|
||||
<div class="middle-box text-center loginscreen animated fadeInDown">
|
||||
<div>
|
||||
|
||||
<h1 class="logo-name">NPS</h1>
|
||||
|
||||
<h1 class="logo-name" langtag="application"></h1>
|
||||
</div>
|
||||
<h3>register NPS</h3>
|
||||
<h3 langtag="info-register"></h3>
|
||||
<p langtag="info-createaccount"></p>
|
||||
<form class="m-t" role="form" onsubmit="return false">
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" placeholder="username" name="username" required="">
|
||||
<input type="text" class="form-control" placeholder="username" name="username" required="" langtag="word-username">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="password" class="form-control" placeholder="password" name="password" required="">
|
||||
<input type="password" class="form-control" placeholder="password" name="password" required="" langtag="word-password">
|
||||
</div>
|
||||
<button onclick="register()" type="submit" class="btn btn-primary block full-width m-b">register</button>
|
||||
|
||||
<a class="btn btn-sm btn-white btn-block" href="{{.web_base_url}}/login/index">login</a>
|
||||
<button onclick="register()" type="submit" class="btn btn-primary block full-width m-b" langtag="word-register"></button>
|
||||
<p class="text-muted text-center"><small langtag="info-haveaccount"></small></p>
|
||||
<a class="btn btn-sm btn-white btn-block" href="{{.web_base_url}}/login/index" langtag="word-login"></a>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="{{.web_base_url}}/static/js/jquery-2.1.1.js"></script>
|
||||
<hr/>
|
||||
<div class="footer">
|
||||
<div class="pull-right">
|
||||
<span langtag="word-readmore"></span> <strong><a href="https://ehang.io/nps" langtag="word-go"></a></strong>
|
||||
</div>
|
||||
<div><strong langtag="word-copyright"></strong> <span langtag="application"></span> © 2018-2019</div>
|
||||
</div>
|
||||
<script>
|
||||
window.nps = { "web_base_url": {{.web_base_url}} }
|
||||
function register() {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
|
0
web/views/public/error.html
Executable file → Normal file
0
web/views/public/error.html
Executable file → Normal file
155
web/views/public/layout.html
Executable file → Normal file
155
web/views/public/layout.html
Executable file → Normal file
@@ -7,152 +7,147 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
|
||||
<title>nps admin</title>
|
||||
<title langtag="title-admin"></title>
|
||||
|
||||
<link href="{{.web_base_url}}/static/css/bootstrap.min.css" rel="stylesheet">
|
||||
<link href="{{.web_base_url}}/static/font-awesome/css/font-awesome.css" rel="stylesheet">
|
||||
<link href="{{.web_base_url}}/static/css/style.css" rel="stylesheet">
|
||||
<script src="{{.web_base_url}}/static/js/main.js"></script>
|
||||
<!-- Mainly scripts -->
|
||||
<script src="{{.web_base_url}}/static/js/jquery-2.1.1.js"></script>
|
||||
<script src="{{.web_base_url}}/static/js/bootstrap.min.js"></script>
|
||||
<script src="{{.web_base_url}}/static/js/echarts.min.js"></script>
|
||||
<!-- Latest compiled and minified CSS -->
|
||||
<link rel="stylesheet" href="{{.web_base_url}}/static/css/bootstrap-table.min.css">
|
||||
<link href="{{.web_base_url}}/static/css/fontawesome.min.css" rel="stylesheet">
|
||||
<link href="{{.web_base_url}}/static/css/solid.min.css" rel="stylesheet">
|
||||
<link href="{{.web_base_url}}/static/css/bootstrap.min.css" rel="stylesheet">
|
||||
<link href="{{.web_base_url}}/static/css/bootstrap-table.min.css" rel="stylesheet">
|
||||
<link href="{{.web_base_url}}/static/css/style.css" rel="stylesheet">
|
||||
|
||||
<!-- Latest compiled and minified JavaScript -->
|
||||
<script src="{{.web_base_url}}/static/js/jquery-3.4.1.min.js"></script>
|
||||
<script src="{{.web_base_url}}/static/js/popper.min.js"></script>
|
||||
<script src="{{.web_base_url}}/static/js/bootstrap.min.js"></script>
|
||||
<script src="{{.web_base_url}}/static/js/bootstrap-table.min.js"></script>
|
||||
<script src="{{.web_base_url}}/static/js/bootstrap-table-locale-all.min.js"></script>
|
||||
<script src="{{.web_base_url}}/static/js/echarts.min.js"></script>
|
||||
<script src="{{.web_base_url}}/static/js/inspinia.js"></script>
|
||||
<!-- Latest compiled and minified Locales -->
|
||||
<script src="{{.web_base_url}}/static/js/langchange.js" type="text/javascript"></script>
|
||||
<script src="{{.web_base_url}}/static/js/language.js" type="text/javascript"></script>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<body class="pace-done fixed-nav fixed-nav-basic">
|
||||
<div id="wrapper">
|
||||
<nav class="navbar-default navbar-static-side" style="position: fixed" role="navigation">
|
||||
<nav class="navbar-default navbar-static-side" role="navigation">
|
||||
<div class="sidebar-collapse">
|
||||
<ul class="nav metismenu" id="side-menu">
|
||||
<li class="nav-header">
|
||||
<div class="dropdown profile-element"> <span>
|
||||
{{/*<img alt="image" class="img-circle" src="{{.web_base_url}}/static/img/profile_small.jpg"/>*/}}
|
||||
</span>
|
||||
<a href="#">
|
||||
<span class="clear"> <span class="block m-t-xs"> <strong class="font-bold">
|
||||
{{if eq true .isAdmin}}
|
||||
admin
|
||||
{{else}}
|
||||
{{.username}}
|
||||
{{end}}
|
||||
</strong>
|
||||
</span> <span class="text-muted text-xs block">system </span> </span>
|
||||
</a>
|
||||
</div>
|
||||
<div class="logo-element">
|
||||
NPS
|
||||
<div class="dropdown profile-element">
|
||||
{{if eq true .isAdmin}}
|
||||
<span><i class="fa fa-user-cog fa-3x"></i></span>
|
||||
<span class="clear"> <span class="block m-t-xs"><strong class="font-bold" langtag="word-admin"></strong></span>
|
||||
<span class="text-muted text-xs block" langtag="word-system">
|
||||
{{else}}
|
||||
<span><i class="fa fa-user fa-3x"></i></span>
|
||||
<span class="clear"> <span class="block m-t-xs"><strong class="font-bold">{{.username}}</strong></span>
|
||||
<span class="text-muted text-xs block" langtag="word-user">
|
||||
{{end}}
|
||||
</span>
|
||||
</div>
|
||||
<div class="logo-element" langtag="application"></div>
|
||||
</li>
|
||||
<li class="{{if eq "index" .menu}}active{{end}}">
|
||||
<a href="{{.web_base_url}}/"><i class="fa fa-dashboard"></i> <span langtag="menu-dashboard"
|
||||
class="nav-label">仪表盘</span></a>
|
||||
<a href="{{.web_base_url}}/"><i class="fa fa-tachometer-alt fa-lg"></i>
|
||||
<span class="nav-label" langtag="word-dashboard"></span></a>
|
||||
</li>
|
||||
<li class="{{if eq "client" .menu}}active{{end}}">
|
||||
<a href="{{.web_base_url}}/client/list"><i class="fa fa-clipboard"></i> <span langtag="menu-client"
|
||||
class="nav-label">客户端</span></a>
|
||||
<a href="{{.web_base_url}}/client/list"><i class="fa fa-desktop fa-lg"></i>
|
||||
<span class="nav-label" langtag="word-client"></span></a>
|
||||
</li>
|
||||
<li class="{{if eq "host" .menu}}active{{end}}">
|
||||
<a href="{{.web_base_url}}/index/hostlist"><i class="fa fa-paperclip"></i> <span langtag="menu-host"
|
||||
class="nav-label">域名解析</span></a>
|
||||
<a href="{{.web_base_url}}/index/hostlist"><i class="fa fa-globe fa-lg"></i>
|
||||
<span class="nav-label" langtag="scheme-host"></span></a>
|
||||
</li>
|
||||
<li class="{{if eq "tcp" .menu}}active{{end}}">
|
||||
<a href="{{.web_base_url}}/index/tcp"><i class="fa fa-line-chart"></i> <span langtag="menu-tcp"
|
||||
class="nav-label">tcp隧道</span></a>
|
||||
<a href="{{.web_base_url}}/index/tcp"><i class="fa fa-retweet fa-lg"></i>
|
||||
<span class="nav-label" langtag="scheme-tcp"></span></a>
|
||||
</li>
|
||||
<li class="{{if eq "udp" .menu}}active{{end}}">
|
||||
<a href="{{.web_base_url}}/index/udp"><i class="fa fa-server"></i> <span langtag="menu-udp"
|
||||
class="nav-label">udp隧道</span></a>
|
||||
<a href="{{.web_base_url}}/index/udp"><i class="fa fa-random fa-lg"></i>
|
||||
<span class="nav-label" langtag="scheme-udp"></span></a>
|
||||
</li>
|
||||
<li class="{{if eq "http" .menu}}active{{end}}">
|
||||
<a href="{{.web_base_url}}/index/http"><i class="fa fa-html5"></i> <span langtag="menu-http"
|
||||
class="nav-label">http代理</span></a>
|
||||
<a href="{{.web_base_url}}/index/http"><i class="fa fa-server fa-lg"></i>
|
||||
<span class="nav-label" langtag="scheme-httpproxy"></span></a>
|
||||
</li>
|
||||
<li class="{{if eq "socks5" .menu}}active{{end}}">
|
||||
<a href="{{.web_base_url}}/index/socks5"><i class="fa fa-table"></i> <span langtag="menu-socks5" class="nav-label">socks5代理</span></a>
|
||||
<a href="{{.web_base_url}}/index/socks5"><i class="fa fa-layer-group fa-lg"></i>
|
||||
<span class="nav-label" langtag="scheme-socks5"></span></a>
|
||||
</li>
|
||||
<li class="{{if eq "secret" .menu}}active{{end}}">
|
||||
<a href="{{.web_base_url}}/index/secret"><i class="fa fa-backward"></i> <span langtag="menu-secret"
|
||||
class="nav-label">私密代理</span></a>
|
||||
<a href="{{.web_base_url}}/index/secret"><i class="fa fa-low-vision fa-lg"></i>
|
||||
<span class="nav-label" langtag="scheme-secret"></span></a>
|
||||
</li>
|
||||
<li class="{{if eq "p2p" .menu}}active{{end}}">
|
||||
<a href="{{.web_base_url}}/index/p2p"><i class="fa fa-dashcube"></i> <span langtag="menu-p2p"
|
||||
class="nav-label">p2p代理</span></a>
|
||||
<a href="{{.web_base_url}}/index/p2p"><i class="fa fa-exchange-alt fa-lg"></i>
|
||||
<span class="nav-label" langtag="scheme-p2p"></span></a>
|
||||
</li>
|
||||
<li class="{{if eq "file" .menu}}active{{end}}">
|
||||
<a href="{{.web_base_url}}/index/file"><i class="fa fa-laptop"></i> <span langtag="menu-file"
|
||||
class="nav-label">文件代理</span></a>
|
||||
<a href="{{.web_base_url}}/index/file"><i class="fa fa-briefcase fa-lg"></i>
|
||||
<span class="nav-label" langtag="scheme-file"></span></a>
|
||||
</li>
|
||||
<li class="{{if eq "help" .menu}}active{{end}}">
|
||||
<a href="{{.web_base_url}}/index/help"><i class="fa fa-lightbulb fa-lg"></i>
|
||||
<span class="nav-label" langtag="word-help"></span></a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
</nav>
|
||||
<div id="page-wrapper" class="gray-bg dashbard-1">
|
||||
<div id="page-wrapper" class="gray-bg">
|
||||
<div class="row border-bottom">
|
||||
<nav class="navbar navbar-static-top" role="navigation" style="margin-bottom: 0">
|
||||
<nav class="navbar white-bg navbar-fixed-top" role="navigation" style="margin-bottom: 0">
|
||||
|
||||
<div class="navbar-header">
|
||||
<a class="navbar-minimalize minimalize-styl-2 btn btn-primary " href="#"><i class="fa fa-bars"></i>
|
||||
</a>
|
||||
<a class="navbar-minimalize minimalize-styl-2 btn btn-primary " href="#"><i class="fa fa-bars"></i></a>
|
||||
</div>
|
||||
<ul class="nav navbar-top-links navbar-right">
|
||||
<li>
|
||||
<span class="m-r-sm text-muted welcome-message">Welcome to use <a
|
||||
href="https://ehang.io/nps">NPS</a></span>
|
||||
<span class="m-r-sm text-muted welcome-message"><span langtag="word-welcome"></span>
|
||||
<a href="https://ehang.io/nps" langtag="application"></a></span>
|
||||
</li>
|
||||
<li>
|
||||
<a id="lang-en">English</a>
|
||||
<span class="btn-group dropdown">
|
||||
<button id="languagemenu" class="btn btn-primary dropdown-toggle" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><i class="fa fa-globe-asia fa-lg"></i><span></span></button>
|
||||
<ul class="dropdown-menu"></ul>
|
||||
</span>
|
||||
</li>
|
||||
<li>
|
||||
<a id="langzh">简体中文</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="{{.web_base_url}}/login/out">
|
||||
<i class="fa fa-sign-out"></i> logout
|
||||
<i class="fa fa-sign-in-alt"></i><span langtag="word-logout"></span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
|
||||
{{.LayoutContent}}
|
||||
<div class="footer">
|
||||
<div class="pull-right">
|
||||
read more <strong><a href="https://ehang.io/nps">go</a></strong>
|
||||
</div>
|
||||
<div>
|
||||
<strong>Copyright</strong> nps © 2018-2019
|
||||
|
||||
<div class="footer fixed">
|
||||
<div class="float-right">
|
||||
<span langtag="word-readmore"></span> <strong><a href="https://ehang.io/nps" langtag="word-go"></a></strong>
|
||||
</div>
|
||||
<div><strong langtag="word-copyright"></strong> <span langtag="application"></span> © 2018-2019</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
<script>
|
||||
window.nps = {
|
||||
"web_base_url": {{.web_base_url}},
|
||||
}
|
||||
// googleTranslateElementInit()
|
||||
//
|
||||
// function googleTranslateElementInit() {
|
||||
// new google.translate.TranslateElement({
|
||||
// layout: google.translate.TranslateElement.InlineLayout.HORIZONTAL
|
||||
// }, 'wrapper');
|
||||
// }
|
||||
window.nps = { "web_base_url": {{.web_base_url}} }
|
||||
/* googleTranslateElementInit()
|
||||
|
||||
function googleTranslateElementInit() {
|
||||
new google.translate.TranslateElement({
|
||||
layout: google.translate.TranslateElement.InlineLayout.HORIZONTAL
|
||||
}, 'wrapper');
|
||||
}
|
||||
*/
|
||||
</script>
|
||||
{{/*<script src="http://translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>*/}}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user