hedit.html 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <div class="row tile">
  2. <div class="col-md-6 col-md-auto">
  3. <div>
  4. <h3 class="tile-title">修改</h3>
  5. <div class="tile-body">
  6. <form>
  7. <input type="hidden" name="id" value="{{.h.Id}}">
  8. <div class="form-group">
  9. <label class="control-label">域名</label>
  10. <input class="form-control" value="{{.h.Host}}" name="host" placeholder="域名">
  11. </div>
  12. <div class="form-group">
  13. <label class="control-label">URL路由(可忽略)</label>
  14. <input class="form-control" value="{{.h.Location}}" type="text" name="location"
  15. placeholder="URL路由">
  16. </div>
  17. <div class="form-group">
  18. <label class="control-label">备注</label>
  19. <input class="form-control" value="{{.h.Remark}}" type="text" name="remark" placeholder="备注">
  20. </div>
  21. <div class="form-group">
  22. <label class="control-label">客户端id</label>
  23. <input class="form-control" value="{{.h.Client.Id}}" type="text" name="client_id"
  24. placeholder="客户端id">
  25. </div>
  26. <div class="form-group">
  27. <label class="control-label">内网目标</label>
  28. <textarea class="form-control" rows="4" type="text" name="target"
  29. placeholder="内网隧道目标,例如10.1.50.203:22,换行分隔">{{.h.Target}}</textarea>
  30. </div>
  31. <div class="form-group" id="header">
  32. <label class="control-label">header头修改(冒号分隔,多个请换行填写)</label>
  33. <textarea class="form-control" rows="4" type="text" name="header"
  34. placeholder="Cache-Control: no-cache">{{.h.HeaderChange}}</textarea>
  35. </div>
  36. <div class="form-group" id="hostchange">
  37. <label class="control-label">host修改</label>
  38. <input class="form-control" value="{{.h.HostChange}}" type="text" name="hostchange"
  39. placeholder="host修改">
  40. </div>
  41. </form>
  42. </div>
  43. <div class="tile-footer">
  44. &nbsp;&nbsp;<button class="btn btn-success" href="#" id="add"><i
  45. class="fa fa-fw fa-lg fa-eye"></i>保存
  46. </button>
  47. </div>
  48. </div>
  49. </div>
  50. </div>
  51. </main>
  52. <script>
  53. $(function () {
  54. $("#add").on("click", function () {
  55. $.ajax({
  56. type: "POST",
  57. url: "/index/edithost",
  58. data: $("form").serializeArray(),
  59. success: function (res) {
  60. alert(res.msg)
  61. if (res.status) {
  62. history.back(-1)
  63. }
  64. }
  65. })
  66. })
  67. })
  68. </script>