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.

237 lines
8.3 KiB

  1. {% extends "base.html" %}
  2. {% load compress humanize staticfiles hc_extras %}
  3. {% block title %}Integrations - healthchecks.io{% 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>
  26. {% if ch.kind == "email" %} Email {% endif %}
  27. {% if ch.kind == "webhook" %} Webhook {% endif %}
  28. {% if ch.kind == "slack" %} Slack {% endif %}
  29. {% if ch.kind == "hipchat" %} HipChat {% endif %}
  30. {% if ch.kind == "pd" %} PagerDuty {% endif %}
  31. {% if ch.kind == "po" %} Pushover {% endif %}
  32. {% if ch.kind == "victorops" %} VictorOps {% endif %}
  33. </td>
  34. <td class="value-cell">
  35. {% if ch.kind == "email" %}
  36. <span class="preposition">to</span>
  37. {{ ch.value }}
  38. {% if not ch.email_verified %}
  39. <span class="channel-unconfirmed">(unconfirmed)</span>
  40. {% endif %}
  41. {% elif ch.kind == "pd" %}
  42. <span class="preposition">API key</span>
  43. {{ ch.value }}
  44. {% elif ch.kind == "victorops" %}
  45. <span class="preposition">Post URL</span>
  46. {{ ch.value }}
  47. {% elif ch.kind == "po" %}
  48. <span class="preposition">user key</span>
  49. {{ ch.po_value|first }}
  50. ({{ ch.po_value|last }} priority)
  51. {% elif ch.kind == "slack" %}
  52. {% if ch.slack_team %}
  53. <span class="preposition">team</span>
  54. {{ ch.slack_team }},
  55. <span class="preposition">channel</span>
  56. {{ ch.slack_channel }}
  57. {% else %}
  58. {{ ch.value }}
  59. {% endif %}
  60. {% elif ch.kind == "webhook" %}
  61. <table>
  62. {% if ch.value_down %}
  63. <tr>
  64. <td class="preposition">down&nbsp;</td>
  65. <td>{{ ch.value_down }}</td>
  66. </tr>
  67. {% endif %}
  68. {% if ch.value_up %}
  69. <tr>
  70. <td class="preposition">up&nbsp;</td>
  71. <td>{{ ch.value_up }}</td>
  72. </tr>
  73. {% endif %}
  74. </table>
  75. {% else %}
  76. {{ ch.value }}
  77. {% endif %}
  78. </td>
  79. <td class="channels-num-checks">
  80. <a
  81. class="edit-checks"
  82. href="{% url 'hc-channel-checks' ch.code %}">
  83. {{ ch.n_checks }} of {{ num_checks }}
  84. </a>
  85. </td>
  86. <td>
  87. {% with n=ch.latest_notification %}
  88. {% if n %}
  89. {% if n.error %}
  90. <span class="text-danger" data-toggle="tooltip" title="{{ n.error }}">
  91. <strong>Failed</strong>, {{ n.created|naturaltime }}
  92. </span>
  93. {% else %}
  94. Delivered, {{ n.created|naturaltime }}
  95. {% endif %}
  96. {% else %}
  97. Never
  98. {% endif %}
  99. {% endwith %}
  100. </td>
  101. <td>
  102. <button
  103. data-name="{{ ch.value }}"
  104. data-url="{% url 'hc-remove-channel' ch.code %}"
  105. class="btn btn-sm btn-default channel-remove"
  106. type="button">
  107. <span class="glyphicon glyphicon-trash"></span>
  108. </button>
  109. </td>
  110. <td>
  111. </td>
  112. </tr>
  113. {% endfor %}
  114. {% endif %}
  115. </table>
  116. <h1 class="ai-title">Add More</h1>
  117. <ul class="add-integration">
  118. <li>
  119. <img src="{% static 'img/integrations/slack.png' %}"
  120. class="icon" alt="Slack icon" />
  121. <h2>Slack</h2>
  122. <p>A messaging app for teams.</p>
  123. <a href="{% url 'hc-add-slack' %}" class="btn btn-primary">Add Integration</a>
  124. </li>
  125. <li>
  126. <img src="{% static 'img/integrations/email.png' %}"
  127. class="icon" alt="Email icon" />
  128. <h2>Email</h2>
  129. <p>Get an email message when check goes up or down.</p>
  130. <a href="{% url 'hc-add-email' %}" class="btn btn-primary">Add Integration</a>
  131. </li>
  132. <li>
  133. <img src="{% static 'img/integrations/webhook.png' %}"
  134. class="icon" alt="Webhook icon" />
  135. <h2>Webhook</h2>
  136. <p>Receive a HTTP callback when a check goes down.</p>
  137. <a href="{% url 'hc-add-webhook' %}" class="btn btn-primary">Add Integration</a>
  138. </li>
  139. <li>
  140. <img src="{% static 'img/integrations/pd.png' %}"
  141. class="icon" alt="PagerDuty icon" />
  142. <h2>PagerDuty</h2>
  143. <p>On-call scheduling, alerting, and incident tracking.</p>
  144. <a href="{% url 'hc-add-pd' %}" class="btn btn-primary">Add Integration</a>
  145. </li>
  146. <li>
  147. <img src="{% static 'img/integrations/hipchat.png' %}"
  148. class="icon" alt="HipChat icon" />
  149. <h2>HipChat</h2>
  150. <p>Group and private chat, file sharing, and integrations.</p>
  151. <a href="{% url 'hc-add-hipchat' %}" class="btn btn-primary">Add Integration</a>
  152. </li>
  153. <li>
  154. <img src="{% static 'img/integrations/victorops.png' %}"
  155. class="icon" alt="VictorOps icon" />
  156. <h2>VictorOps</h2>
  157. <p>On-call scheduling, alerting, and incident tracking.</p>
  158. <a href="{% url 'hc-add-victorops' %}" class="btn btn-primary">Add Integration</a>
  159. </li>
  160. {% if enable_pushover %}
  161. <li>
  162. <img src="{% static 'img/integrations/pushover.png' %}"
  163. class="icon" alt="Pushover icon" />
  164. <h2>Pushover</h2>
  165. <p>Receive instant push notifications on your phone or tablet.</p>
  166. <a href="{% url 'hc-add-pushover' %}" class="btn btn-primary">Add Integration</a>
  167. </li>
  168. {% endif %}
  169. </ul>
  170. </div>
  171. </div>
  172. <div id="checks-modal" class="modal">
  173. <div class="modal-dialog">
  174. <div class="modal-content">
  175. </div>
  176. </div>
  177. </div>
  178. <div id="remove-channel-modal" class="modal">
  179. <div class="modal-dialog">
  180. <form id="remove-channel-form" method="post">
  181. {% csrf_token %}
  182. <div class="modal-content">
  183. <div class="modal-header">
  184. <button type="button" class="close" data-dismiss="modal">&times;</button>
  185. <h4 class="remove-check-title">Remove Channel <span class="remove-channel-name"></span></h4>
  186. </div>
  187. <div class="modal-body">
  188. <p>You are about to remove channel
  189. <strong class="remove-channel-name">---</strong>.
  190. </p>
  191. <p>Once it's gone it's gone. But, if you change your
  192. mind later, you can create a similar channel again.</p>
  193. <p>Do you want to continue?</p>
  194. </div>
  195. <div class="modal-footer">
  196. <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
  197. <button type="submit" class="btn btn-danger">Remove</button>
  198. </div>
  199. </div>
  200. </form>
  201. </div>
  202. </div>
  203. {% endblock %}
  204. {% block scripts %}
  205. {% compress js %}
  206. <script src="{% static 'js/jquery-2.1.4.min.js' %}"></script>
  207. <script src="{% static 'js/bootstrap.min.js' %}"></script>
  208. <script src="{% static 'js/channels.js' %}"></script>
  209. {% endcompress %}
  210. {% endblock %}