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