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.

187 lines
6.3 KiB

9 years ago
  1. {% extends "base.html" %}
  2. {% load compress humanize staticfiles hc_extras %}
  3. {% block title %}Add Slack - healthchecks.io{% endblock %}
  4. {% block content %}
  5. <div class="row">
  6. <div class="col-sm-12">
  7. {% if slack_client_id %}
  8. <div class="jumbotron">
  9. {% if request.user.is_authenticated %}
  10. <p>If your team uses <a href="http://slack.com/">Slack</a>, you can set
  11. up healthchecks.io to post status updates directly to an appropriate
  12. Slack channel.</p>
  13. <div class="text-center">
  14. <a href="https://slack.com/oauth/authorize?scope=incoming-webhook&client_id={{ slack_client_id }}">
  15. <img alt="Add to Slack" height="40" width="139" src="https://platform.slack-edge.com/img/add_to_slack.png" srcset="https://platform.slack-edge.com/img/add_to_slack.png 1x, https://platform.slack-edge.com/img/[email protected] 2x" />
  16. </a>
  17. </div>
  18. {% else %}
  19. <p>
  20. healthchecks.io is a <strong>free</strong> and
  21. <a href="https://github.com/healthchecks/healthchecks">open source</a>
  22. service for monitoring your cron jobs, background processes and
  23. scheduled tasks. Before adding Slack integration, please log into
  24. healthchecks.io:</p>
  25. <div class="text-center">
  26. <form class="form-inline" action="{% url 'hc-login' %}" method="post">
  27. {% csrf_token %}
  28. <div class="form-group">
  29. <div class="input-group input-group-lg">
  30. <div class="input-group-addon">@</div>
  31. <input
  32. type="email"
  33. class="form-control"
  34. name="email"
  35. autocomplete="email"
  36. placeholder="Email">
  37. </div>
  38. </div>
  39. <div class="form-group">
  40. <button type="submit" class="btn btn-lg btn-primary pull-right">
  41. Log In
  42. </button>
  43. </div>
  44. </form>
  45. </div>
  46. {% endif %}
  47. </div>
  48. <h2>Setup Guide</h2>
  49. <div class="row ai-step">
  50. <div class="col-sm-6">
  51. <span class="step-no">2</span>
  52. <p>
  53. After {% if request.user.is_authenticated %}{% else %}logging in and{% endif %}
  54. clicking on "Add to Slack", you should
  55. be on a page that says "healthchecks.io would like access to
  56. your Slack team". Select the team you want to add the
  57. healthchecks.io integration app to.
  58. </p>
  59. </div>
  60. <div class="col-sm-6">
  61. <img
  62. class="ai-guide-screenshot"
  63. alt="Screenshot"
  64. src="{% static 'img/integrations/setup_slack_btn_1.png' %}">
  65. </div>
  66. </div>
  67. <div class="row ai-step">
  68. <div class="col-sm-6">
  69. <span class="step-no">3</span>
  70. <p>
  71. You should now be on a page that says "healthchecks.io would
  72. like access to <i>TEAM NAME</i>". Select the channel you want to
  73. post healthchecks.io notifications to.
  74. </p>
  75. </div>
  76. <div class="col-sm-6">
  77. <img
  78. class="ai-guide-screenshot"
  79. alt="Screenshot"
  80. src="{% static 'img/integrations/setup_slack_btn_2.png' %}">
  81. </div>
  82. </div>
  83. <div class="row ai-step">
  84. <div class="col-sm-6">
  85. <span class="step-no">4</span>
  86. <p>
  87. That is all! You will now be redirected back to
  88. "Integrations" page on healthchecks.io and see
  89. the new integration!
  90. </p>
  91. </div>
  92. <div class="col-sm-6">
  93. <img
  94. class="ai-guide-screenshot"
  95. alt="Screenshot"
  96. src="{% static 'img/integrations/setup_slack_btn_3.png' %}">
  97. </div>
  98. </div>
  99. {% else %}
  100. <h1>Slack</h1>
  101. <p>If your team uses <a href="http://slack.com/">Slack</a>, you can set
  102. up healthchecks.io to post status updates directly to an appropriate
  103. Slack channel.</p>
  104. <h2>Setup Guide</h2>
  105. <div class="row ai-step">
  106. <div class="col-sm-6">
  107. <span class="step-no">1</span>
  108. Log into your Slack account and
  109. pick an appropriate Slack channel. From the dropdown next to
  110. channel's name, pick <strong>Add a service integration...</strong>
  111. </div>
  112. <div class="col-sm-6">
  113. <img
  114. class="ai-guide-screenshot"
  115. alt="Screenshot"
  116. src="{% static 'img/integrations/setup_slack_1.png' %}">
  117. </div>
  118. </div>
  119. <div class="row ai-step">
  120. <div class="col-sm-6">
  121. <span class="step-no">2</span>
  122. From the list of available integrations, select
  123. <strong>Incoming WebHooks</strong>, and click on
  124. <strong>Add Incoming WebHooks Integration</strong>.
  125. </div>
  126. </div>
  127. <div class="row ai-step">
  128. <div class="col-sm-6">
  129. <span class="step-no">3</span>
  130. <p>Copy the displayed <strong>WebHook URL</strong> and paste it down below.</p>
  131. <p>Save the integration, and it's done!</p>
  132. </div>
  133. <div class="col-sm-6">
  134. <img
  135. class="ai-guide-screenshot"
  136. alt="Screenshot"
  137. src="{% static 'img/integrations/setup_slack_2.png' %}">
  138. </div>
  139. </div>
  140. <h2>Integration Settings</h2>
  141. <form method="post" class="form-horizontal" action="{% url 'hc-add-channel' %}">
  142. {% csrf_token %}
  143. <input type="hidden" name="kind" value="slack" />
  144. <div class="form-group">
  145. <label class="col-sm-2 control-label">Callback URL</label>
  146. <div class="col-sm-10">
  147. <input type="text" class="form-control" name="value" placeholder="">
  148. </div>
  149. </div>
  150. <div class="form-group">
  151. <div class="col-sm-offset-2 col-sm-10">
  152. <button type="submit" class="btn btn-primary">Save Integration</button>
  153. </div>
  154. </div>
  155. </form>
  156. {% endif %}
  157. </div>
  158. </div>
  159. {% endblock %}
  160. {% block scripts %}
  161. {% compress js %}
  162. <script src="{% static 'js/jquery-2.1.4.min.js' %}"></script>
  163. <script src="{% static 'js/bootstrap.min.js' %}"></script>
  164. {% endcompress %}
  165. {% endblock %}