nps/web/views/index/hedit.html

68 lines
3.1 KiB
Go
Raw Normal View History

2019-01-12 16:09:12 +00:00
<div class="row tile">
<div class="col-md-6 col-md-auto">
<div>
<h3 class="tile-title"></h3>
<div class="tile-body">
<form>
2019-02-15 14:59:28 +00:00
<input type="hidden" name="id" value="{{.h.Id}}">
2019-01-12 16:09:12 +00:00
<div class="form-group">
<label class="control-label"></label>
2019-02-15 14:59:28 +00:00
<input class="form-control" value="{{.h.Host}}" name="host" placeholder="域名">
</div>
<div class="form-group">
<label class="control-label">URL()</label>
<input class="form-control" value="{{.h.Location}}" type="text" name="location"
placeholder="URL路由">
2019-01-12 16:09:12 +00:00
</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>
2019-01-26 09:27:28 +00:00
<input class="form-control" value="{{.h.Client.Id}}" type="text" name="client_id"
placeholder="客户端id">
</div>
2019-01-12 16:09:12 +00:00
<div class="form-group">
<label class="control-label"></label>
2019-02-02 16:54:43 +00:00
<textarea class="form-control" rows="4" type="text" name="target"
placeholder="内网隧道目标例如10.1.50.203:22换行分隔">{{.h.Target}}</textarea>
2019-01-12 16:09:12 +00:00
</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>