index.html 3.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. {{ template "inc/head" . }}
  5. <link rel="stylesheet" type="text/css" href="/css/home.css">
  6. </head>
  7. <body>
  8. {{ template "inc/nav" . }}
  9. <div class="all">
  10. <!-- search -->
  11. <div class="form-inline mb20" role="form">
  12. <div class="form-group">
  13. <input type="text" class="form-control" id="query" value="{{$.Query}}">
  14. </div>
  15. <button onclick="query_item()" class="btn btn-default">
  16. <span class="glyphicon glyphicon-search"></span>
  17. </button>
  18. <input type="checkbox" name="mine" id="mine" {{if eq $.Mine 1}} checked="checked"{{end}}>
  19. <span>only me</span>
  20. <a href="/strategy/add" class="btn btn-default pull-right">
  21. <span class="glyphicon glyphicon-plus"></span>
  22. Add URL monitor
  23. </a>
  24. </div>
  25. <table class="table table-hover table-bordered table-striped">
  26. <thead>
  27. <tr>
  28. <th>ID</th>
  29. <th>Url</th>
  30. <th>Status Code</th>
  31. <th>Timeout</th>
  32. <th>Creator</th>
  33. <th>Recv Team</th>
  34. <th>Remark</th>
  35. <th>OP</th>
  36. </tr>
  37. </thead>
  38. <tbody>
  39. {{range .Strategies}}
  40. <tr>
  41. <td id="item_id">
  42. {{.Id}}
  43. </td>
  44. <td id="item_target">{{.Url}}</td>
  45. <td id="expect_code">{{.ExpectCode}}</td>
  46. <td id="timeout">{{.Timeout}}</td>
  47. <td id="creator">{{.Creator}}</td>
  48. <td id="team_name">
  49. {{range TeamsOfStrategy .Teams}}
  50. <code class="users green">{{.Name}}</code>
  51. {{end}}
  52. </td>
  53. <td id="note">{{.Note}}</td>
  54. <td id="edit">
  55. <a class="edit-icon" data-toggle="tooltip" data-placement="top" title="Detail" href="/url?id={{.Id}}">
  56. <span class="glyphicon glyphicon-list-alt"></span>
  57. </a>
  58. <span class="cut-line"></span>
  59. <a class="edit-icon" data-toggle="tooltip" data-placement="top" title="Edit" href="/strategy/{{.Id}}/edit">
  60. <span class="glyphicon glyphicon-edit"></span>
  61. </a>
  62. <span class="cut-line"></span>
  63. <a class="edit-icon" data-toggle="tooltip" data-placement="top" title="Del" href="javascript:del_strategy('{{.Id}}');">
  64. <span class="glyphicon glyphicon-remove"></span>
  65. </a>
  66. </td>
  67. </tr>
  68. {{end}}
  69. </tbody>
  70. </table>
  71. {{ template "inc/pager" . }}
  72. </div>
  73. <script type="text/javascript">
  74. function query_item() {
  75. var query = $.trim($("#query").val());
  76. var mine = document.getElementById('mine').checked ? 1 : 0;
  77. window.location.href="/?q="+query+"&mine=" + mine;
  78. }
  79. $(function() {
  80. $("#query").keypress(function(e) {
  81. var key = e.which;
  82. if (key == 13) {
  83. query_item();
  84. }
  85. });
  86. $("#mine").click(query_item);
  87. });
  88. </script>
  89. {{ template "inc/footer" . }}
  90. </body>
  91. </html>