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.

142 lines
5.7 KiB

9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
8 years ago
8 years ago
8 years ago
8 years ago
9 years ago
8 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
9 years ago
9 years ago
9 years ago
  1. {% load hc_extras humanize %}
  2. <table id="checks-table" class="table hidden-xs">
  3. <tr>
  4. <th></th>
  5. <th class="th-name">
  6. {% if sort == "name" %}
  7. <a href="?sort=-name">Name<span class="icon-asc"></span></a>
  8. {% elif sort == "-name" %}
  9. <a href="?sort=created">Name<span class="icon-desc"></span></a>
  10. {% else %}
  11. <a href="?sort=name" class="default">Name</span></a>
  12. {% endif %}
  13. </th>
  14. <th>Ping URL</th>
  15. <th class="th-period">
  16. Period <br />
  17. <span class="checks-subline">Grace</span>
  18. </th>
  19. <th class="th-last-ping">
  20. {% if sort == "last_ping" %}
  21. <a href="?sort=created">Last Ping<span class="icon-desc"></span></a>
  22. {% elif sort == "-last_ping" %}
  23. <a href="?sort=last_ping">Last Ping<span class="icon-asc"></span></a>
  24. {% else %}
  25. <a href="?sort=-last_ping" class="default">Last Ping</span></a>
  26. {% endif %}
  27. </th>
  28. <th></th>
  29. </tr>
  30. {% for check in checks|sortchecks:sort %}
  31. <tr class="checks-row">
  32. <td class="indicator-cell">
  33. {% if check.get_status == "new" %}
  34. <span class="status icon-up new"
  35. data-toggle="tooltip" title="New. Has never received a ping."></span>
  36. {% elif check.get_status == "paused" %}
  37. <span class="status icon-paused"
  38. data-toggle="tooltip" title="Monitoring paused. Ping to resume."></span>
  39. {% elif check.in_grace_period %}
  40. <span class="status icon-grace"></span>
  41. {% elif check.get_status == "up" %}
  42. <span class="status icon-up"></span>
  43. {% elif check.get_status == "down" %}
  44. <span class="status icon-down"></span>
  45. {% endif %}
  46. </td>
  47. <td class="name-cell">
  48. <div data-name="{{ check.name }}"
  49. data-tags="{{ check.tags }}"
  50. data-url="{% url 'hc-update-name' check.code %}"
  51. class="my-checks-name {% if not check.name %}unnamed{% endif %}">
  52. <div>{{ check.name|default:"unnamed" }}</div>
  53. {% for tag in check.tags_list %}
  54. <span class="label label-tag">{{ tag }}</span>
  55. {% endfor %}
  56. </div>
  57. </td>
  58. <td class="url-cell">
  59. <span class="my-checks-url">
  60. <span class="base">{{ ping_endpoint }}</span>{{ check.code }}
  61. </span>
  62. <button
  63. class="copy-link hidden-sm"
  64. data-clipboard-text="{{ check.url }}">
  65. copy
  66. </button>
  67. </td>
  68. <td class="timeout-cell">
  69. <span
  70. data-url="{% url 'hc-update-timeout' check.code %}"
  71. data-kind="{{ check.kind }}"
  72. data-timeout="{{ check.timeout.total_seconds }}"
  73. data-grace="{{ check.grace.total_seconds }}"
  74. data-schedule="{{ check.schedule }}"
  75. data-tz="{{ check.tz }}"
  76. class="timeout-grace">
  77. {% if check.kind == "simple" %}
  78. {{ check.timeout|hc_duration }}
  79. {% elif check.kind == "cron" %}
  80. <span class="cron-expression">{{ check.schedule }}</span>
  81. {% endif %}
  82. <br />
  83. <span class="checks-subline">
  84. {{ check.grace|hc_duration }}
  85. </span>
  86. </span>
  87. </td>
  88. <td>
  89. {% if check.last_ping %}
  90. <div class="last-ping" data-url="{% url 'hc-last-ping' check.code %}">
  91. {{ check.last_ping|naturaltime }}
  92. {% if check.has_confirmation_link %}
  93. <br /><span class="label label-confirmation">confirmation link</span>
  94. {% endif %}
  95. </div>
  96. {% else %}
  97. <div class="last-ping-never">Never</div>
  98. {% endif %}
  99. </td>
  100. <td>
  101. <div class="check-menu dropdown">
  102. <button class="btn btn-sm btn-default dropdown-toggle" type="button" data-toggle="dropdown">
  103. <span class="icon-settings" aria-hidden="true"></span>
  104. </button>
  105. <ul class="dropdown-menu">
  106. <li {% if check.status == "new" or check.status == "paused" %}class="disabled"{% endif %}>
  107. <a class="pause-check"
  108. href="#"
  109. data-url="{% url 'hc-pause' check.code %}">
  110. Pause Monitoring
  111. </a>
  112. </li>
  113. <li role="separator" class="divider"></li>
  114. <li>
  115. <a href="{% url 'hc-log' check.code %}">
  116. Log
  117. </a>
  118. </li>
  119. <li>
  120. <a
  121. href="#"
  122. class="usage-examples"
  123. data-url="{{ check.url }}"
  124. data-email="{{ check.email }}">
  125. Usage Examples
  126. </a>
  127. </li>
  128. <li role="separator" class="divider"></li>
  129. <li>
  130. <a href="#" class="check-menu-remove"
  131. data-name="{{ check.name_then_code }}"
  132. data-url="{% url 'hc-remove-check' check.code %}">
  133. Remove
  134. </a>
  135. </li>
  136. </ul>
  137. </div>
  138. </td>
  139. </tr>
  140. {% endfor %}
  141. </table>