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.

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