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.

210 lines
7.4 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. <tr>
  88. <th>Grace Time</th>
  89. <td>
  90. <span class="value">{{ check.grace|hc_duration }}</span>
  91. <div class="subtitle">
  92. (When a check is late, how long to wait until an alert is sent)
  93. </div>
  94. </td>
  95. </tr>
  96. </table>
  97. <div class="text-right">
  98. <button
  99. id="edit-timeout"
  100. class="btn btn-sm btn-default timeout-grace"
  101. data-code="{{ check.code }}"
  102. data-kind="{{ check.kind }}"
  103. data-timeout="{{ check.timeout.total_seconds }}"
  104. data-grace="{{ check.grace.total_seconds }}"
  105. data-schedule="{{ check.schedule }}"
  106. data-tz="{{ check.tz }}">
  107. Change Schedule</button>
  108. </div>
  109. </div>
  110. <div class="details-block">
  111. <h2>Notification Methods</h2>
  112. <table id="details-integrations" class="table">
  113. {% for channel in channels %}
  114. <tr data-url="{% url 'hc-switch-channel' check.code channel.code %}" {% if channel in check.channel_set.all %}class="on"{% endif %}>
  115. <th>
  116. <span class="label">
  117. {% if channel in check.channel_set.all %}ON{% else %}OFF{% endif %}
  118. </span>
  119. </th>
  120. <td>
  121. <span class="icon-{{ channel.kind }}"></span>
  122. {{ channel }}
  123. </td>
  124. </tr>
  125. {% endfor %}
  126. </table>
  127. </div>
  128. <div class="details-block">
  129. <h2>Remove</h2>
  130. <p>Permanently remove this check from your account.</p>
  131. <div class="text-right">
  132. <button
  133. id="details-remove-check"
  134. data-toggle="modal"
  135. data-target="#remove-check-modal"
  136. class="btn btn-sm btn-default">Remove This Check</button>
  137. </div>
  138. </div>
  139. </div>
  140. <div id="events" class="col-sm-7">
  141. <h2>
  142. Log
  143. <small>Click on individual items for details</small>
  144. <div id="format-switcher" class="btn-group pull-right" data-toggle="buttons">
  145. <label class="btn btn-default btn-xs" data-format="utc">
  146. <input type="radio" name="date-format" checked>
  147. UTC
  148. </label>
  149. <label class="btn btn-default btn-xs active" data-format="local">
  150. <input type="radio" name="date-format">
  151. Local Time
  152. </label>
  153. </div>
  154. </h2>
  155. <div id="log-container"></div>
  156. </div>
  157. </div>
  158. <div id="ping-details-modal" class="modal">
  159. <div class="modal-dialog">
  160. <div class="modal-content">
  161. <div id="ping-details-body">Loading</div>
  162. <div class="modal-footer">
  163. <button type="button" class="btn btn-default" data-dismiss="modal">Got It!</button>
  164. </div>
  165. </div>
  166. </div>
  167. </div>
  168. {% include "front/update_name_modal.html" %}
  169. {% include "front/update_timeout_modal.html" %}
  170. {% include "front/show_usage_modal.html" %}
  171. {% include "front/remove_check_modal.html" %}
  172. {% endblock %}
  173. {% block scripts %}
  174. {% compress js %}
  175. <script src="{% static 'js/jquery-2.1.4.min.js' %}"></script>
  176. <script src="{% static 'js/bootstrap.min.js' %}"></script>
  177. <script src="{% static 'js/clipboard.min.js' %}"></script>
  178. <script src="{% static 'js/selectize.min.js' %}"></script>
  179. <script src="{% static 'js/nouislider.min.js' %}"></script>
  180. <script src="{% static 'js/snippet-copy.js' %}"></script>
  181. <script src="{% static 'js/moment.min.js' %}"></script>
  182. <script src="{% static 'js/update-timeout-modal.js' %}"></script>
  183. <script src="{% static 'js/adaptive-setinterval.js' %}"></script>
  184. <script src="{% static 'js/details.js' %}"></script>
  185. {% endcompress %}
  186. {% endblock %}