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.

257 lines
9.2 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. <div id="details-head" class="col-sm-12">
  7. <h1>
  8. {{ check.name_then_code }}
  9. <small><a id="edit-name" href="#">(edit&hellip;)</a></small>
  10. </h1>
  11. <span class="label label-tag">{{ check.project }}</span>
  12. {% for tag in check.tags_list %}
  13. <span class="label label-tag">{{ tag }}</span>
  14. {% endfor %}
  15. </div>
  16. {% if messages %}
  17. <div class="col-sm-12">
  18. {% for message in messages %}
  19. <p class="alert alert-{{ message.tags }}">{{ message }}</p>
  20. {% endfor %}
  21. </div>
  22. {% endif %}
  23. <div class="col-sm-5">
  24. <div class="details-block">
  25. <h2>Description</h2>
  26. {% if check.desc %}
  27. {{ check.desc|linebreaks|urlize }}
  28. <div class="text-right">
  29. <button id="edit-desc" class="btn btn-sm btn-default">
  30. Edit Description&hellip;
  31. </button>
  32. </div>
  33. {% else %}
  34. <small><a id="edit-desc" href="#">Add description&hellip;</a></small>
  35. {% endif %}
  36. </div>
  37. <div class="details-block">
  38. <h2>How To Ping</h2>
  39. <div>
  40. <p>Keep this check up by making HTTP requests to this URL:</p>
  41. <code>{{ check.url }}</code>
  42. <p>
  43. {% if check.subject %}
  44. Or by sending emails with "{{ check.subject }}"
  45. in the subject line to this address:
  46. {% else %}
  47. Or by sending emails to this address:
  48. {% endif %}
  49. </p>
  50. <code>{{ check.email }}</code>
  51. <p>You can also explicitly
  52. <a href="{% url 'hc-docs' %}#fail-event">
  53. signal a failure</a>
  54. and
  55. <a href="{% url 'hc-docs' %}#start-event">
  56. measure job execution time</a>.
  57. </p>
  58. </div>
  59. <div class="text-right">
  60. <button
  61. data-toggle="modal"
  62. data-target="#email-settings-modal"
  63. class="btn btn-sm btn-default">Email Settings&hellip;</button>
  64. <button
  65. data-toggle="modal"
  66. data-target="#show-usage-modal"
  67. class="btn btn-sm btn-default">Usage Examples</button>
  68. <button
  69. data-label="Copy URL"
  70. data-clipboard-text="{{ check.url }}"
  71. class="btn btn-sm btn-default copy-btn">Copy URL</button>
  72. </div>
  73. </div>
  74. <div class="details-block">
  75. <h2>Current Status</h2>
  76. <table>
  77. <tr>
  78. <td>
  79. <span id="log-status-icon" class="status icon-{{ check.get_status }}"></span>
  80. </td>
  81. <td id="log-status-text">
  82. {% include "front/log_status_text.html" %}
  83. </td>
  84. </tr>
  85. </table>
  86. <div class="text-right">
  87. <form action="{% url 'hc-pause' check.code %}" method="post">
  88. {% csrf_token %}
  89. <input type="submit" class="btn btn-sm btn-default" value="Pause" />
  90. </form>
  91. <button
  92. id="ping-now"
  93. data-url="{{ check.url }}"
  94. class="btn btn-sm btn-default">Ping Now!</button>
  95. </div>
  96. </div>
  97. <div class="details-block">
  98. <h2>Schedule</h2>
  99. <table id="details-schedule">
  100. <tr>
  101. {% if check.kind == "simple" %}
  102. <th>Period</th>
  103. <td>
  104. <span class="value">{{ check.timeout|hc_duration }}</span>
  105. <div class="subtitle">
  106. (Expected time between pings)
  107. </div>
  108. </td>
  109. {% elif check.kind == "cron" %}
  110. <th>Cron Expression</th>
  111. <td>
  112. <span class="value">{{ check.schedule }}</span>
  113. </td>
  114. {% endif %}
  115. </tr>
  116. {% if check.kind == "cron" %}
  117. <tr>
  118. <th>Time Zone</th>
  119. <td>
  120. <span class="value">{{ check.tz }}</span>
  121. </td>
  122. </tr>
  123. {% endif %}
  124. <tr>
  125. <th>Grace Time</th>
  126. <td>
  127. <span class="value">{{ check.grace|hc_duration }}</span>
  128. <div class="subtitle">
  129. (When a check is late, how long to wait until an alert is sent)
  130. </div>
  131. </td>
  132. </tr>
  133. </table>
  134. <div class="text-right">
  135. <button
  136. id="edit-timeout"
  137. class="btn btn-sm btn-default timeout-grace"
  138. data-code="{{ check.code }}"
  139. data-kind="{{ check.kind }}"
  140. data-timeout="{{ check.timeout.total_seconds }}"
  141. data-grace="{{ check.grace.total_seconds }}"
  142. data-schedule="{{ check.schedule }}"
  143. data-tz="{{ check.tz }}">
  144. Change Schedule&hellip;</button>
  145. </div>
  146. </div>
  147. <div class="details-block">
  148. <h2>Notification Methods</h2>
  149. <table id="details-integrations" class="table">
  150. {% for channel in channels %}
  151. <tr data-url="{% url 'hc-switch-channel' check.code channel.code %}" {% if channel in check.channel_set.all %}class="on"{% endif %}>
  152. <th>
  153. <span class="label">
  154. {% if channel in check.channel_set.all %}ON{% else %}OFF{% endif %}
  155. </span>
  156. </th>
  157. <td>
  158. <span class="icon-{{ channel.kind }}"></span>
  159. {{ channel }}
  160. </td>
  161. </tr>
  162. {% endfor %}
  163. </table>
  164. </div>
  165. <div class="details-block">
  166. <h2>Danger Zone</h2>
  167. <p>Transfer to a different project, or permanently remove this check.</p>
  168. <div class="text-right">
  169. <button
  170. id="transfer-btn"
  171. data-toggle="modal"
  172. data-target="#transfer-modal"
  173. data-url="{% url 'hc-transfer' check.code %}"
  174. class="btn btn-sm btn-default">Transfer to Another Project&hellip;</button>
  175. <button
  176. id="details-remove-check"
  177. data-toggle="modal"
  178. data-target="#remove-check-modal"
  179. class="btn btn-sm btn-default">Remove</button>
  180. </div>
  181. </div>
  182. </div>
  183. <div id="events" class="col-sm-7">
  184. <h2>
  185. Log
  186. <small>Click on individual items for details</small>
  187. <div id="format-switcher" class="btn-group pull-right" data-toggle="buttons">
  188. <label class="btn btn-default btn-xs" data-format="utc">
  189. <input type="radio" name="date-format" checked>
  190. UTC
  191. </label>
  192. <label class="btn btn-default btn-xs active" data-format="local">
  193. <input type="radio" name="date-format">
  194. Local Time
  195. </label>
  196. </div>
  197. </h2>
  198. <div id="log-container"></div>
  199. </div>
  200. </div>
  201. <div id="ping-details-modal" class="modal">
  202. <div class="modal-dialog">
  203. <div class="modal-content">
  204. <div id="ping-details-body">Loading</div>
  205. <div class="modal-footer">
  206. <button type="button" class="btn btn-default" data-dismiss="modal">Got It!</button>
  207. </div>
  208. </div>
  209. </div>
  210. </div>
  211. <div id="transfer-modal" class="modal">
  212. </div>
  213. {% include "front/update_name_modal.html" %}
  214. {% include "front/update_timeout_modal.html" %}
  215. {% include "front/show_usage_modal.html" %}
  216. {% include "front/remove_check_modal.html" %}
  217. {% include "front/email_settings_modal.html" %}
  218. {% endblock %}
  219. {% block scripts %}
  220. {% compress js %}
  221. <script src="{% static 'js/jquery-2.1.4.min.js' %}"></script>
  222. <script src="{% static 'js/bootstrap.min.js' %}"></script>
  223. <script src="{% static 'js/clipboard.min.js' %}"></script>
  224. <script src="{% static 'js/bootstrap-select.min.js' %}"></script>
  225. <script src="{% static 'js/nouislider.min.js' %}"></script>
  226. <script src="{% static 'js/snippet-copy.js' %}"></script>
  227. <script src="{% static 'js/moment.min.js' %}"></script>
  228. <script src="{% static 'js/update-timeout-modal.js' %}"></script>
  229. <script src="{% static 'js/adaptive-setinterval.js' %}"></script>
  230. <script src="{% static 'js/details.js' %}"></script>
  231. {% endcompress %}
  232. {% endblock %}