hadd.html 2.1 KB

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