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.

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