nps/web/views/index/hedit.html
2019-02-03 00:54:43 +08:00

63 lines
2.9 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<div class="row tile">
<div class="col-md-6 col-md-auto">
<div>
<h3 class="tile-title">修改</h3>
<div class="tile-body">
<form>
<div class="form-group">
<label class="control-label">域名</label>
<input class="form-control" value="{{.h.Host}}" type="hidden" name="host" placeholder="域名">
<input class="form-control" value="{{.h.Host}}" type="text" name="nhost" placeholder="域名">
</div>
<div class="form-group">
<label class="control-label">备注</label>
<input class="form-control" value="{{.h.Remark}}" type="text" name="remark" placeholder="备注">
</div>
<div class="form-group">
<label class="control-label">客户端id</label>
<input class="form-control" value="{{.h.Client.Id}}" type="text" name="client_id"
placeholder="客户端id">
</div>
<div class="form-group">
<label class="control-label">内网目标</label>
<textarea class="form-control" rows="4" type="text" name="target"
placeholder="内网隧道目标例如10.1.50.203:22换行分隔">{{.h.Target}}</textarea>
</div>
<div class="form-group" id="header">
<label class="control-label">header头修改(冒号分隔多个请换行填写)</label>
<textarea class="form-control" rows="4" type="text" name="header"
placeholder="Cache-Control: no-cache">{{.h.HeaderChange}}</textarea>
</div>
<div class="form-group" id="hostchange">
<label class="control-label">host修改</label>
<input class="form-control" value="{{.h.HostChange}}" type="text" name="hostchange"
placeholder="host修改">
</div>
</form>
</div>
<div class="tile-footer">
&nbsp;&nbsp;<button class="btn btn-success" href="#" id="add"><i
class="fa fa-fw fa-lg fa-eye"></i>保存
</button>
</div>
</div>
</div>
</div>
</main>
<script>
$(function () {
$("#add").on("click", function () {
$.ajax({
type: "POST",
url: "/index/edithost",
data: $("form").serializeArray(),
success: function (res) {
alert(res.msg)
if (res.status) {
history.back(-1)
}
}
})
})
})
</script>