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.

139 lines
5.0 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
8 years ago
9 years ago
  1. {% load hc_extras %}
  2. <table
  3. id="checks-table"
  4. class="table"
  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="icon-asc"></span>
  13. </a>
  14. {% elif sort == "-name" %}
  15. <a href="?sort=created" data-toggle="tooltip" class="sort-name">
  16. Name<span class="icon-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">Ping URL</span>
  26. <span class="visible-md">Code</span>
  27. </th>
  28. <th class="th-integrations hidden-xs">Integrations</th>
  29. <th class="th-period hidden-xs">
  30. Period <br />
  31. <span class="checks-subline">Grace</span>
  32. </th>
  33. <th class="th-last-ping">
  34. {% if sort == "last_ping" %}
  35. <a href="?sort=created" data-toggle="tooltip" class="sort-last-ping">
  36. Last Ping<span class="icon-desc"></span>
  37. </a>
  38. {% elif sort == "-last_ping" %}
  39. <a href="?sort=last_ping" data-toggle="tooltip" class="sort-last-ping">
  40. Last Ping<span class="icon-asc"></span>
  41. </a>
  42. {% else %}
  43. <a href="?sort=-last_ping" data-toggle="tooltip" class="default sort-last-ping">
  44. Last Ping</span>
  45. </a>
  46. {% endif %}
  47. {% if show_last_duration %}
  48. <br />
  49. <span class="checks-subline">Last Duration</span>
  50. {% endif %}
  51. </th>
  52. <th class="hidden-xs"></th>
  53. </tr>
  54. {% for check in checks %}
  55. <tr
  56. id="{{ check.code }}"
  57. class="checks-row"
  58. data-url="{{ check.url }}"
  59. data-email="{{ check.email }}"
  60. {% if check in hidden_checks %}style="display: none"{% endif %}>
  61. <td class="indicator-cell">
  62. <span class="status icon-{{ check.get_status }}" data-toggle="tooltip"></span>
  63. </td>
  64. <td>
  65. <div data-name="{{ check.name }}"
  66. data-tags="{{ check.tags }}"
  67. data-desc="{{ check.desc }}"
  68. class="my-checks-name {% if not check.name %}unnamed{% endif %}">
  69. <div>{{ check.name|default:"unnamed"|break_underscore }}</div>
  70. {% for tag in check.tags_list %}
  71. <span class="label label-tag">{{ tag }}</span>
  72. {% endfor %}
  73. </div>
  74. </td>
  75. <td class="url-cell hidden-xs hidden-sm">
  76. <span class="my-checks-url">
  77. <span class="base hidden-md">{{ ping_endpoint }}</span>{{ check.code }}
  78. </span>
  79. <button
  80. class="copy-link hidden-sm"
  81. data-clipboard-text="{{ check.url }}">
  82. copy
  83. </button>
  84. </td>
  85. <td class="integrations-cell hidden-xs">
  86. {% if channels|length <= 10 %}
  87. <div class="integrations">
  88. {% spaceless %}
  89. {% for channel in channels %}
  90. <span class="icon-{{ channel.kind }}{% if channel in check.channel_set.all %}{% else %} off{% endif %}"></span>
  91. {% endfor %}
  92. {% endspaceless %}
  93. </div>
  94. {% else %}
  95. {{ check.channel_set.all|length }} of {{ channels|length }}
  96. {% endif %}
  97. </td>
  98. <td class="timeout-cell hidden-xs">
  99. <div
  100. data-kind="{{ check.kind }}"
  101. data-timeout="{{ check.timeout.total_seconds }}"
  102. data-grace="{{ check.grace.total_seconds }}"
  103. data-schedule="{{ check.schedule }}"
  104. data-tz="{{ check.tz }}"
  105. class="timeout-grace">
  106. {% if check.kind == "simple" %}
  107. {{ check.timeout|hc_duration }}
  108. <br />
  109. {% elif check.kind == "cron" %}
  110. <div class="cron-expression">{{ check.schedule }}</div>
  111. {% endif %}
  112. <span class="checks-subline">
  113. {{ check.grace|hc_duration }}
  114. </span>
  115. </div>
  116. </td>
  117. <td>
  118. <div id="lpd-{{ check.code }}" class="last-ping">
  119. {% include "front/last_ping_cell.html" with check=check %}
  120. </div>
  121. </td>
  122. <td class="hidden-xs">
  123. <button class="btn btn-sm btn-default show-log" type="button">
  124. <span class="icon-settings" aria-hidden="true"></span>
  125. </button>
  126. </td>
  127. </tr>
  128. {% endfor %}
  129. </table>
  130. {% for channel in channels %}
  131. <div
  132. id="ch-{{ forloop.counter0}}"
  133. data-code="{{ channel.code }}"
  134. data-title="{{ channel }}">
  135. </div>
  136. {% endfor %}