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.

151 lines
5.9 KiB

9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
  1. {% load hc_extras static %}
  2. <table
  3. id="checks-table"
  4. class="table {% if rw %}rw{% endif%}"
  5. data-list-url="{% url 'hc-checks' project.code %}"
  6. data-status-url="{% url 'hc-status' project.code %}">
  7. <tr>
  8. <th></th>
  9. <th class="th-name">
  10. {% if sort == "name" %}
  11. <a href="?sort=-name" data-toggle="tooltip" class="sort-name">
  12. Name<span class="ic-asc"></span>
  13. </a>
  14. {% elif sort == "-name" %}
  15. <a href="?sort=created" data-toggle="tooltip" class="sort-name">
  16. Name<span class="ic-desc"></span>
  17. </a>
  18. {% else %}
  19. <a href="?sort=name" data-toggle="tooltip" class="default sort-name">
  20. Name
  21. </a>
  22. {% endif %}
  23. </th>
  24. <th class="hidden-xs hidden-sm">
  25. <span class="visible-lg-inline">
  26. Ping URL
  27. </span>
  28. <span class="visible-md-inline">{{ project.show_slugs|yesno:"Key/Slug,UUID" }}</span>
  29. {% if rw %}
  30. <small id="url-style-switcher">
  31. <a href="?urls=uuid" {% if not project.show_slugs %}class="active"{% endif %}>uuid</a>
  32. <a href="?urls=slug" {% if project.show_slugs %}class="active"{% endif %}>slug</a>
  33. </small>
  34. {% endif %}
  35. </th>
  36. <th class="th-integrations hidden-xs">Integrations</th>
  37. <th class="th-period hidden-xs">
  38. Period <br />
  39. <span class="checks-subline">Grace</span>
  40. </th>
  41. <th class="th-last-ping hidden-xs">
  42. {% if sort == "last_ping" %}
  43. <a href="?sort=created" data-toggle="tooltip" class="sort-last-ping">
  44. Last Ping<span class="ic-desc"></span>
  45. </a>
  46. {% elif sort == "-last_ping" %}
  47. <a href="?sort=last_ping" data-toggle="tooltip" class="sort-last-ping">
  48. Last Ping<span class="ic-asc"></span>
  49. </a>
  50. {% else %}
  51. <a href="?sort=-last_ping" data-toggle="tooltip" class="default sort-last-ping">
  52. Last Ping
  53. </a>
  54. {% endif %}
  55. {% if show_last_duration %}
  56. <br />
  57. <span class="checks-subline">Last Duration</span>
  58. {% endif %}
  59. </th>
  60. <th></th>
  61. </tr>
  62. {% for check in checks %}
  63. <tr id="{{ check.code }}" class="checks-row" {% if check in hidden_checks %}style="display: none"{% endif %}>
  64. <td class="indicator-cell">
  65. <span class="status ic-{{ check.get_status }}" data-toggle="tooltip"></span>
  66. <div class="spinner {% if check.last_start %}started{% endif %}">
  67. <div class="d1"></div>
  68. <div class="d2"></div>
  69. <div class="d3"></div>
  70. </div>
  71. </td>
  72. <td>
  73. <div data-name="{{ check.name }}"
  74. data-tags="{{ check.tags }}"
  75. data-desc="{{ check.desc }}"
  76. class="my-checks-name {% if not check.name %}unnamed{% endif %}">
  77. <div>{{ check.name|default:"unnamed"|break_underscore }}</div>
  78. {% for tag in check.tags_list %}
  79. <span class="label label-tag">{{ tag }}</span>
  80. {% endfor %}
  81. </div>
  82. </td>
  83. <td class="hidden-xs hidden-sm url">
  84. {% if project.show_slugs and not check.slug %}
  85. <span class="unavailable">unavailable, set name first</span>
  86. {% else %}
  87. <span class="my-checks-url">{{ check.url|format_ping_endpoint }}</span>
  88. {% if project.show_slugs and check.slug in ambiguous %}
  89. <small class="text-danger">(not unique)</small>
  90. {% endif %}
  91. <button class="copy-link" data-clipboard-text="{{ check.url }}">copy</button>
  92. {% endif %}
  93. </td>
  94. <td class="hidden-xs">
  95. {% if channels|length <= 10 %}
  96. <div class="integrations">
  97. {% spaceless %}
  98. {% for channel in channels %}
  99. <span class="ic-{{ channel.kind }}{% if channel in check.channel_set.all %}{% else %} off{% endif %}"></span>
  100. {% endfor %}
  101. {% endspaceless %}
  102. </div>
  103. {% else %}
  104. {{ check.channel_set.all|length }} of {{ channels|length }}
  105. {% endif %}
  106. </td>
  107. <td class="hidden-xs">
  108. <div class="timeout-grace"
  109. data-kind="{{ check.kind }}"
  110. data-timeout="{{ check.timeout.total_seconds }}"
  111. data-grace="{{ check.grace.total_seconds }}"
  112. data-schedule="{{ check.schedule }}"
  113. data-tz="{{ check.tz }}">
  114. {% if check.kind == "simple" %}
  115. {{ check.timeout|hc_duration }}
  116. <br />
  117. {% elif check.kind == "cron" %}
  118. <div class="cron-expression">{{ check.schedule }}</div>
  119. {% endif %}
  120. <span class="checks-subline">
  121. {{ check.grace|hc_duration }}
  122. </span>
  123. </div>
  124. </td>
  125. <td class="hidden-xs">
  126. <div id="lpd-{{ check.code }}" class="last-ping">
  127. {% include "front/last_ping_cell.html" with check=check %}
  128. </div>
  129. </td>
  130. <td class="actions">
  131. {% if rw %}
  132. <button class="btn btn-default pause" type="button">
  133. <span class="ic-paused"></span>
  134. </button>
  135. {% endif %}
  136. <button title="Show Details" class="btn btn-default show-log" type="button">
  137. <span class="ic-dots"></span>
  138. </button>
  139. </td>
  140. </tr>
  141. {% endfor %}
  142. </table>
  143. {% for channel in channels %}
  144. <div
  145. id="ch-{{ forloop.counter0}}"
  146. data-code="{{ channel.code }}"
  147. data-title="{{ channel }}">
  148. </div>
  149. {% endfor %}