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.

307 lines
11 KiB

6 years ago
6 years ago
  1. {% extends "base.html" %}
  2. {% load compress humanize static hc_extras %}
  3. {% block title %}{{ check|down_title }}{% endblock %}
  4. {% block content %}
  5. <div class="row">
  6. {% if is_new %}
  7. <div class="col-sm-12">
  8. <p id="new-check-alert" class="alert alert-success">
  9. <strong>Your new check is ready!</strong>
  10. You can now
  11. <a data-target="edit-name" href="#" >give it a name</a>
  12. or
  13. <a data-target="edit-timeout" href="#" >set its schedule</a>.
  14. </p>
  15. </div>
  16. {% endif %}
  17. {% if is_copied %}
  18. <div class="col-sm-12">
  19. <p id="new-check-alert" class="alert alert-success">
  20. <strong>Copy created!</strong>
  21. This is a brand new check, with details copied over from your existing check.
  22. You might now want to
  23. <a data-target="edit-name" href="#">update its name and tags</a>.
  24. </p>
  25. </div>
  26. {% endif %}
  27. {% if messages %}
  28. <div class="col-sm-12">
  29. {% for message in messages %}
  30. <p class="alert alert-{{ message.tags }}">{{ message }}</p>
  31. {% endfor %}
  32. </div>
  33. {% endif %}
  34. <div id="details-head" class="col-sm-12">
  35. <h1>
  36. {{ check.name_then_code }}
  37. <small><a id="edit-name" href="#">(edit&hellip;)</a></small>
  38. </h1>
  39. <span class="label label-tag">{{ check.project }}</span>
  40. {% for tag in check.tags_list %}
  41. <span class="label label-tag">{{ tag }}</span>
  42. {% endfor %}
  43. </div>
  44. <div class="col-sm-5">
  45. <div class="details-block">
  46. <h2>Description</h2>
  47. {% if check.desc %}
  48. {{ check.desc|linebreaks|urlize }}
  49. <div class="text-right">
  50. <button id="edit-desc" class="btn btn-sm btn-default">
  51. Edit Description&hellip;
  52. </button>
  53. </div>
  54. {% else %}
  55. <small><a id="edit-desc" href="#">Add description&hellip;</a></small>
  56. {% endif %}
  57. </div>
  58. <div id="how-to-ping" class="details-block">
  59. <h2>How To Ping</h2>
  60. <div>
  61. <p>
  62. Keep this check up by making HTTP
  63. {% if check.methods == "POST" %}POST{% endif %}
  64. requests to this URL:
  65. </p>
  66. <code>{{ check.url }}</code>
  67. <p>
  68. {% if check.subject %}
  69. Or by sending emails with "{{ check.subject }}"
  70. in the subject line to this address:
  71. {% else %}
  72. Or by sending emails to this address:
  73. {% endif %}
  74. </p>
  75. <code>{{ check.email }}</code>
  76. <p>You can also explicitly
  77. <a href="{% url 'hc-serve-doc' 'signalling_failures' %}">
  78. signal a failure</a>
  79. and
  80. <a href="{% url 'hc-serve-doc' 'measuring_script_run_time' %}">
  81. measure job execution time</a>.
  82. </p>
  83. </div>
  84. <div class="text-right">
  85. <button
  86. data-toggle="modal"
  87. data-target="#filtering-rules-modal"
  88. class="btn btn-sm btn-default">Filtering Rules&hellip;</button>
  89. <button
  90. data-toggle="modal"
  91. data-target="#show-usage-modal"
  92. class="btn btn-sm btn-default">Usage Examples</button>
  93. <button
  94. data-label="Copy URL"
  95. data-clipboard-text="{{ check.url }}"
  96. class="btn btn-sm btn-default copy-btn">Copy URL</button>
  97. </div>
  98. </div>
  99. <div class="details-block">
  100. <h2>Current Status</h2>
  101. <table>
  102. <tr>
  103. <td>
  104. <span id="log-status-icon" class="status icon-{{ check.get_status }}"></span>
  105. </td>
  106. <td >
  107. <p id="log-status-text">{% include "front/log_status_text.html" %}</p>
  108. </td>
  109. </tr>
  110. <tr>
  111. <td></td>
  112. <td id="downtimes">
  113. {% include "front/details_downtimes.html" %}
  114. </td>
  115. </tr>
  116. </table>
  117. <div class="text-right">
  118. <form action="{% url 'hc-pause' check.code %}" method="post">
  119. {% csrf_token %}
  120. <input type="submit" class="btn btn-sm btn-default" value="Pause" />
  121. </form>
  122. <button
  123. id="ping-now"
  124. data-url="{{ check.url }}"
  125. class="btn btn-sm btn-default">Ping Now!</button>
  126. </div>
  127. </div>
  128. <div class="details-block">
  129. <h2>Schedule</h2>
  130. <table id="details-schedule">
  131. <tr>
  132. {% if check.kind == "simple" %}
  133. <th>Period</th>
  134. <td>
  135. <span class="value">{{ check.timeout|hc_duration }}</span>
  136. <div class="subtitle">
  137. (Expected time between pings)
  138. </div>
  139. </td>
  140. {% elif check.kind == "cron" %}
  141. <th>Cron Expression</th>
  142. <td>
  143. <span class="value">{{ check.schedule }}</span>
  144. </td>
  145. {% endif %}
  146. </tr>
  147. {% if check.kind == "cron" %}
  148. <tr>
  149. <th>Time Zone</th>
  150. <td>
  151. <span class="value">{{ check.tz }}</span>
  152. </td>
  153. </tr>
  154. {% endif %}
  155. <tr>
  156. <th>Grace Time</th>
  157. <td>
  158. <span class="value">{{ check.grace|hc_duration }}</span>
  159. <div class="subtitle">
  160. (When a check is late, how long to wait until an alert is sent)
  161. </div>
  162. </td>
  163. </tr>
  164. </table>
  165. <div class="text-right">
  166. <button
  167. id="edit-timeout"
  168. class="btn btn-sm btn-default timeout-grace"
  169. data-code="{{ check.code }}"
  170. data-status-url="{% url 'hc-status-single' check.code %}"
  171. data-kind="{{ check.kind }}"
  172. data-timeout="{{ check.timeout.total_seconds }}"
  173. data-grace="{{ check.grace.total_seconds }}"
  174. data-schedule="{{ check.schedule }}"
  175. data-tz="{{ check.tz }}">
  176. Change Schedule&hellip;</button>
  177. </div>
  178. </div>
  179. <div class="details-block">
  180. <h2>Notification Methods</h2>
  181. <table id="details-integrations" class="table">
  182. {% for channel in channels %}
  183. <tr data-url="{% url 'hc-switch-channel' check.code channel.code %}" {% if channel in check.channel_set.all %}class="on"{% endif %}>
  184. <th>
  185. <span class="label">
  186. {% if channel in check.channel_set.all %}ON{% else %}OFF{% endif %}
  187. </span>
  188. </th>
  189. <td>
  190. <span class="icon-{{ channel.kind }}"></span>
  191. {{ channel }}
  192. </td>
  193. </tr>
  194. {% endfor %}
  195. </table>
  196. </div>
  197. <div class="details-block">
  198. <h2>Danger Zone</h2>
  199. <p>Copy, Transfer, or permanently remove this check.</p>
  200. <div class="text-right">
  201. <button
  202. id="copy-btn"
  203. data-toggle="modal"
  204. data-target="#copy-modal"
  205. class="btn btn-sm btn-default">Create a Copy&hellip;</button>
  206. <button
  207. id="transfer-btn"
  208. data-toggle="modal"
  209. data-target="#transfer-modal"
  210. data-url="{% url 'hc-transfer' check.code %}"
  211. class="btn btn-sm btn-default">
  212. Transfer<span class="hidden-sm hidden-xs"> to Another Project</span>&hellip;
  213. </button>
  214. &nbsp;
  215. <button
  216. id="details-remove-check"
  217. data-toggle="modal"
  218. data-target="#remove-check-modal"
  219. class="btn btn-sm btn-default">Remove</button>
  220. </div>
  221. </div>
  222. </div>
  223. <div id="events" class="col-sm-7">
  224. <h2>
  225. Log
  226. <small class="hidden-xs">Click on individual items for details</small>
  227. <div id="format-switcher" class="btn-group pull-right" data-toggle="buttons">
  228. <label class="btn btn-default btn-xs" data-format="UTC">
  229. <input type="radio" name="date-format">
  230. UTC
  231. </label>
  232. {% if check.kind == "cron" and check.tz != "UTC" %}
  233. <label class="btn btn-default btn-xs" data-format="{{ check.tz }}">
  234. <input type="radio" name="date-format">
  235. {{ check.tz }}
  236. </label>
  237. {% endif %}
  238. <label class="btn btn-default btn-xs active" data-format="local">
  239. <input type="radio" name="date-format">
  240. Browser's time zone
  241. </label>
  242. </div>
  243. </h2>
  244. <div id="log-container"></div>
  245. </div>
  246. </div>
  247. <div id="ping-details-modal" class="modal">
  248. <div class="modal-dialog">
  249. <div class="modal-content">
  250. <div id="ping-details-body">Loading</div>
  251. <div class="modal-footer">
  252. <button type="button" class="btn btn-default" data-dismiss="modal">Got It!</button>
  253. </div>
  254. </div>
  255. </div>
  256. </div>
  257. <div id="transfer-modal" class="modal">
  258. </div>
  259. {% include "front/update_name_modal.html" %}
  260. {% include "front/update_timeout_modal.html" %}
  261. {% include "front/show_usage_modal.html" %}
  262. {% include "front/remove_check_modal.html" %}
  263. {% include "front/filtering_rules_modal.html" %}
  264. {% include "front/copy_modal.html" %}
  265. {% endblock %}
  266. {% block scripts %}
  267. {% compress js %}
  268. <script src="{% static 'js/jquery-2.1.4.min.js' %}"></script>
  269. <script src="{% static 'js/bootstrap.min.js' %}"></script>
  270. <script src="{% static 'js/clipboard.min.js' %}"></script>
  271. <script src="{% static 'js/bootstrap-select.min.js' %}"></script>
  272. <script src="{% static 'js/nouislider.min.js' %}"></script>
  273. <script src="{% static 'js/snippet-copy.js' %}"></script>
  274. <script src="{% static 'js/moment.min.js' %}"></script>
  275. <script src="{% static 'js/moment-timezone-with-data-10-year-range.min.js' %}"></script>
  276. <script src="{% static 'js/update-timeout-modal.js' %}"></script>
  277. <script src="{% static 'js/adaptive-setinterval.js' %}"></script>
  278. <script src="{% static 'js/details.js' %}"></script>
  279. {% endcompress %}
  280. {% endblock %}