mirror of
https://github.com/ehang-io/nps.git
synced 2025-09-02 11:56:53 +00:00
hzgjq
This commit is contained in:
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>
|
Reference in New Issue
Block a user