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.

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