You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

209 lines
8.0 KiB

9 years ago
10 years ago
9 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
  1. {% extends "base.html" %}
  2. {% load compress staticfiles %}
  3. {% block title %}My Checks - healthchecks.io{% endblock %}
  4. {% block content %}
  5. <div class="row">
  6. <div class="col-sm-12">
  7. <h1>
  8. {% if request.team == request.user.profile %}
  9. My Checks
  10. {% else %}
  11. {{ request.team.team_name }}
  12. {% endif %}
  13. </h1>
  14. </div>
  15. {% if tags %}
  16. <div id="my-checks-tags" class="col-sm-12">
  17. {% for tag, count in tags %}
  18. {% if tag in down_tags %}
  19. <button class="btn btn-danger btn-xs" data-toggle="button">{{ tag }}</button>
  20. {% elif tag in grace_tags %}
  21. <button class="btn btn-warning btn-xs" data-toggle="button">{{ tag }}</button>
  22. {% else %}
  23. <button class="btn btn-default btn-xs" data-toggle="button">{{ tag }}</button>
  24. {% endif %}
  25. {% endfor %}
  26. </div>
  27. {% endif %}
  28. </div>
  29. <div class="row">
  30. <div class="col-sm-12">
  31. {% if checks %}
  32. {% include "front/my_checks_mobile.html" %}
  33. {% include "front/my_checks_desktop.html" %}
  34. {% else %}
  35. <div class="alert alert-info">You don't have any checks yet.</div>
  36. {% endif %}
  37. </div>
  38. </div>
  39. <div class="row">
  40. <div class="col-sm-12">
  41. <form method="post" action="{% url 'hc-add-check' %}" class="text-center">
  42. {% csrf_token %}
  43. <input type="submit" class="btn btn-primary btn-lg" value="Add Check">
  44. </form>
  45. </div>
  46. </div>
  47. <div id="update-name-modal" class="modal">
  48. <div class="modal-dialog">
  49. <form id="update-name-form" class="form-horizontal" method="post">
  50. {% csrf_token %}
  51. <div class="modal-content">
  52. <div class="modal-header">
  53. <button type="button" class="close" data-dismiss="modal">&times;</button>
  54. <h4 class="update-timeout-title">Name and Tags</h4>
  55. </div>
  56. <div class="modal-body">
  57. <div class="form-group">
  58. <label for="update-name-input" class="col-sm-2 control-label">
  59. Name
  60. </label>
  61. <div class="col-sm-9">
  62. <input
  63. id="update-name-input"
  64. name="name"
  65. type="text"
  66. value="---"
  67. placeholder="unnamed"
  68. class="input-name form-control" />
  69. <span class="help-block">
  70. Give this check a human-friendly name,
  71. so you can easily recognize it later.
  72. </span>
  73. </div>
  74. </div>
  75. <div class="form-group">
  76. <label for="update-tags-input" class="col-sm-2 control-label">
  77. Tags
  78. </label>
  79. <div class="col-sm-9">
  80. <input
  81. id="update-tags-input"
  82. name="tags"
  83. type="text"
  84. value=""
  85. placeholder="production www"
  86. class="form-control" />
  87. <span class="help-block">
  88. Optionally, assign tags for easy filtering.
  89. Separate multiple tags with spaces.
  90. </span>
  91. </div>
  92. </div>
  93. </div>
  94. <div class="modal-footer">
  95. <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
  96. <button type="submit" class="btn btn-primary">Save</button>
  97. </div>
  98. </div>
  99. </form>
  100. </div>
  101. </div>
  102. <div id="update-timeout-modal" class="modal">
  103. <div class="modal-dialog">
  104. <form id="update-timeout-form" method="post">
  105. {% csrf_token %}
  106. <input type="hidden" name="timeout" id="update-timeout-timeout" />
  107. <input type="hidden" name="grace" id="update-timeout-grace" />
  108. <div class="modal-content">
  109. <div class="modal-body">
  110. <div class="update-timeout-info text-center">
  111. <span
  112. class="update-timeout-label"
  113. data-toggle="tooltip"
  114. title="Expected time between pings.">
  115. Period
  116. </span>
  117. <span
  118. id="period-slider-value"
  119. class="update-timeout-value">
  120. 1 day
  121. </span>
  122. </div>
  123. <div id="period-slider"></div>
  124. <div class="update-timeout-info text-center">
  125. <span
  126. class="update-timeout-label"
  127. data-toggle="tooltip"
  128. title="When check is late, how much time to wait until alert is sent">
  129. Grace Time
  130. </span>
  131. <span
  132. id="grace-slider-value"
  133. class="update-timeout-value">
  134. 1 day
  135. </span>
  136. </div>
  137. <div id="grace-slider"></div>
  138. <div class="update-timeout-terms">
  139. <p>
  140. <span>Period</span>
  141. Expected time between pings.
  142. </p>
  143. <p>
  144. <span>Grace Time</span>
  145. When a check is late, how much time to wait until alert is sent.
  146. </p>
  147. </div>
  148. </div>
  149. <div class="modal-footer">
  150. <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
  151. <button type="submit" class="btn btn-primary">Save</button>
  152. </div>
  153. </div>
  154. </form>
  155. </div>
  156. </div>
  157. <div id="remove-check-modal" class="modal">
  158. <div class="modal-dialog">
  159. <form id="remove-check-form" method="post">
  160. {% csrf_token %}
  161. <div class="modal-content">
  162. <div class="modal-header">
  163. <button type="button" class="close" data-dismiss="modal">&times;</button>
  164. <h4 class="remove-check-title">Remove Check <span class="remove-check-name"></span></h4>
  165. </div>
  166. <div class="modal-body">
  167. <p>You are about to remove check
  168. <strong class="remove-check-name">---</strong>.
  169. </p>
  170. <p>Once it's gone there is no "undo" and you cannot get
  171. the old ping URL back.</p>
  172. <p>Are you sure?</p>
  173. </div>
  174. <div class="modal-footer">
  175. <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
  176. <button type="submit" class="btn btn-danger">Remove</button>
  177. </div>
  178. </div>
  179. </form>
  180. </div>
  181. </div>
  182. {% endblock %}
  183. {% block scripts %}
  184. {% compress js %}
  185. <script src="{% static 'js/jquery-2.1.4.min.js' %}"></script>
  186. <script src="{% static 'js/bootstrap.min.js' %}"></script>
  187. <script src="{% static 'js/nouislider.min.js' %}"></script>
  188. <script src="{% static 'js/checks.js' %}"></script>
  189. {% endcompress %}
  190. {% endblock %}