edit.html 3.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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="{{.c.Id}}">
  8. <div class="form-group" id="target">
  9. <label class="control-label">备注</label>
  10. <input class="form-control" value="{{.c.Remark}}" type="text" name="remark" placeholder="客户端备注">
  11. </div>
  12. <div class="form-group" id="flow_limit">
  13. <label class="control-label">流量限制(单位:M,为空不限制)</label>
  14. <input class="form-control" value="{{.c.Flow.FlowLimit}}" type="text" name="flow_limit"
  15. placeholder="为空不限制">
  16. </div>
  17. <div class="form-group" id="rate_limit">
  18. <label class="control-label">速度限制(单位:KB,为空不限制)</label>
  19. <input class="form-control" value="{{.c.RateLimit}}" type="text" name="rate_limit"
  20. placeholder="为空不限制">
  21. </div>
  22. <div class="form-group" id="u">
  23. <label class="control-label">验证用户名(仅socks5,web穿透支持)</label>
  24. <input class="form-control" value="{{.c.Cnf.U}}" type="text" name="u"
  25. placeholder="不填则无需验证">
  26. </div>
  27. <div class="form-group" id="p">
  28. <label class="control-label">验证密码(仅socks5,web穿透支持)</label>
  29. <input class="form-control" value="{{.c.Cnf.P}}" type="text" name="p"
  30. placeholder="不填则无需验证">
  31. </div>
  32. <div class="form-group" id="compress">
  33. <label class="control-label">数据压缩方式(所有模式均支持)</label>
  34. <select class="form-control" name="compress">
  35. <option {{if eq "" .c.Cnf.Compress}}selected{{end}} value="">不压缩</option>
  36. <option {{if eq "snappy" .c.Cnf.Compress}}selected{{end}} value="snappy">snappy压缩</option>
  37. </select>
  38. </div>
  39. <div class="form-group" id="compress">
  40. <label class="control-label">是否加密传输(所有模式均支持)</label>
  41. <select class="form-control" name="crypt">
  42. <option {{if eq false .c.Cnf.Crypt}}selected{{end}} value="0">不加密</option>
  43. <option {{if eq true .c.Cnf.Crypt}}selected{{end}} value="1">加密</option>
  44. </select>
  45. </div>
  46. </form>
  47. </div>
  48. <div class="tile-footer">
  49. &nbsp;&nbsp;<button class="btn btn-success" href="#" id="add"><i
  50. class="fa fa-fw fa-lg fa-eye"></i>保存
  51. </button>
  52. </div>
  53. </div>
  54. </div>
  55. </div>
  56. </main>
  57. <script>
  58. $(function () {
  59. $("#add").on("click", function () {
  60. $.ajax({
  61. type: "POST",
  62. url: "/client/edit",
  63. data: $("form").serializeArray(),
  64. success: function (res) {
  65. alert(res.msg)
  66. if (res.status) {
  67. history.back(-1)
  68. }
  69. }
  70. })
  71. })
  72. })
  73. </script>