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.

125 lines
4.8 KiB

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