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.

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