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.

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