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.

81 lines
2.6 KiB

9 years ago
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. {% elif check.get_status == "paused" %}
  31. <span class="label label-default">PAUSED</span>
  32. {% endif %}
  33. </td>
  34. </tr>
  35. <tr>
  36. <th>Period</th>
  37. <td>{{ check.timeout|hc_duration }}</td>
  38. </tr>
  39. <tr>
  40. <th>Grace Time</th>
  41. <td>{{ check.grace|hc_duration }}</td>
  42. </tr>
  43. <tr>
  44. <th>Last Ping</th>
  45. <td>
  46. {% if check.last_ping %}
  47. {{ check.last_ping|naturaltime }}
  48. {% else %}
  49. Never
  50. {% endif %}
  51. </td>
  52. </tr>
  53. </table>
  54. <div>
  55. <a
  56. href="#"
  57. data-name="{{ check.name }}"
  58. data-url="{% url 'hc-update-name' check.code %}"
  59. class="btn btn-default my-checks-name">
  60. Rename
  61. </a>
  62. <a
  63. href="#"
  64. data-url="{% url 'hc-update-timeout' check.code %}"
  65. data-timeout="{{ check.timeout.total_seconds }}"
  66. data-grace="{{ check.grace.total_seconds }}"
  67. class="btn btn-default timeout-grace">Change Period</a>
  68. <a href="{% url 'hc-log' check.code %}" class="btn btn-default">Log</a>
  69. </div>
  70. </li>
  71. {% endfor %}
  72. </ul>