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.

79 lines
2.5 KiB

9 years ago
9 years ago
9 years ago
  1. {% load hc_extras humanize %}
  2. <ul id="checks-list" class="visible-xs">
  3. {% for check in checks %}
  4. <li>
  5. <h2>
  6. <span class="{% if not check.name %}unnamed{% endif %}">
  7. {{ check.name|default:"unnamed" }}
  8. </span>
  9. <code>{{ check.code }}</code>
  10. </h2>
  11. <a
  12. href="#"
  13. class="btn remove-link check-menu-remove"
  14. data-name="{{ check.name_then_code }}"
  15. data-url="{% url 'hc-remove-check' check.code %}">
  16. <span class="glyphicon glyphicon-remove"></span>
  17. </a>
  18. <table class="table">
  19. <tr>
  20. <th>Status</th>
  21. <td>
  22. {% if check.get_status == "new" %}
  23. <span class="label label-default">NEW</span>
  24. {% elif check.get_status == "up" %}
  25. <span class="label label-success">UP</span>
  26. {% elif check.get_status == "grace" %}
  27. <span class="label label-warning">LATE</span>
  28. {% elif check.get_status == "down" %}
  29. <span class="label label-danger">DOWN</span>
  30. {% endif %}
  31. </td>
  32. </tr>
  33. <tr>
  34. <th>Period</th>
  35. <td>{{ check.timeout|hc_duration }}</td>
  36. </tr>
  37. <tr>
  38. <th>Grace Time</th>
  39. <td>{{ check.grace|hc_duration }}</td>
  40. </tr>
  41. <tr>
  42. <th>Last Ping</th>
  43. <td>
  44. {% if check.last_ping %}
  45. {{ check.last_ping|naturaltime }}
  46. {% else %}
  47. Never
  48. {% endif %}
  49. </td>
  50. </tr>
  51. </table>
  52. <div>
  53. <a
  54. href="#"
  55. data-name="{{ check.name }}"
  56. data-url="{% url 'hc-update-name' check.code %}"
  57. class="btn btn-default my-checks-name">
  58. Rename
  59. </a>
  60. <a
  61. href="#"
  62. data-url="{% url 'hc-update-timeout' check.code %}"
  63. data-timeout="{{ check.timeout.total_seconds }}"
  64. data-grace="{{ check.grace.total_seconds }}"
  65. class="btn btn-default timeout-grace">Change Period</a>
  66. <a href="{% url 'hc-log' check.code %}" class="btn btn-default">Log</a>
  67. </div>
  68. </li>
  69. {% endfor %}
  70. </ul>