nps/web/views/client/edit.html

109 lines
5.7 KiB
Go
Raw Normal View History

<div class="row">
<div class="col-md-12 col-md-auto">
<div class="ibox float-e-margins">
<h3 class="ibox-title">add client</h3>
<div class="ibox-content">
<form class="form-horizontal">
2019-01-29 19:26:28 +00:00
<input type="hidden" name="id" value="{{.c.Id}}">
<div class="form-group" id="remark">
<label class="col-sm-2 control-label">remark</label>
<div class="col-sm-10">
<input class="form-control" value="{{.c.Remark}}" type="text" name="remark" placeholder="empty means to be unrestricted">
</div>
</div>
2019-01-28 06:45:55 +00:00
<div class="form-group" id="flow_limit">
<label class="col-sm-2 control-label">flow limitation</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>
</div>
2019-01-28 06:45:55 +00:00
</div>
2019-01-28 06:45:55 +00:00
<div class="form-group" id="rate_limit">
<label class="control-label col-sm-2">bandwidth limitation</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>
</div>
2019-01-28 06:45:55 +00:00
</div>
2019-02-23 15:29:48 +00:00
<div class="form-group" id="max_conn">
<label class="control-label col-sm-2">maximum number of client connections</label>
<div class="col-sm-10">
<input class="form-control" value="{{.c.MaxConn}}" type="text" name="max_conn"
placeholder="empty means to be unrestricted">
</div>
2019-02-23 15:29:48 +00:00
</div>
<div class="form-group" id="u">
<label class="control-label col-sm-2">web authentication username</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>
</div>
</div>
<div class="form-group" id="p">
<label class="control-label col-sm-2">web authentication password </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>
</div>
</div>
2019-02-24 05:17:43 +00:00
<div class="form-group" id="vkey">
<label class="control-label col-sm-2">client connection key</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>
</div>
2019-02-24 05:17:43 +00:00
</div>
<div class="form-group" id="compress">
<label class="control-label col-sm-2">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>
</select>
</div>
</div>
<div class="form-group" id="compress">
<label class="control-label col-sm-2">crypt</label>
<div class="col-sm-10">
<select class="form-control" name="crypt">
2019-03-04 05:41:20 +00:00
<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>
</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" href="#" id="add"><i
class="fa fa-fw fa-lg fa-eye"></i>save
</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
<script>
$(function () {
$("#add").on("click", function () {
$.ajax({
type: "POST",
url: "/client/edit",
data: $("form").serializeArray(),
success: function (res) {
alert(res.msg)
if (res.status) {
history.back(-1)
}
}
})
})
})
</script>