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.

384 lines
16 KiB

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