hedit.html 2.9 KB

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