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.

143 lines
5.1 KiB

  1. {% extends "base.html" %}
  2. {% load compress static hc_extras %}
  3. {% block title %}Status Badges - {{ site_name }}{% endblock %}
  4. {% block content %}
  5. <div class="row">
  6. <div class="col-sm-10">
  7. <h1>Status Badges</h1>
  8. <p id="badges-description">
  9. {{ site_name }} provides status badges for each of the tags
  10. you have used. The badges have public, but hard-to-guess
  11. URLs. You can use them in your READMEs,
  12. dashboards or status pages.
  13. </p>
  14. <p>Each badge can be in one of the following states:</p>
  15. <ul>
  16. <li><strong>up</strong> – all matching checks are up.</li>
  17. <li><strong>down</strong> – at least one check is currently down.</li>
  18. </ul>
  19. <p>
  20. As an option, the badges can report a third state:
  21. <strong>late</strong> (when at least one check is running late but has not
  22. exceeded its grace time yet).
  23. </p>
  24. <br />
  25. <div class="btn-group" data-toggle="buttons">
  26. <label id="show-svg" class="btn btn-default active" data->
  27. <input type="radio" autocomplete="off" checked> SVG
  28. </label>
  29. <label id="show-json" class="btn btn-default">
  30. <input type="radio" autocomplete="off"> JSON
  31. </label>
  32. <label id="show-shields" class="btn btn-default">
  33. <input type="radio" autocomplete="off"> Shields.io
  34. </label>
  35. </div>
  36. &nbsp;
  37. <div class="btn-group" data-toggle="buttons">
  38. <label id="show-no-late" class="btn btn-default active">
  39. <input type="radio" autocomplete="off" checked> Badge states: <b>up</b> or <b>down</b>
  40. </label>
  41. <label id="show-with-late" class="btn btn-default">
  42. <input type="radio" autocomplete="off"> Badge states: <b>up</b>, <b>late</b> or <b>down</b>
  43. </label>
  44. </div>
  45. <table id="badges-svg" class="table badge-preview">
  46. {% if have_tags %}
  47. <tr><th colspan="2">Tags</th></tr>
  48. {% endif %}
  49. {% for urldict in badges %}
  50. {% if urldict.tag == "*" %}
  51. <tr>
  52. <th colspan="2">Overall Status</th>
  53. </tr>
  54. {% endif %}
  55. <tr>
  56. <td>
  57. <img class="no-late" src="{{ urldict.svg }}" alt="" />
  58. <img class="with-late" src="{{ urldict.svg3 }}" alt="" />
  59. </td>
  60. <td>
  61. <code class="no-late">{{ urldict.svg }}</code>
  62. <code class="with-late">{{ urldict.svg3 }}</code>
  63. </td>
  64. </tr>
  65. {% endfor %}
  66. </table>
  67. <table id="badges-json" class="table badge-preview">
  68. {% if have_tags %}
  69. <tr>
  70. <th colspan="2">Tags</th>
  71. </tr>
  72. {% endif %}
  73. {% for urldict in badges %}
  74. {% if urldict.tag == "*" %}
  75. <tr>
  76. <th colspan="2">Overall Status</th>
  77. </tr>
  78. {% endif %}
  79. <tr>
  80. <td>
  81. <code class="fetch-json no-late" data-url="{{ urldict.json }}"></code>
  82. <code class="fetch-json with-late" data-url="{{ urldict.json3 }}"></code>
  83. </td>
  84. <td>
  85. <code class="no-late">{{ urldict.json }}</code>
  86. <code class="with-late">{{ urldict.json3 }}</code>
  87. </td>
  88. </tr>
  89. {% endfor %}
  90. </table>
  91. <table id="badges-shields" class="table badge-preview">
  92. {% if have_tags %}
  93. <tr>
  94. <th>Shields.io badge</th>
  95. <th>JSON endpoint for Shields.io <a href="https://shields.io/endpoint">(how to use)</a></th>
  96. </tr>
  97. {% endif %}
  98. {% for urldict in badges %}
  99. {% if urldict.tag == "*" %}
  100. <tr>
  101. <th colspan="2">Overall Status</th>
  102. </tr>
  103. {% endif %}
  104. <tr>
  105. <td>
  106. <img class="no-late" src="https://img.shields.io/endpoint?url={{ urldict.shields|urlencode:"" }}" alt="" />
  107. <img class="with-late" src="https://img.shields.io/endpoint?url={{ urldict.shields3|urlencode:"" }}" alt="" />
  108. </td>
  109. <td>
  110. <code class="no-late">{{ urldict.shields }}</code>
  111. <code class="with-late">{{ urldict.shields3 }}</code>
  112. </td>
  113. </tr>
  114. {% endfor %}
  115. </table>
  116. </div>
  117. </div>
  118. </div>
  119. {% endblock %}
  120. {% block scripts %}
  121. {% compress js %}
  122. <script src="{% static 'js/jquery-2.1.4.min.js' %}"></script>
  123. <script src="{% static 'js/bootstrap.min.js' %}"></script>
  124. <script src="{% static 'js/badges.js' %}"></script>
  125. {% endcompress %}
  126. {% endblock %}