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.

135 lines
4.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
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. </th>
  48. <th class="hidden-xs"></th>
  49. </tr>
  50. {% for check in checks %}
  51. <tr
  52. id="{{ check.code }}"
  53. class="checks-row"
  54. data-url="{{ check.url }}"
  55. data-email="{{ check.email }}"
  56. {% if check in hidden_checks %}style="display: none"{% endif %}>
  57. <td class="indicator-cell">
  58. <span class="status icon-{{ check.get_status }}" data-toggle="tooltip"></span>
  59. </td>
  60. <td>
  61. <div data-name="{{ check.name }}"
  62. data-tags="{{ check.tags }}"
  63. data-desc="{{ check.desc }}"
  64. class="my-checks-name {% if not check.name %}unnamed{% endif %}">
  65. <div>{{ check.name|default:"unnamed"|break_underscore }}</div>
  66. {% for tag in check.tags_list %}
  67. <span class="label label-tag">{{ tag }}</span>
  68. {% endfor %}
  69. </div>
  70. </td>
  71. <td class="url-cell hidden-xs hidden-sm">
  72. <span class="my-checks-url">
  73. <span class="base hidden-md">{{ ping_endpoint }}</span>{{ check.code }}
  74. </span>
  75. <button
  76. class="copy-link hidden-sm"
  77. data-clipboard-text="{{ check.url }}">
  78. copy
  79. </button>
  80. </td>
  81. <td class="integrations-cell hidden-xs">
  82. {% if channels|length <= 10 %}
  83. <div class="integrations">
  84. {% spaceless %}
  85. {% for channel in channels %}
  86. <span class="icon-{{ channel.kind }}{% if channel in check.channel_set.all %}{% else %} off{% endif %}"></span>
  87. {% endfor %}
  88. {% endspaceless %}
  89. </div>
  90. {% else %}
  91. {{ check.channel_set.all|length }} of {{ channels|length }}
  92. {% endif %}
  93. </td>
  94. <td class="timeout-cell hidden-xs">
  95. <div
  96. data-kind="{{ check.kind }}"
  97. data-timeout="{{ check.timeout.total_seconds }}"
  98. data-grace="{{ check.grace.total_seconds }}"
  99. data-schedule="{{ check.schedule }}"
  100. data-tz="{{ check.tz }}"
  101. class="timeout-grace">
  102. {% if check.kind == "simple" %}
  103. {{ check.timeout|hc_duration }}
  104. {% elif check.kind == "cron" %}
  105. <span class="cron-expression">{{ check.schedule }}</span>
  106. {% endif %}
  107. <br />
  108. <span class="checks-subline">
  109. {{ check.grace|hc_duration }}
  110. </span>
  111. </div>
  112. </td>
  113. <td>
  114. <div id="lpd-{{ check.code}}" class="last-ping">
  115. {% include "front/last_ping_cell.html" with check=check %}
  116. </div>
  117. </td>
  118. <td class="hidden-xs">
  119. <button class="btn btn-sm btn-default show-log" type="button">
  120. <span class="icon-settings" aria-hidden="true"></span>
  121. </button>
  122. </td>
  123. </tr>
  124. {% endfor %}
  125. </table>
  126. {% for channel in channels %}
  127. <div
  128. id="ch-{{ forloop.counter0}}"
  129. data-code="{{ channel.code }}"
  130. data-title="{{ channel }}">
  131. </div>
  132. {% endfor %}