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.

379 lines
16 KiB

10 years ago
9 years ago
10 years ago
10 years ago
10 years ago
10 years ago
  1. {% extends "base.html" %}
  2. {% load compress staticfiles hc_extras %}
  3. {% block title %}{{ num_down|num_down_title }}{% endblock %}
  4. {% block content %}
  5. <div class="row">
  6. {% if tags %}
  7. <div id="my-checks-tags" class="col-sm-12">
  8. {% for tag, status in tags %}
  9. <button class="btn btn-xs {{ status }}" data-toggle="button">{{ tag }}</button>
  10. {% endfor %}
  11. </div>
  12. {% endif %}
  13. </div>
  14. <div class="row">
  15. <div class="col-sm-12">
  16. {% if checks %}
  17. {% include "front/my_checks_mobile.html" %}
  18. {% include "front/my_checks_desktop.html" %}
  19. {% else %}
  20. <div class="alert alert-info">You don't have any checks yet.</div>
  21. {% endif %}
  22. </div>
  23. </div>
  24. <div class="row">
  25. <div class="col-sm-12">
  26. {% if num_available > 0 %}
  27. <form method="post" action="{% url 'hc-add-check' %}" class="text-center">
  28. {% csrf_token %}
  29. <input type="submit" class="btn btn-primary btn-lg" value="Add Check">
  30. </form>
  31. {% if num_available <= 10 %}
  32. <div class="add-check-note">
  33. ({{ checks|length }} in use, {{ num_available }} available)
  34. </div>
  35. {% endif %}
  36. {% else %}
  37. <div class="alert alert-info">
  38. <strong>Check limit reached.</strong>
  39. To add more checks, please
  40. <a href="{% url 'hc-billing' %}">upgrade your account!</a>
  41. </div>
  42. {% endif %}
  43. </div>
  44. </div>
  45. <div id="update-name-modal" class="modal">
  46. <div class="modal-dialog">
  47. <form id="update-name-form" class="form-horizontal" method="post">
  48. {% csrf_token %}
  49. <div class="modal-content">
  50. <div class="modal-header">
  51. <button type="button" class="close" data-dismiss="modal">&times;</button>
  52. <h4 class="update-timeout-title">Name and Tags</h4>
  53. </div>
  54. <div class="modal-body">
  55. <div class="form-group">
  56. <label for="update-name-input" class="col-sm-2 control-label">
  57. Name
  58. </label>
  59. <div class="col-sm-9">
  60. <input
  61. id="update-name-input"
  62. name="name"
  63. type="text"
  64. value="---"
  65. placeholder="unnamed"
  66. class="input-name form-control" />
  67. <span class="help-block">
  68. Give this check a human-friendly name,
  69. so you can easily recognize it later.
  70. </span>
  71. </div>
  72. </div>
  73. <div class="form-group">
  74. <label for="update-tags-input" class="col-sm-2 control-label">
  75. Tags
  76. </label>
  77. <div class="col-sm-9">
  78. <input
  79. id="update-tags-input"
  80. name="tags"
  81. type="text"
  82. value=""
  83. placeholder="production www"
  84. class="form-control" />
  85. <span class="help-block">
  86. Use tags for easy filtering and for status badges.
  87. Separate multiple tags with spaces.
  88. </span>
  89. </div>
  90. </div>
  91. </div>
  92. <div class="modal-footer">
  93. <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
  94. <button type="submit" class="btn btn-primary">Save</button>
  95. </div>
  96. </div>
  97. </form>
  98. </div>
  99. </div>
  100. <div id="update-timeout-modal" class="modal">
  101. <div class="modal-dialog">
  102. <div class="modal-content">
  103. <form id="update-timeout-form" method="post">
  104. {% csrf_token %}
  105. <input type="hidden" name="kind" value="simple" />
  106. <input type="hidden" name="timeout" id="update-timeout-timeout" />
  107. <input type="hidden" name="grace" id="update-timeout-grace" />
  108. <div class="modal-body">
  109. <div class="update-timeout-info text-center">
  110. <span
  111. class="update-timeout-label"
  112. data-toggle="tooltip"
  113. title="Expected time between pings.">
  114. Period
  115. </span>
  116. <span
  117. id="period-slider-value"
  118. class="update-timeout-value">
  119. 1 day
  120. </span>
  121. </div>
  122. <div id="period-slider"></div>
  123. <div class="update-timeout-info text-center">
  124. <span
  125. class="update-timeout-label"
  126. data-toggle="tooltip"
  127. title="When check is late, how much time to wait until alert is sent">
  128. Grace Time
  129. </span>
  130. <span
  131. id="grace-slider-value"
  132. class="update-timeout-value">
  133. 1 day
  134. </span>
  135. </div>
  136. <div id="grace-slider"></div>
  137. <div class="update-timeout-terms">
  138. <p>
  139. <span>Period</span>
  140. Expected time between pings.
  141. </p>
  142. <p>
  143. <span>Grace Time</span>
  144. When a check is late, how much time to wait until alert is sent.
  145. </p>
  146. </div>
  147. </div>
  148. <div class="modal-footer">
  149. <div class="btn-group pull-left">
  150. <label class="btn btn-default kind-simple active">Simple</label>
  151. <label class="btn btn-default kind-cron">Cron</label>
  152. </div>
  153. <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
  154. <button type="submit" class="btn btn-primary">Save</button>
  155. </div>
  156. </form>
  157. <form id="update-cron-form" method="post">
  158. {% csrf_token %}
  159. <input type="hidden" name="kind" value="cron" />
  160. <div class="modal-body">
  161. <div class="row">
  162. <div class="col-md-4">
  163. <div class="form-group">
  164. <label for="schedule">Cron Expression</label>
  165. <input
  166. type="text"
  167. class="form-control"
  168. id="schedule"
  169. name="schedule"
  170. placeholder="* * * * *">
  171. <div id="schedule-hint">
  172. m h dom mon dow
  173. <a href="{% url 'hc-docs-cron' %}" target="_blank">(cheatsheet)</a>
  174. </div>
  175. </div>
  176. </div>
  177. <div class="col-md-4">
  178. <div class="form-group">
  179. <label for="tz">Server's Timezone</label>
  180. <br />
  181. <select id="tz" name="tz" class="form-control">
  182. <option>UTC</option>
  183. {% for tz in timezones %}
  184. <option>{{ tz }}</option>{% endfor %}
  185. </select>
  186. </div>
  187. </div>
  188. <div class="col-md-4">
  189. <div class="form-group">
  190. <label for="cron-grace">Grace Time</label>
  191. <div class="input-group">
  192. <input
  193. type="number"
  194. min="1"
  195. max="43200"
  196. class="form-control"
  197. id="update-timeout-grace-cron"
  198. name="grace">
  199. <div class="input-group-addon">minutes</div>
  200. </div>
  201. </div>
  202. </div>
  203. </div>
  204. <div class="row">
  205. <div class="col-sm-12">
  206. <div id="cron-preview"></div>
  207. </div>
  208. </div>
  209. </div>
  210. <div class="modal-footer">
  211. <div class="btn-group pull-left">
  212. <label class="btn btn-default kind-simple">Simple</label>
  213. <label class="btn btn-default active kind-cron">Cron</label>
  214. </div>
  215. <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
  216. <button id="update-cron-submit" type="submit" class="btn btn-primary">
  217. Save
  218. </button>
  219. </div>
  220. </form>
  221. </div>
  222. </div>
  223. </div>
  224. <div id="remove-check-modal" class="modal">
  225. <div class="modal-dialog">
  226. <form id="remove-check-form" method="post">
  227. {% csrf_token %}
  228. <div class="modal-content">
  229. <div class="modal-header">
  230. <button type="button" class="close" data-dismiss="modal">&times;</button>
  231. <h4 class="remove-check-title">Remove Check <span class="remove-check-name"></span></h4>
  232. </div>
  233. <div class="modal-body">
  234. <p>You are about to remove check
  235. <strong class="remove-check-name">---</strong>.
  236. </p>
  237. <p>Once it's gone there is no "undo" and you cannot get
  238. the old ping URL back.</p>
  239. <p>Are you sure?</p>
  240. </div>
  241. <div class="modal-footer">
  242. <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
  243. <button type="submit" class="btn btn-danger">Remove</button>
  244. </div>
  245. </div>
  246. </form>
  247. </div>
  248. </div>
  249. <div id="show-usage-modal" class="modal">
  250. <div class="modal-dialog">
  251. <div class="modal-content">
  252. <div class="modal-header">
  253. <button type="button" class="close" data-dismiss="modal">&times;</button>
  254. <ul class="nav nav-pills" role="tablist">
  255. <li class="active">
  256. <a href="#crontab" data-toggle="tab">Crontab</a>
  257. </li>
  258. <li>
  259. <a href="#bash" data-toggle="tab">Bash</a>
  260. </li>
  261. <li>
  262. <a href="#python" data-toggle="tab">Python</a>
  263. </li>
  264. <li>
  265. <a href="#ruby" data-toggle="tab">Ruby</a>
  266. </li>
  267. <li class="hidden-xs">
  268. <a href="#node" data-toggle="tab">Node.js</a>
  269. </li>
  270. <li class="hidden-xs">
  271. <a href="#php" data-toggle="tab">PHP</a>
  272. </li>
  273. <li class="hidden-xs">
  274. <a href="#browser" data-toggle="tab">Browser</a>
  275. </li>
  276. <li class="hidden-xs">
  277. <a href="#powershell" data-toggle="tab">PowerShell</a>
  278. </li>
  279. <li class="hidden-xs">
  280. <a href="#email" data-toggle="tab">Email</a>
  281. </li>
  282. </ul>
  283. </div>
  284. <div class="modal-body">
  285. <div class="tab-content">
  286. {% with ping_url="<span class='ex'></span>" %}
  287. <div role="tabpanel" class="tab-pane active" id="crontab">
  288. {% include "front/snippets/crontab.html" %}
  289. </div>
  290. <div role="tabpanel" class="tab-pane" id="bash">
  291. {% include "front/snippets/bash_curl.html" %}
  292. {% include "front/snippets/bash_wget.html" %}
  293. </div>
  294. <div role="tabpanel" class="tab-pane" id="python">
  295. {% include "front/snippets/python_urllib2.html" %}
  296. {% include "front/snippets/python_requests.html" %}
  297. </div>
  298. <div role="tabpanel" class="tab-pane" id="ruby">
  299. {% include "front/snippets/ruby.html" %}
  300. </div>
  301. <div role="tabpanel" class="tab-pane" id="node">
  302. {% include "front/snippets/node.html" %}
  303. </div>
  304. <div role="tabpanel" class="tab-pane" id="php">
  305. {% include "front/snippets/php.html" %}
  306. </div>
  307. <div class="tab-pane" id="browser">
  308. {% include "front/snippets/browser.html" %}
  309. </div>
  310. <div class="tab-pane" id="powershell">
  311. {% include "front/snippets/powershell.html" %}
  312. </div>
  313. <div class="tab-pane" id="email">
  314. <p>
  315. As an alternative to HTTP/HTTPS requests,
  316. you can "ping" this check by sending an
  317. email message to <code class="em"></code>
  318. </p>
  319. </div>
  320. {% endwith %}
  321. </div>
  322. </div>
  323. <div class="modal-footer">
  324. <button type="button" class="btn btn-default" data-dismiss="modal">Got It!</button>
  325. </div>
  326. </div>
  327. </div>
  328. </div>
  329. <div id="ping-details-modal" class="modal">
  330. <div class="modal-dialog">
  331. <div class="modal-content">
  332. <div id="ping-details-body">Loading</div>
  333. <div class="modal-footer">
  334. <button type="button" class="btn btn-default" data-dismiss="modal">Got It!</button>
  335. </div>
  336. </div>
  337. </div>
  338. </div>
  339. <form id="pause-form" method="post">
  340. {% csrf_token %}
  341. </form>
  342. {% endblock %}
  343. {% block scripts %}
  344. {% compress js %}
  345. <script src="{% static 'js/jquery-2.1.4.min.js' %}"></script>
  346. <script src="{% static 'js/bootstrap.min.js' %}"></script>
  347. <script src="{% static 'js/selectize.min.js' %}"></script>
  348. <script src="{% static 'js/nouislider.min.js' %}"></script>
  349. <script src="{% static 'js/clipboard.min.js' %}"></script>
  350. <script src="{% static 'js/snippet-copy.js' %}"></script>
  351. <script src="{% static 'js/checks.js' %}"></script>
  352. {% endcompress %}
  353. {% endblock %}