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.

287 lines
11 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. <div id="show-usage-modal" class="modal">
  183. <div class="modal-dialog">
  184. <div class="modal-content">
  185. <div class="modal-header">
  186. <button type="button" class="close" data-dismiss="modal">&times;</button>
  187. <ul class="nav nav-pills" role="tablist">
  188. <li class="active">
  189. <a href="#crontab" data-toggle="tab">Crontab</a>
  190. </li>
  191. <li>
  192. <a href="#bash" data-toggle="tab">Bash</a>
  193. </li>
  194. <li>
  195. <a href="#python" data-toggle="tab">Python</a>
  196. </li>
  197. <li class="hidden-xs">
  198. <a href="#node" data-toggle="tab">Node.js</a>
  199. </li>
  200. <li class="hidden-xs">
  201. <a href="#php" data-toggle="tab">PHP</a>
  202. </li>
  203. <li class="hidden-xs">
  204. <a href="#browser" data-toggle="tab">Browser</a>
  205. </li>
  206. <li class="hidden-xs">
  207. <a href="#powershell" data-toggle="tab">PowerShell</a>
  208. </li>
  209. <li class="hidden-xs">
  210. <a href="#email" data-toggle="tab">Email</a>
  211. </li>
  212. </ul>
  213. </div>
  214. <div class="modal-body">
  215. <div class="tab-content">
  216. {% with ping_url="<span class='ex'></span>" %}
  217. <div role="tabpanel" class="tab-pane active" id="crontab">
  218. {% include "front/snippets/crontab.html" %}
  219. </div>
  220. <div role="tabpanel" class="tab-pane" id="bash">
  221. {% include "front/snippets/bash.html" %}
  222. </div>
  223. <div role="tabpanel" class="tab-pane" id="python">
  224. {% include "front/snippets/python.html" %}
  225. </div>
  226. <div role="tabpanel" class="tab-pane" id="node">
  227. {% include "front/snippets/node.html" %}
  228. </div>
  229. <div role="tabpanel" class="tab-pane" id="php">
  230. {% include "front/snippets/php.html" %}
  231. </div>
  232. <div class="tab-pane" id="browser">
  233. {% include "front/snippets/browser.html" %}
  234. </div>
  235. <div class="tab-pane" id="powershell">
  236. {% include "front/snippets/powershell.html" %}
  237. </div>
  238. <div class="tab-pane" id="email">
  239. As an alternative to HTTP/HTTPS requests,
  240. you can "ping" this check by sending an
  241. email message to
  242. <div class="email-address">
  243. <code class="em"></code>
  244. </div>
  245. </div>
  246. {% endwith %}
  247. </div>
  248. </div>
  249. <div class="modal-footer">
  250. <button type="button" class="btn btn-default" data-dismiss="modal">Got It!</button>
  251. </div>
  252. </div>
  253. </div>
  254. </div>
  255. {% endblock %}
  256. {% block scripts %}
  257. {% compress js %}
  258. <script src="{% static 'js/jquery-2.1.4.min.js' %}"></script>
  259. <script src="{% static 'js/bootstrap.min.js' %}"></script>
  260. <script src="{% static 'js/nouislider.min.js' %}"></script>
  261. <script src="{% static 'js/checks.js' %}"></script>
  262. {% endcompress %}
  263. {% endblock %}