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.

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