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.

116 lines
3.7 KiB

  1. {% extends "base.html" %}
  2. {% load compress humanize staticfiles hc_extras %}
  3. {% block title %}Notification Channels - healthchecks.io{% endblock %}
  4. {% block content %}
  5. <div class="row">
  6. <div class="col-sm-12">
  7. <h1>Notification Channels</h1>
  8. <table class="table channels-table">
  9. <tr>
  10. <th>Type</th>
  11. <th>Value</th>
  12. <th>Assigned Checks</th>
  13. <th></th>
  14. </tr>
  15. {% for ch in channels %}
  16. <tr>
  17. <td>
  18. {% if ch.kind == "email" %} Email {% endif %}
  19. {% if ch.kind == "webhook" %} Webhook {% endif %}
  20. {% if ch.kind == "pd" %} PagerDuty {% endif %}
  21. </td>
  22. <td>
  23. <span class="preposition">
  24. {% if ch.kind == "email" %} to {% endif %}
  25. {% if ch.kind == "pd" %} service key {% endif %}
  26. </span>
  27. {{ ch.value }}
  28. {% if ch.kind == "email" and not ch.email_verified %}
  29. <span class="channel-unconfirmed">(unconfirmed)
  30. {% endif %}
  31. </td>
  32. <td class="channels-num-checks">
  33. <a
  34. class="edit-checks"
  35. href="{% url 'hc-channel-checks' ch.code %}">
  36. {{ ch.checks.count }} of {{ num_checks }}
  37. </a>
  38. </td>
  39. </tr>
  40. {% endfor %}
  41. <tr>
  42. <th colspan="2" class="channels-add-title">
  43. Add Notification Channel
  44. </th>
  45. </tr>
  46. <tr>
  47. <form method="post" action="{% url 'hc-add-channel' %}">
  48. <td>
  49. <select id="add-check-kind" class="form-control" name="kind">
  50. <option value="email">Email</option>
  51. <option value="webhook">Webhook</option>
  52. <option value="pd">PagerDuty</option>
  53. </select>
  54. </td>
  55. <td class="form-inline">
  56. {% csrf_token %}
  57. <input
  58. id="add-check-value"
  59. name="value"
  60. class="form-control"
  61. type="text"
  62. placeholder="[email protected]" />
  63. <button type="submit" class="btn btn-success">Add</button>
  64. </td>
  65. <td>
  66. </td>
  67. </form>
  68. </tr>
  69. <tr>
  70. <td colspan="3" class="channels-add-help">
  71. <p class="email">
  72. Healthchecks.io will send an email to the specified
  73. address when a check goes
  74. <span class="word-up">up</span> or <span class="word-down">down</span>.
  75. </p>
  76. <p class="channels-help-hidden webhook">
  77. Healthchecks.io will request the specified URL when
  78. a check goes
  79. <span class="word-down">down</span>.
  80. </p>
  81. <p class="channels-help-hidden pd">
  82. Healthchecks.io will create an incident on PagerDuty when
  83. a check goes
  84. <span class="word-down">down</span> and will resolve it
  85. when same check goes <span class="word-up">up</span>
  86. </p>
  87. </td>
  88. </tr>
  89. </table>
  90. </div>
  91. </div>
  92. <div id="checks-modal" class="modal">
  93. <div class="modal-dialog">
  94. <div class="modal-content">
  95. </div>
  96. </form>
  97. </div>
  98. </div>
  99. {% endblock %}
  100. {% block scripts %}
  101. {% compress js %}
  102. <script src="{% static 'js/jquery-2.1.4.min.js' %}"></script>
  103. <script src="{% static 'js/bootstrap.min.js' %}"></script>
  104. <script src="{% static 'js/channels.js' %}"></script>
  105. {% endcompress %}
  106. {% endblock %}