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.

176 lines
6.7 KiB

7 years ago
  1. {% extends "base.html" %}
  2. {% load compress humanize static hc_extras %}
  3. {% block title %}Add Pushover - {% site_name %}{% endblock %}
  4. {% block content %}
  5. <div class="row">
  6. <div class="col-sm-12">
  7. <div class="jumbotron">
  8. {% if request.user.is_authenticated %}
  9. <p>
  10. <a href="https://www.pushover.net/">Pushover</a> delivers
  11. real-time notifications on your Android, iPhone, iPad, Desktop,
  12. Android Wear and Apple Watch. You can set up {% site_name %} to
  13. receive Pushover notifications in a few simple steps.
  14. </p>
  15. {% else %}
  16. <p>
  17. {% site_name %} is a <strong>free</strong> and
  18. <a href="https://github.com/healthchecks/healthchecks">open source</a>
  19. service for monitoring your cron jobs, background processes and
  20. scheduled tasks. Before adding Pushover integration, please log into
  21. {% site_name %}:</p>
  22. <div class="text-center">
  23. <a href="{% url 'hc-login' %}?next={% url 'hc-add-pushover' %}"
  24. class="btn btn-primary btn-lg">Sign In</a>
  25. </div>
  26. {% endif %}
  27. </div>
  28. {% if not request.user.is_authenticated %}
  29. <h2>Setup Guide</h2>
  30. <div class="row ai-step">
  31. <div class="col-sm-6">
  32. <span class="step-no">1</span>
  33. <p>
  34. After logging in, go to "Integrations &rarr; Add Pushover".
  35. Pushover supports different notification priorities from
  36. silent to "Emergency". Select your preferred priorities
  37. and click "Subscribe with Pushover".
  38. </p>
  39. </div>
  40. <div class="col-sm-6">
  41. <img
  42. class="ai-guide-screenshot"
  43. alt="Screenshot"
  44. src="{% static 'img/integrations/setup_pushover_1.png' %}">
  45. </div>
  46. </div>
  47. <div class="row ai-step">
  48. <div class="col-sm-6">
  49. <span class="step-no">2</span>
  50. <p>
  51. You will be redirected to
  52. <a href="https://pushover.net">pushover.net</a> and
  53. asked to confirm a subscription. Review the subscription
  54. details and click "Subscribe Me".
  55. </p>
  56. </div>
  57. <div class="col-sm-6">
  58. <img
  59. class="ai-guide-screenshot"
  60. alt="Screenshot"
  61. src="{% static 'img/integrations/setup_pushover_2.png' %}">
  62. </div>
  63. </div>
  64. <div class="row ai-step">
  65. <div class="col-sm-6">
  66. <span class="step-no">3</span>
  67. <p>
  68. That is all! You will now be redirected back to
  69. "Integrations" page on {% site_name %} and see
  70. the new integration!
  71. </p>
  72. </div>
  73. <div class="col-sm-6">
  74. <img
  75. class="ai-guide-screenshot"
  76. alt="Screenshot"
  77. src="{% static 'img/integrations/setup_pushover_3.png' %}">
  78. </div>
  79. </div>
  80. {% else %}
  81. <h2>Integration Settings</h2>
  82. <form id="add-pushover" method="post" class="form-horizontal" action="{% url 'hc-add-pushover' %}">
  83. {% csrf_token %}
  84. <div class="form-group">
  85. <label class="col-sm-3 control-label">Priority for "down" events</label>
  86. <div class="col-sm-8">
  87. <select name="po_priority" class="selectpicker form-control">
  88. <option
  89. value="-2"
  90. data-content="Lowest Priority. <span class='help'>Generates no notification on your device.</span>">
  91. Lowest Priority
  92. </option>
  93. <option
  94. value="-1"
  95. data-content="Low Priority. <span class='help'>Sends a quiet notification.</span>">
  96. Low Priority
  97. </option>
  98. <option value="0" selected="selected">
  99. Normal Priority
  100. </option>
  101. <option
  102. value="1"
  103. data-content="High Priority. <span class='help'>Bypasses user's quiet hours.</span>">
  104. High Priority
  105. </option>
  106. <option
  107. value="2"
  108. data-content="Emergency Priority. <span class='help'>Repeated every {{po_retry_delay|hc_duration }} for at most {{ po_expiration|hc_duration }} until you acknowledge them.</span>">
  109. Emergency Priority
  110. </option>
  111. </select>
  112. </div>
  113. </div>
  114. <div class="form-group">
  115. <label class="col-sm-3 control-label">Priority for "up" events</label>
  116. <div class="col-sm-8">
  117. <select name="po_priority_up" class="selectpicker form-control">
  118. <option
  119. value="-2"
  120. data-content="Lowest Priority. <span class='help'>Generates no notification on your device.</span>">
  121. Lowest Priority
  122. </option>
  123. <option
  124. value="-1"
  125. data-content="Low Priority. <span class='help'>Sends a quiet notification.</span>">
  126. Low Priority
  127. </option>
  128. <option value="0" selected="selected">
  129. Normal Priority
  130. </option>
  131. <option
  132. value="1"
  133. data-content="High Priority. <span class='help'>Bypasses user's quiet hours.</span>">
  134. High Priority
  135. </option>
  136. <option
  137. value="2"
  138. data-content="Emergency Priority. <span class='help'>Repeated every {{po_retry_delay|hc_duration }} for at most {{ po_expiration|hc_duration }} until you acknowledge them.</span>">
  139. Emergency Priority
  140. </option>
  141. </select>
  142. </div>
  143. </div>
  144. <div class="form-group">
  145. <div class="col-sm-offset-3 col-sm-8">
  146. <button type="submit" class="btn btn-default">
  147. <img class="ai-icon" src="{% static 'img/integrations/po.png' %}" alt="Pushover" />
  148. Subscribe with Pushover
  149. </button>
  150. </div>
  151. </div>
  152. </form>
  153. {% endif %}
  154. </div>
  155. </div>
  156. {% endblock %}
  157. {% block scripts %}
  158. {% compress js %}
  159. <script src="{% static 'js/jquery-2.1.4.min.js' %}"></script>
  160. <script src="{% static 'js/bootstrap.min.js' %}"></script>
  161. <script src="{% static 'js/bootstrap-select.min.js' %}"></script>
  162. {% endcompress %}
  163. {% endblock %}