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.

389 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 static 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. <div class="btn btn-xs {{ status }}">{{ tag }}</div>
  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_desktop.html" %}
  18. {% else %}
  19. <div class="alert alert-info">You don't have any checks yet.</div>
  20. {% endif %}
  21. </div>
  22. </div>
  23. <div class="row">
  24. <div class="col-sm-12">
  25. {% if num_available > 0 %}
  26. <form method="post" action="{% url 'hc-add-check' %}" class="text-center">
  27. {% csrf_token %}
  28. <input type="submit" class="btn btn-primary btn-lg" value="Add Check">
  29. </form>
  30. {% if num_available <= 10 %}
  31. <div class="add-check-note">
  32. ({{ checks|length }} in use, {{ num_available }} available)
  33. </div>
  34. {% endif %}
  35. {% else %}
  36. <div class="alert alert-info">
  37. <strong>Check limit reached.</strong>
  38. To add more checks, please
  39. <a href="{% url 'hc-billing' %}">upgrade your account!</a>
  40. </div>
  41. {% endif %}
  42. </div>
  43. </div>
  44. <div id="update-name-modal" class="modal">
  45. <div class="modal-dialog">
  46. <form id="update-name-form" class="form-horizontal" method="post">
  47. {% csrf_token %}
  48. <div class="modal-content">
  49. <div class="modal-header">
  50. <button type="button" class="close" data-dismiss="modal">&times;</button>
  51. <h4 class="update-timeout-title">Name and Tags</h4>
  52. </div>
  53. <div class="modal-body">
  54. <div class="form-group">
  55. <label for="update-name-input" class="col-sm-2 control-label">
  56. Name
  57. </label>
  58. <div class="col-sm-9">
  59. <input
  60. id="update-name-input"
  61. name="name"
  62. type="text"
  63. value="---"
  64. placeholder="unnamed"
  65. class="input-name form-control" />
  66. <span class="help-block">
  67. Give this check a human-friendly name,
  68. so you can easily recognize it later.
  69. </span>
  70. </div>
  71. </div>
  72. <div class="form-group">
  73. <label for="update-tags-input" class="col-sm-2 control-label">
  74. Tags
  75. </label>
  76. <div class="col-sm-9">
  77. <input
  78. id="update-tags-input"
  79. name="tags"
  80. type="text"
  81. value=""
  82. placeholder="production www"
  83. class="form-control" />
  84. <span class="help-block">
  85. Use tags for easy filtering and for status badges.
  86. Separate multiple tags with spaces.
  87. </span>
  88. </div>
  89. </div>
  90. </div>
  91. <div class="modal-footer">
  92. <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
  93. <button type="submit" class="btn btn-primary">Save</button>
  94. </div>
  95. </div>
  96. </form>
  97. </div>
  98. </div>
  99. <div id="update-timeout-modal" class="modal">
  100. <div class="modal-dialog">
  101. <div class="modal-content">
  102. <form id="update-timeout-form" method="post">
  103. {% csrf_token %}
  104. <input type="hidden" name="kind" value="simple" />
  105. <input type="hidden" name="timeout" id="update-timeout-timeout" />
  106. <input type="hidden" name="grace" id="update-timeout-grace" />
  107. <div class="modal-body">
  108. <div class="update-timeout-info text-center">
  109. <span
  110. class="update-timeout-label"
  111. data-toggle="tooltip"
  112. title="Expected time between pings.">
  113. Period
  114. </span>
  115. <span
  116. id="period-slider-value"
  117. class="update-timeout-value">
  118. 1 day
  119. </span>
  120. </div>
  121. <div id="period-slider"></div>
  122. <div class="update-timeout-info text-center">
  123. <span
  124. class="update-timeout-label"
  125. data-toggle="tooltip"
  126. title="When check is late, how much time to wait until alert is sent">
  127. Grace Time
  128. </span>
  129. <span
  130. id="grace-slider-value"
  131. class="update-timeout-value">
  132. 1 day
  133. </span>
  134. </div>
  135. <div id="grace-slider"></div>
  136. <div class="update-timeout-terms">
  137. <p>
  138. <span>Period</span>
  139. Expected time between pings.
  140. </p>
  141. <p>
  142. <span>Grace Time</span>
  143. When a check is late, how much time to wait until alert is sent.
  144. </p>
  145. </div>
  146. </div>
  147. <div class="modal-footer">
  148. <div class="btn-group pull-left">
  149. <label class="btn btn-default kind-simple active">Simple</label>
  150. <label class="btn btn-default kind-cron">Cron</label>
  151. </div>
  152. <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
  153. <button type="submit" class="btn btn-primary">Save</button>
  154. </div>
  155. </form>
  156. <form id="update-cron-form" method="post">
  157. {% csrf_token %}
  158. <input type="hidden" name="kind" value="cron" />
  159. <div class="modal-body">
  160. <div class="row">
  161. <div class="col-md-4">
  162. <div class="form-group">
  163. <label for="schedule">Cron Expression</label>
  164. <input
  165. type="text"
  166. class="form-control"
  167. id="schedule"
  168. name="schedule"
  169. placeholder="* * * * *">
  170. <div id="schedule-hint">
  171. m h dom mon dow
  172. <a href="{% url 'hc-docs-cron' %}" target="_blank">(cheatsheet)</a>
  173. </div>
  174. </div>
  175. </div>
  176. <div class="col-md-4">
  177. <div class="form-group">
  178. <label for="tz">Server's Timezone</label>
  179. <br />
  180. <select id="tz" name="tz" class="form-control">
  181. <option>UTC</option>
  182. {% for tz in timezones %}
  183. <option>{{ tz }}</option>{% endfor %}
  184. </select>
  185. </div>
  186. </div>
  187. <div class="col-md-4">
  188. <div class="form-group">
  189. <label for="cron-grace">Grace Time</label>
  190. <div class="input-group">
  191. <input
  192. type="number"
  193. min="1"
  194. max="43200"
  195. class="form-control"
  196. id="update-timeout-grace-cron"
  197. name="grace">
  198. <div class="input-group-addon">minutes</div>
  199. </div>
  200. </div>
  201. </div>
  202. </div>
  203. <div class="row">
  204. <div class="col-sm-12">
  205. <div id="cron-preview"></div>
  206. </div>
  207. </div>
  208. </div>
  209. <div class="modal-footer">
  210. <div class="btn-group pull-left">
  211. <label class="btn btn-default kind-simple">Simple</label>
  212. <label class="btn btn-default active kind-cron">Cron</label>
  213. </div>
  214. <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
  215. <button id="update-cron-submit" type="submit" class="btn btn-primary">
  216. Save
  217. </button>
  218. </div>
  219. </form>
  220. </div>
  221. </div>
  222. </div>
  223. <div id="remove-check-modal" class="modal">
  224. <div class="modal-dialog">
  225. <form id="remove-check-form" method="post">
  226. {% csrf_token %}
  227. <div class="modal-content">
  228. <div class="modal-header">
  229. <button type="button" class="close" data-dismiss="modal">&times;</button>
  230. <h4 class="remove-check-title">Remove Check <span class="remove-check-name"></span></h4>
  231. </div>
  232. <div class="modal-body">
  233. <p>You are about to remove check
  234. <strong class="remove-check-name">---</strong>.
  235. </p>
  236. <p>Once it's gone there is no "undo" and you cannot get
  237. the old ping URL back.</p>
  238. <p>Are you sure?</p>
  239. </div>
  240. <div class="modal-footer">
  241. <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
  242. <button type="submit" class="btn btn-danger">Remove</button>
  243. </div>
  244. </div>
  245. </form>
  246. </div>
  247. </div>
  248. <div id="show-usage-modal" class="modal">
  249. <div class="modal-dialog">
  250. <div class="modal-content">
  251. <div class="modal-header">
  252. <button type="button" class="close" data-dismiss="modal">&times;</button>
  253. <h4 id="usage-examples-title">Usage Examples</h4>
  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. <a
  335. id="ping-details-log"
  336. href="#"
  337. class="btn btn-default">
  338. Show Log
  339. </a>
  340. <button
  341. type="button"
  342. class="btn btn-default"
  343. data-dismiss="modal">
  344. Got It!
  345. </button>
  346. </div>
  347. </div>
  348. </div>
  349. </div>
  350. <form id="pause-form" method="post">
  351. {% csrf_token %}
  352. </form>
  353. {% endblock %}
  354. {% block scripts %}
  355. {% compress js %}
  356. <script src="{% static 'js/jquery-2.1.4.min.js' %}"></script>
  357. <script src="{% static 'js/bootstrap.min.js' %}"></script>
  358. <script src="{% static 'js/selectize.min.js' %}"></script>
  359. <script src="{% static 'js/nouislider.min.js' %}"></script>
  360. <script src="{% static 'js/clipboard.min.js' %}"></script>
  361. <script src="{% static 'js/snippet-copy.js' %}"></script>
  362. <script src="{% static 'js/checks.js' %}"></script>
  363. {% endcompress %}
  364. {% endblock %}