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.

327 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
  120. id="pause-btn"
  121. type="submit"
  122. {% if check.status == "paused" %}disabled{% endif %}
  123. class="btn btn-sm btn-default" value="Pause" />
  124. </form>
  125. <button
  126. id="ping-now"
  127. data-url="{{ check.url }}"
  128. class="btn btn-sm btn-default">Ping Now!</button>
  129. </div>
  130. </div>
  131. <div class="details-block">
  132. <h2>Schedule</h2>
  133. <table id="details-schedule">
  134. <tr>
  135. {% if check.kind == "simple" %}
  136. <th>Period</th>
  137. <td>
  138. <span class="value">{{ check.timeout|hc_duration }}</span>
  139. <div class="subtitle">
  140. (Expected time between pings)
  141. </div>
  142. </td>
  143. {% elif check.kind == "cron" %}
  144. <th>Cron Expression</th>
  145. <td>
  146. <span class="value">{{ check.schedule }}</span>
  147. </td>
  148. {% endif %}
  149. </tr>
  150. {% if check.kind == "cron" %}
  151. <tr>
  152. <th>Time Zone</th>
  153. <td>
  154. <span class="value">{{ check.tz }}</span>
  155. </td>
  156. </tr>
  157. {% endif %}
  158. <tr>
  159. <th>Grace Time</th>
  160. <td>
  161. <span class="value">{{ check.grace|hc_duration }}</span>
  162. <div class="subtitle">
  163. (When a check is late, how long to wait until an alert is sent)
  164. </div>
  165. </td>
  166. </tr>
  167. </table>
  168. <div class="text-right">
  169. <button
  170. id="edit-timeout"
  171. class="btn btn-sm btn-default timeout-grace"
  172. data-code="{{ check.code }}"
  173. data-status-url="{% url 'hc-status-single' check.code %}"
  174. data-kind="{{ check.kind }}"
  175. data-timeout="{{ check.timeout.total_seconds }}"
  176. data-grace="{{ check.grace.total_seconds }}"
  177. data-schedule="{{ check.schedule }}"
  178. data-tz="{{ check.tz }}">
  179. Change Schedule&hellip;</button>
  180. </div>
  181. </div>
  182. <div class="details-block">
  183. <h2>Notification Methods</h2>
  184. {% if channels %}
  185. <table id="details-integrations" class="table">
  186. {% for channel in channels %}
  187. <tr data-url="{% url 'hc-switch-channel' check.code channel.code %}" {% if channel in enabled_channels %}class="on"{% endif %}>
  188. <th>
  189. <span class="label">
  190. {% if channel in enabled_channels %}ON{% else %}OFF{% endif %}
  191. </span>
  192. </th>
  193. <td>
  194. <span class="icon-{{ channel.kind }}"></span>
  195. {{ channel }}
  196. </td>
  197. </tr>
  198. {% endfor %}
  199. </table>
  200. {% else %}
  201. <div class="alert no-channels">
  202. No notification methods set up yet.
  203. <br />
  204. Set up your preferred methods of notification in the
  205. <a href="{% url 'hc-p-channels' project.code %}">Integrations</a>
  206. page.
  207. </div>
  208. {% endif %}
  209. </div>
  210. <div class="details-block">
  211. <h2>Danger Zone</h2>
  212. <p>Copy, Transfer, or permanently remove this check.</p>
  213. <div class="text-right">
  214. {% if project.num_checks_available > 0 %}
  215. <button
  216. id="copy-btn"
  217. data-toggle="modal"
  218. data-target="#copy-modal"
  219. class="btn btn-sm btn-default">Create a Copy&hellip;</button>
  220. {% endif %}
  221. <button
  222. id="transfer-btn"
  223. data-toggle="modal"
  224. data-target="#transfer-modal"
  225. data-url="{% url 'hc-transfer' check.code %}"
  226. class="btn btn-sm btn-default">
  227. Transfer<span class="hidden-sm hidden-xs"> to Another Project</span>&hellip;
  228. </button>
  229. &nbsp;
  230. <button
  231. id="details-remove-check"
  232. data-toggle="modal"
  233. data-target="#remove-check-modal"
  234. class="btn btn-sm btn-default">Remove</button>
  235. </div>
  236. </div>
  237. </div>
  238. <div id="events" class="col-sm-7">
  239. <h2>
  240. Log
  241. <small class="hidden-xs">Click on individual items for details</small>
  242. <div id="format-switcher" class="btn-group pull-right" data-toggle="buttons">
  243. <label class="btn btn-default btn-xs" data-format="UTC">
  244. <input type="radio" name="date-format">
  245. UTC
  246. </label>
  247. {% if check.kind == "cron" and check.tz != "UTC" %}
  248. <label class="btn btn-default btn-xs" data-format="{{ check.tz }}">
  249. <input type="radio" name="date-format">
  250. {{ check.tz }}
  251. </label>
  252. {% endif %}
  253. <label class="btn btn-default btn-xs active" data-format="local">
  254. <input type="radio" name="date-format">
  255. Browser's time zone
  256. </label>
  257. </div>
  258. </h2>
  259. <div id="log-container"></div>
  260. </div>
  261. </div>
  262. <div id="ping-details-modal" class="modal">
  263. <div class="modal-dialog">
  264. <div class="modal-content">
  265. <div id="ping-details-body">Loading</div>
  266. <div class="modal-footer">
  267. <button type="button" class="btn btn-default" data-dismiss="modal">Got It!</button>
  268. </div>
  269. </div>
  270. </div>
  271. </div>
  272. <div id="transfer-modal" class="modal"></div>
  273. <form id="resume-form" action="{% url 'hc-resume' check.code %}" method="post">
  274. {% csrf_token %}
  275. </form>
  276. {% include "front/update_name_modal.html" %}
  277. {% include "front/update_timeout_modal.html" %}
  278. {% include "front/show_usage_modal.html" %}
  279. {% include "front/remove_check_modal.html" %}
  280. {% include "front/filtering_rules_modal.html" %}
  281. {% include "front/copy_modal.html" %}
  282. {% endblock %}
  283. {% block scripts %}
  284. {% compress js %}
  285. <script src="{% static 'js/jquery-2.1.4.min.js' %}"></script>
  286. <script src="{% static 'js/bootstrap.min.js' %}"></script>
  287. <script src="{% static 'js/selectize.min.js' %}"></script>
  288. <script src="{% static 'js/clipboard.min.js' %}"></script>
  289. <script src="{% static 'js/bootstrap-select.min.js' %}"></script>
  290. <script src="{% static 'js/nouislider.min.js' %}"></script>
  291. <script src="{% static 'js/snippet-copy.js' %}"></script>
  292. <script src="{% static 'js/moment.min.js' %}"></script>
  293. <script src="{% static 'js/moment-timezone-with-data-10-year-range.min.js' %}"></script>
  294. <script src="{% static 'js/update-timeout-modal.js' %}"></script>
  295. <script src="{% static 'js/adaptive-setinterval.js' %}"></script>
  296. <script src="{% static 'js/details.js' %}"></script>
  297. {% endcompress %}
  298. {% endblock %}