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.

280 lines
10 KiB

8 years ago
  1. {% extends "base.html" %}
  2. {% load compress humanize staticfiles hc_extras %}
  3. {% block title %}Integrations - {% site_name %}{% endblock %}
  4. {% block content %}
  5. <div class="row">
  6. {% if messages %}
  7. <div class="col-sm-12">
  8. {% for message in messages %}
  9. <p class="alert alert-{{ message.tags }}">{{ message }}</p>
  10. {% endfor %}
  11. </div>
  12. {% endif %}
  13. <div class="col-sm-12">
  14. <table class="table channels-table">
  15. {% if channels %}
  16. <tr>
  17. <th>Type</th>
  18. <th>Value</th>
  19. <th>Assigned Checks</th>
  20. <th>Last Notification</th>
  21. <th></th>
  22. </tr>
  23. {% for ch in channels %}
  24. <tr class="channel-row">
  25. <td>{{ ch.get_kind_display }}</td>
  26. <td class="value-cell">
  27. {% if ch.kind == "email" %}
  28. <span class="preposition">to</span>
  29. {{ ch.value }}
  30. {% if not ch.email_verified %}
  31. <span class="channel-unconfirmed">(unconfirmed)</span>
  32. {% endif %}
  33. {% elif ch.kind == "pd" %}
  34. <span class="preposition">API key</span>
  35. {{ ch.value }}
  36. {% elif ch.kind == "opsgenie" %}
  37. <span class="preposition">API key</span>
  38. {{ ch.value }}
  39. {% elif ch.kind == "victorops" %}
  40. <span class="preposition">Post URL</span>
  41. {{ ch.value }}
  42. {% elif ch.kind == "po" %}
  43. <span class="preposition">user key</span>
  44. {{ ch.po_value|first }}
  45. ({{ ch.po_value|last }} priority)
  46. {% elif ch.kind == "slack" %}
  47. {% if ch.slack_team %}
  48. <span class="preposition">team</span>
  49. {{ ch.slack_team }},
  50. <span class="preposition">channel</span>
  51. {{ ch.slack_channel }}
  52. {% else %}
  53. {{ ch.value }}
  54. {% endif %}
  55. {% elif ch.kind == "webhook" %}
  56. <table>
  57. {% if ch.value_down %}
  58. <tr>
  59. <td class="preposition">down&nbsp;</td>
  60. <td>{{ ch.value_down }}</td>
  61. </tr>
  62. {% endif %}
  63. {% if ch.value_up %}
  64. <tr>
  65. <td class="preposition">up&nbsp;</td>
  66. <td>{{ ch.value_up }}</td>
  67. </tr>
  68. {% endif %}
  69. {% if ch.post_data %}
  70. <tr>
  71. <td class="preposition">body&nbsp;</td>
  72. <td>{{ ch.post_data }}</td>
  73. </tr>
  74. {% endif %}
  75. </table>
  76. {% elif ch.kind == "pushbullet" %}
  77. <span class="preposition">API key</span>
  78. {{ ch.value }}
  79. {% elif ch.kind == "discord" %}
  80. {{ ch.discord_webhook_id }}
  81. {% else %}
  82. {{ ch.value }}
  83. {% endif %}
  84. </td>
  85. <td class="channels-num-checks">
  86. <a
  87. class="edit-checks"
  88. href="{% url 'hc-channel-checks' ch.code %}">
  89. {{ ch.n_checks }} of {{ num_checks }}
  90. </a>
  91. </td>
  92. <td>
  93. {% with n=ch.latest_notification %}
  94. {% if n %}
  95. {% if n.error %}
  96. <span class="text-danger" data-toggle="tooltip" title="{{ n.error }}">
  97. <strong>Failed</strong>, {{ n.created|naturaltime }}
  98. </span>
  99. {% else %}
  100. Delivered, {{ n.created|naturaltime }}
  101. {% endif %}
  102. {% else %}
  103. Never
  104. {% endif %}
  105. {% endwith %}
  106. </td>
  107. <td>
  108. <button
  109. data-name="{{ ch.value }}"
  110. data-url="{% url 'hc-remove-channel' ch.code %}"
  111. class="btn btn-sm btn-default channel-remove"
  112. type="button">
  113. <span class="icon-delete"></span>
  114. </button>
  115. </td>
  116. <td>
  117. </td>
  118. </tr>
  119. {% endfor %}
  120. {% endif %}
  121. </table>
  122. <h1 class="ai-title">Add More</h1>
  123. <ul class="add-integration">
  124. <li>
  125. <img src="{% static 'img/integrations/slack.png' %}"
  126. class="icon" alt="Slack icon" />
  127. <h2>Slack</h2>
  128. <p>A messaging app for teams.</p>
  129. <a href="{% url 'hc-add-slack' %}" class="btn btn-primary">Add Integration</a>
  130. </li>
  131. <li>
  132. <img src="{% static 'img/integrations/email.png' %}"
  133. class="icon" alt="Email icon" />
  134. <h2>Email</h2>
  135. <p>Get an email message when check goes up or down.</p>
  136. <a href="{% url 'hc-add-email' %}" class="btn btn-primary">Add Integration</a>
  137. </li>
  138. <li>
  139. <img src="{% static 'img/integrations/webhook.png' %}"
  140. class="icon" alt="Webhook icon" />
  141. <h2>Webhook</h2>
  142. <p>Receive a HTTP callback when a check goes down.</p>
  143. <a href="{% url 'hc-add-webhook' %}" class="btn btn-primary">Add Integration</a>
  144. </li>
  145. <li>
  146. <img src="{% static 'img/integrations/pd.png' %}"
  147. class="icon" alt="PagerDuty icon" />
  148. <h2>PagerDuty</h2>
  149. <p>On-call scheduling, alerting, and incident tracking.</p>
  150. <a href="{% url 'hc-add-pd' %}" class="btn btn-primary">Add Integration</a>
  151. </li>
  152. <li>
  153. <img src="{% static 'img/integrations/hipchat.png' %}"
  154. class="icon" alt="HipChat icon" />
  155. <h2>HipChat</h2>
  156. <p>Group and private chat, file sharing, and integrations.</p>
  157. <a href="{% url 'hc-add-hipchat' %}" class="btn btn-primary">Add Integration</a>
  158. </li>
  159. <li>
  160. <img src="{% static 'img/integrations/victorops.png' %}"
  161. class="icon" alt="VictorOps icon" />
  162. <h2>VictorOps</h2>
  163. <p>On-call scheduling, alerting, and incident tracking.</p>
  164. <a href="{% url 'hc-add-victorops' %}" class="btn btn-primary">Add Integration</a>
  165. </li>
  166. <li>
  167. <img src="{% static 'img/integrations/opsgenie.png' %}"
  168. class="icon" alt="OpsGenie icon" />
  169. <h2>OpsGenie</h2>
  170. <p> Alerting &amp; Incident Management Solution for Dev &amp; Ops.</p>
  171. <a href="{% url 'hc-add-opsgenie' %}" class="btn btn-primary">Add Integration</a>
  172. </li>
  173. {% if enable_pushbullet %}
  174. <li>
  175. <img src="{% static 'img/integrations/pushbullet.png' %}"
  176. class="icon" alt="Pushbullet icon" />
  177. <h2>Pushbullet</h2>
  178. <p>Pushbullet connects your devices, making them feel like one.</p>
  179. <a href="{% url 'hc-add-pushbullet' %}" class="btn btn-primary">Add Integration</a>
  180. </li>
  181. {% endif %}
  182. {% if enable_pushover %}
  183. <li>
  184. <img src="{% static 'img/integrations/pushover.png' %}"
  185. class="icon" alt="Pushover icon" />
  186. <h2>Pushover</h2>
  187. <p>Receive instant push notifications on your phone or tablet.</p>
  188. <a href="{% url 'hc-add-pushover' %}" class="btn btn-primary">Add Integration</a>
  189. </li>
  190. {% endif %}
  191. {% if enable_discord %}
  192. <li>
  193. <img src="{% static 'img/integrations/discord.png' %}"
  194. class="icon" alt="Discord icon" />
  195. <h2>Discord</h2>
  196. <p>Cross-platform voice and text chat app designed for gamers.</p>
  197. <a href="{% url 'hc-add-discord' %}" class="btn btn-primary">Add Integration</a>
  198. </li>
  199. {% endif %}
  200. <li class="link-to-github">
  201. <img src="{% static 'img/integrations/missing.png' %}"
  202. class="icon" alt="Suggest New Integration" />
  203. <p>
  204. Your favorite service or notification method not listed? <br />
  205. Please <a href="https://github.com/healthchecks/healthchecks/issues">file an issue on GitHub</a>!
  206. </p>
  207. </li>
  208. </ul>
  209. </div>
  210. </div>
  211. <div id="checks-modal" class="modal">
  212. <div class="modal-dialog">
  213. <div class="modal-content">
  214. </div>
  215. </div>
  216. </div>
  217. <div id="remove-channel-modal" class="modal">
  218. <div class="modal-dialog">
  219. <form id="remove-channel-form" method="post">
  220. {% csrf_token %}
  221. <div class="modal-content">
  222. <div class="modal-header">
  223. <button type="button" class="close" data-dismiss="modal">&times;</button>
  224. <h4 class="remove-check-title">Remove Channel <span class="remove-channel-name"></span></h4>
  225. </div>
  226. <div class="modal-body">
  227. <p>You are about to remove channel
  228. <strong class="remove-channel-name">---</strong>.
  229. </p>
  230. <p>Once it's gone it's gone. But, if you change your
  231. mind later, you can create a similar channel again.</p>
  232. <p>Do you want to continue?</p>
  233. </div>
  234. <div class="modal-footer">
  235. <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
  236. <button type="submit" class="btn btn-danger">Remove</button>
  237. </div>
  238. </div>
  239. </form>
  240. </div>
  241. </div>
  242. {% endblock %}
  243. {% block scripts %}
  244. {% compress js %}
  245. <script src="{% static 'js/jquery-2.1.4.min.js' %}"></script>
  246. <script src="{% static 'js/bootstrap.min.js' %}"></script>
  247. <script src="{% static 'js/channels.js' %}"></script>
  248. {% endcompress %}
  249. {% endblock %}