edit.html 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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="max_conn">
  23. <label class="control-label">最大客户端连接数</label>
  24. <input class="form-control" value="{{.c.MaxConn}}" type="text" name="max_conn"
  25. placeholder="为空不限制">
  26. </div>
  27. <div class="form-group" id="u">
  28. <label class="control-label">验证用户名(仅socks5,web穿透支持)</label>
  29. <input class="form-control" value="{{.c.Cnf.U}}" type="text" name="u"
  30. placeholder="不填则无需验证">
  31. </div>
  32. <div class="form-group" id="p">
  33. <label class="control-label">验证密码(仅socks5,web穿透支持)</label>
  34. <input class="form-control" value="{{.c.Cnf.P}}" type="text" name="p"
  35. placeholder="不填则无需验证">
  36. </div>
  37. <div class="form-group" id="vkey">
  38. <label class="control-label">客户端连接密钥(唯一、不填将会自动生成)</label>
  39. <input class="form-control" value="{{.c.VerifyKey}}" type="text" name="vkey"
  40. placeholder="客户端连接密钥">
  41. </div>
  42. <div class="form-group" id="compress">
  43. <label class="control-label">数据压缩方式(所有模式均支持)</label>
  44. <select class="form-control" name="compress">
  45. <option {{if eq "" .c.Cnf.Compress}}selected{{end}} value="">不压缩</option>
  46. <option {{if eq "snappy" .c.Cnf.Compress}}selected{{end}} value="snappy">snappy压缩</option>
  47. </select>
  48. </div>
  49. <div class="form-group" id="compress">
  50. <label class="control-label">是否加密传输(所有模式均支持)</label>
  51. <select class="form-control" name="crypt">
  52. <option {{if eq false .c.Cnf.Crypt}}selected{{end}} value="0">不加密</option>
  53. <option {{if eq true .c.Cnf.Crypt}}selected{{end}} value="1">加密</option>
  54. </select>
  55. </div>
  56. </form>
  57. </div>
  58. <div class="tile-footer">
  59. &nbsp;&nbsp;<button class="btn btn-success" href="#" id="add"><i
  60. class="fa fa-fw fa-lg fa-eye"></i>保存
  61. </button>
  62. </div>
  63. </div>
  64. </div>
  65. </div>
  66. </main>
  67. <script>
  68. $(function () {
  69. $("#add").on("click", function () {
  70. $.ajax({
  71. type: "POST",
  72. url: "/client/edit",
  73. data: $("form").serializeArray(),
  74. success: function (res) {
  75. alert(res.msg)
  76. if (res.status) {
  77. history.back(-1)
  78. }
  79. }
  80. })
  81. })
  82. })
  83. </script>