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.

301 lines
11 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. {% if is_new %}
  7. <div class="col-sm-12">
  8. <p id="new-check-alert" class="alert alert-success">
  9. <strong>Your new check is ready!</strong>
  10. You can now
  11. <a data-target="edit-name" href="#" >give it a name</a>
  12. or
  13. <a data-target="edit-timeout" href="#" >set its schedule</a>.
  14. </p>
  15. </div>
  16. {% endif %}
  17. {% if is_copied %}
  18. <div class="col-sm-12">
  19. <p id="new-check-alert" class="alert alert-success">
  20. <strong>Copy created!</strong>
  21. This is a brand new check, with details copied over from your existing check.
  22. You might now want to
  23. <a data-target="edit-name" href="#">update its name and tags</a>.
  24. </p>
  25. </div>
  26. {% endif %}
  27. {% if messages %}
  28. <div class="col-sm-12">
  29. {% for message in messages %}
  30. <p class="alert alert-{{ message.tags }}">{{ message }}</p>
  31. {% endfor %}
  32. </div>
  33. {% endif %}
  34. <div id="details-head" class="col-sm-12">
  35. <h1>
  36. {{ check.name_then_code }}
  37. <small><a id="edit-name" href="#">(edit&hellip;)</a></small>
  38. </h1>
  39. <span class="label label-tag">{{ check.project }}</span>
  40. {% for tag in check.tags_list %}
  41. <span class="label label-tag">{{ tag }}</span>
  42. {% endfor %}
  43. </div>
  44. <div class="col-sm-5">
  45. <div class="details-block">
  46. <h2>Description</h2>
  47. {% if check.desc %}
  48. {{ check.desc|linebreaks|urlize }}
  49. <div class="text-right">
  50. <button id="edit-desc" class="btn btn-sm btn-default">
  51. Edit Description&hellip;
  52. </button>
  53. </div>
  54. {% else %}
  55. <small><a id="edit-desc" href="#">Add description&hellip;</a></small>
  56. {% endif %}
  57. </div>
  58. <div class="details-block">
  59. <h2>How To Ping</h2>
  60. <div>
  61. <p>Keep this check up by making HTTP requests to this URL:</p>
  62. <code>{{ check.url }}</code>
  63. <p>
  64. {% if check.subject %}
  65. Or by sending emails with "{{ check.subject }}"
  66. in the subject line to this address:
  67. {% else %}
  68. Or by sending emails to this address:
  69. {% endif %}
  70. </p>
  71. <code>{{ check.email }}</code>
  72. <p>You can also explicitly
  73. <a href="{% url 'hc-docs' %}#fail-event">
  74. signal a failure</a>
  75. and
  76. <a href="{% url 'hc-docs' %}#start-event">
  77. measure job execution time</a>.
  78. </p>
  79. </div>
  80. <div class="text-right">
  81. <button
  82. data-toggle="modal"
  83. data-target="#email-settings-modal"
  84. class="btn btn-sm btn-default">Email Settings&hellip;</button>
  85. <button
  86. data-toggle="modal"
  87. data-target="#show-usage-modal"
  88. class="btn btn-sm btn-default">Usage Examples</button>
  89. <button
  90. data-label="Copy URL"
  91. data-clipboard-text="{{ check.url }}"
  92. class="btn btn-sm btn-default copy-btn">Copy URL</button>
  93. </div>
  94. </div>
  95. <div class="details-block">
  96. <h2>Current Status</h2>
  97. <table>
  98. <tr>
  99. <td>
  100. <span id="log-status-icon" class="status icon-{{ check.get_status }}"></span>
  101. </td>
  102. <td >
  103. <p id="log-status-text">{% include "front/log_status_text.html" %}</p>
  104. </td>
  105. </tr>
  106. <tr>
  107. <td></td>
  108. <td id="downtimes">
  109. {% include "front/details_downtimes.html" %}
  110. </td>
  111. </tr>
  112. </table>
  113. <div class="text-right">
  114. <form action="{% url 'hc-pause' check.code %}" method="post">
  115. {% csrf_token %}
  116. <input type="submit" class="btn btn-sm btn-default" value="Pause" />
  117. </form>
  118. <button
  119. id="ping-now"
  120. data-url="{{ check.url }}"
  121. class="btn btn-sm btn-default">Ping Now!</button>
  122. </div>
  123. </div>
  124. <div class="details-block">
  125. <h2>Schedule</h2>
  126. <table id="details-schedule">
  127. <tr>
  128. {% if check.kind == "simple" %}
  129. <th>Period</th>
  130. <td>
  131. <span class="value">{{ check.timeout|hc_duration }}</span>
  132. <div class="subtitle">
  133. (Expected time between pings)
  134. </div>
  135. </td>
  136. {% elif check.kind == "cron" %}
  137. <th>Cron Expression</th>
  138. <td>
  139. <span class="value">{{ check.schedule }}</span>
  140. </td>
  141. {% endif %}
  142. </tr>
  143. {% if check.kind == "cron" %}
  144. <tr>
  145. <th>Time Zone</th>
  146. <td>
  147. <span class="value">{{ check.tz }}</span>
  148. </td>
  149. </tr>
  150. {% endif %}
  151. <tr>
  152. <th>Grace Time</th>
  153. <td>
  154. <span class="value">{{ check.grace|hc_duration }}</span>
  155. <div class="subtitle">
  156. (When a check is late, how long to wait until an alert is sent)
  157. </div>
  158. </td>
  159. </tr>
  160. </table>
  161. <div class="text-right">
  162. <button
  163. id="edit-timeout"
  164. class="btn btn-sm btn-default timeout-grace"
  165. data-code="{{ check.code }}"
  166. data-status-url="{% url 'hc-status-single' check.code %}"
  167. data-kind="{{ check.kind }}"
  168. data-timeout="{{ check.timeout.total_seconds }}"
  169. data-grace="{{ check.grace.total_seconds }}"
  170. data-schedule="{{ check.schedule }}"
  171. data-tz="{{ check.tz }}">
  172. Change Schedule&hellip;</button>
  173. </div>
  174. </div>
  175. <div class="details-block">
  176. <h2>Notification Methods</h2>
  177. <table id="details-integrations" class="table">
  178. {% for channel in channels %}
  179. <tr data-url="{% url 'hc-switch-channel' check.code channel.code %}" {% if channel in check.channel_set.all %}class="on"{% endif %}>
  180. <th>
  181. <span class="label">
  182. {% if channel in check.channel_set.all %}ON{% else %}OFF{% endif %}
  183. </span>
  184. </th>
  185. <td>
  186. <span class="icon-{{ channel.kind }}"></span>
  187. {{ channel }}
  188. </td>
  189. </tr>
  190. {% endfor %}
  191. </table>
  192. </div>
  193. <div class="details-block">
  194. <h2>Danger Zone</h2>
  195. <p>Copy, Transfer, or permanently remove this check.</p>
  196. <div class="text-right">
  197. <button
  198. id="copy-btn"
  199. data-toggle="modal"
  200. data-target="#copy-modal"
  201. class="btn btn-sm btn-default">Create a Copy&hellip;</button>
  202. <button
  203. id="transfer-btn"
  204. data-toggle="modal"
  205. data-target="#transfer-modal"
  206. data-url="{% url 'hc-transfer' check.code %}"
  207. class="btn btn-sm btn-default">Transfer to Another Project&hellip;</button>
  208. &nbsp;
  209. <button
  210. id="details-remove-check"
  211. data-toggle="modal"
  212. data-target="#remove-check-modal"
  213. class="btn btn-sm btn-default">Remove</button>
  214. </div>
  215. </div>
  216. </div>
  217. <div id="events" class="col-sm-7">
  218. <h2>
  219. Log
  220. <small>Click on individual items for details</small>
  221. <div id="format-switcher" class="btn-group pull-right" data-toggle="buttons">
  222. <label class="btn btn-default btn-xs" data-format="UTC">
  223. <input type="radio" name="date-format">
  224. UTC
  225. </label>
  226. {% if check.kind == "cron" and check.tz != "UTC" %}
  227. <label class="btn btn-default btn-xs" data-format="{{ check.tz }}">
  228. <input type="radio" name="date-format">
  229. {{ check.tz }}
  230. </label>
  231. {% endif %}
  232. <label class="btn btn-default btn-xs active" data-format="local">
  233. <input type="radio" name="date-format">
  234. Browser's time zone
  235. </label>
  236. </div>
  237. </h2>
  238. <div id="log-container"></div>
  239. </div>
  240. </div>
  241. <div id="ping-details-modal" class="modal">
  242. <div class="modal-dialog">
  243. <div class="modal-content">
  244. <div id="ping-details-body">Loading</div>
  245. <div class="modal-footer">
  246. <button type="button" class="btn btn-default" data-dismiss="modal">Got It!</button>
  247. </div>
  248. </div>
  249. </div>
  250. </div>
  251. <div id="transfer-modal" class="modal">
  252. </div>
  253. {% include "front/update_name_modal.html" %}
  254. {% include "front/update_timeout_modal.html" %}
  255. {% include "front/show_usage_modal.html" %}
  256. {% include "front/remove_check_modal.html" %}
  257. {% include "front/email_settings_modal.html" %}
  258. {% include "front/copy_modal.html" %}
  259. {% endblock %}
  260. {% block scripts %}
  261. {% compress js %}
  262. <script src="{% static 'js/jquery-2.1.4.min.js' %}"></script>
  263. <script src="{% static 'js/bootstrap.min.js' %}"></script>
  264. <script src="{% static 'js/clipboard.min.js' %}"></script>
  265. <script src="{% static 'js/bootstrap-select.min.js' %}"></script>
  266. <script src="{% static 'js/nouislider.min.js' %}"></script>
  267. <script src="{% static 'js/snippet-copy.js' %}"></script>
  268. <script src="{% static 'js/moment.min.js' %}"></script>
  269. <script src="{% static 'js/moment-timezone-with-data-10-year-range.min.js' %}"></script>
  270. <script src="{% static 'js/update-timeout-modal.js' %}"></script>
  271. <script src="{% static 'js/adaptive-setinterval.js' %}"></script>
  272. <script src="{% static 'js/details.js' %}"></script>
  273. {% endcompress %}
  274. {% endblock %}