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.

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