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.

234 lines
8.3 KiB

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