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.

101 lines
3.4 KiB

9 years ago
  1. {% extends "base.html" %}
  2. {% load compress humanize staticfiles hc_extras %}
  3. {% block title %}Add Webhook - {% site_name %}{% endblock %}
  4. {% block content %}
  5. <div class="row">
  6. <div class="col-sm-12">
  7. <h1>Webhook</h1>
  8. <p>Webhooks are a simple way to notify an external system when a check
  9. goes up or down. healthcheks.io will run a normal HTTP GET call to your
  10. specified URL.</p>
  11. <p>You can use the following variables in webhook URLs:</p>
  12. <table class="table webhook-variables">
  13. <tr>
  14. <th class="variable-column">Variable</th>
  15. <td>Will be replaced with…</td>
  16. </tr>
  17. <tr>
  18. <th><code>$CODE</code></th>
  19. <td>The UUID code of the check</td>
  20. </tr>
  21. <tr>
  22. <th><code>$NAME</code></th>
  23. <td>Urlencoded name of the check</td>
  24. </tr>
  25. <tr>
  26. <th><code>$STATUS</code></th>
  27. <td>Check's current status ("up" or "down")</td>
  28. </tr>
  29. <tr>
  30. <th><code>$TAG1, $TAG2, …</code></th>
  31. <td>Urlencoded value of the first tag, the second tag, …</td>
  32. </tr>
  33. </table>
  34. <p>For example, a callback URL using variables might look like so:
  35. <pre>http://requestb.in/1hhct291?message=<strong>$NAME</strong>:<strong>$STATUS</strong></pre>
  36. <p>
  37. After encoding and replacing the variables, {% site_name %} would then call:
  38. </p>
  39. <pre>http://requestb.in/1hhct291?message=<strong>My%20Check</strong>:<strong>down</strong></pre>
  40. <h2>Integration Settings</h2>
  41. <form method="post" class="form-horizontal">
  42. {% csrf_token %}
  43. <input type="hidden" name="kind" value="webhook" />
  44. <div class="form-group {{ form.value_down.css_classes }}">
  45. <label class="col-sm-2 control-label">URL for "down" events</label>
  46. <div class="col-sm-10">
  47. <input
  48. type="text"
  49. class="form-control"
  50. name="value_down"
  51. placeholder="http://..."
  52. value="{{ form.value_down.value|default:"" }}">
  53. {% if form.value_down.errors %}
  54. <div class="help-block">
  55. {{ form.value_down.errors|join:"" }}
  56. </div>
  57. {% endif %}
  58. </div>
  59. </div>
  60. <div class="form-group {{ form.value_up.css_classes }}">
  61. <label class="col-sm-2 control-label">URL for "up" events</label>
  62. <div class="col-sm-10">
  63. <input
  64. type="text"
  65. class="form-control"
  66. name="value_up"
  67. placeholder="http://..."
  68. value="{{ form.value_up.value|default:"" }}">
  69. {% if form.value_up.errors %}
  70. <div class="help-block">
  71. {{ form.value_up.errors|join:"" }}
  72. </div>
  73. {% endif %}
  74. </div>
  75. </div>
  76. <div class="form-group">
  77. <div class="col-sm-offset-2 col-sm-10">
  78. <button type="submit" class="btn btn-primary">Save Integration</button>
  79. </div>
  80. </div>
  81. </form>
  82. </div>
  83. </div>
  84. {% endblock %}
  85. {% block scripts %}
  86. {% compress js %}
  87. <script src="{% static 'js/jquery-2.1.4.min.js' %}"></script>
  88. <script src="{% static 'js/bootstrap.min.js' %}"></script>
  89. {% endcompress %}
  90. {% endblock %}