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.

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