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

{% extends "base.html" %}
{% load compress humanize staticfiles hc_extras %}
{% block title %}Add Slack - {% site_name %}{% endblock %}
{% block content %}
<div class="row">
<div class="col-sm-12">
{% if slack_client_id %}
<div class="jumbotron">
{% if request.user.is_authenticated %}
<p>If your team uses <a href="http://slack.com/">Slack</a>, you can set
up {% site_name %} to post status updates directly to an appropriate
Slack channel.</p>
<div class="text-center">
<a href="https://slack.com/oauth/authorize?scope=incoming-webhook&client_id={{ slack_client_id }}">
<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" />
</a>
</div>
{% else %}
<p>
healthchecks.io is a <strong>free</strong> and
<a href="https://github.com/healthchecks/healthchecks">open source</a>
service for monitoring your cron jobs, background processes and
scheduled tasks. Before adding Slack integration, please log into
{% site_root %}:</p>
<div class="text-center">
<form class="form-inline" action="{% url 'hc-login' %}" method="post">
{% csrf_token %}
<div class="form-group">
<div class="input-group input-group-lg">
<div class="input-group-addon">@</div>
<input
type="email"
class="form-control"
name="email"
autocomplete="email"
placeholder="Email">
</div>
</div>
<div class="form-group">
<button type="submit" class="btn btn-lg btn-primary pull-right">
Log In
</button>
</div>
</form>
</div>
{% endif %}
</div>
<h2>Setup Guide</h2>
<div class="row ai-step">
<div class="col-sm-6">
<span class="step-no">2</span>
<p>
After {% if request.user.is_authenticated %}{% else %}logging in and{% endif %}
clicking on "Add to Slack", you should
be on a page that says "healthchecks.io would like access to
your Slack team". Select the team you want to add the
healthchecks.io integration app to.
</p>
</div>
<div class="col-sm-6">
<img
class="ai-guide-screenshot"
alt="Screenshot"
src="{% static 'img/integrations/setup_slack_btn_1.png' %}">
</div>
</div>
<div class="row ai-step">
<div class="col-sm-6">
<span class="step-no">3</span>
<p>
You should now be on a page that says "healthchecks.io would
like access to <i>TEAM NAME</i>". Select the channel you want to
post healthchecks.io notifications to.
</p>
</div>
<div class="col-sm-6">
<img
class="ai-guide-screenshot"
alt="Screenshot"
src="{% static 'img/integrations/setup_slack_btn_2.png' %}">
</div>
</div>
<div class="row ai-step">
<div class="col-sm-6">
<span class="step-no">4</span>
<p>
That is all! You will now be redirected back to
"Integrations" page on {% site_name %} and see
the new integration!
</p>
</div>
<div class="col-sm-6">
<img
class="ai-guide-screenshot"
alt="Screenshot"
src="{% static 'img/integrations/setup_slack_btn_3.png' %}">
</div>
</div>
{% else %}
<h1>Slack</h1>
<p>If your team uses <a href="http://slack.com/">Slack</a>, you can set
up {% site_name %} to post status updates directly to an appropriate
Slack channel.</p>
<h2>Setup Guide</h2>
<div class="row ai-step">
<div class="col-sm-6">
<span class="step-no">1</span>
Log into your Slack account and
pick an appropriate Slack channel. From the dropdown next to
channel's name, pick <strong>Add a service integration...</strong>
</div>
<div class="col-sm-6">
<img
class="ai-guide-screenshot"
alt="Screenshot"
src="{% static 'img/integrations/setup_slack_1.png' %}">
</div>
</div>
<div class="row ai-step">
<div class="col-sm-6">
<span class="step-no">2</span>
From the list of available integrations, select
<strong>Incoming WebHooks</strong>, and click on
<strong>Add Incoming WebHooks Integration</strong>.
</div>
</div>
<div class="row ai-step">
<div class="col-sm-6">
<span class="step-no">3</span>
<p>Copy the displayed <strong>WebHook URL</strong> and paste it down below.</p>
<p>Save the integration, and it's done!</p>
</div>
<div class="col-sm-6">
<img
class="ai-guide-screenshot"
alt="Screenshot"
src="{% static 'img/integrations/setup_slack_2.png' %}">
</div>
</div>
<h2>Integration Settings</h2>
<form method="post" class="form-horizontal" action="{% url 'hc-add-channel' %}">
{% csrf_token %}
<input type="hidden" name="kind" value="slack" />
<div class="form-group">
<label class="col-sm-2 control-label">Callback URL</label>
<div class="col-sm-10">
<input type="text" class="form-control" name="value" placeholder="">
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<button type="submit" class="btn btn-primary">Save Integration</button>
</div>
</div>
</form>
{% endif %}
</div>
</div>
{% endblock %}
{% block scripts %}
{% compress js %}
<script src="{% static 'js/jquery-2.1.4.min.js' %}"></script>
<script src="{% static 'js/bootstrap.min.js' %}"></script>
{% endcompress %}
{% endblock %}