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.

92 lines
3.0 KiB

9 years ago
9 years ago
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. {% if check.tags %}
  36. <tr>
  37. <th>Tags</th>
  38. <td>
  39. {% for tag in check.tags_list %}
  40. <span class="label label-tag">{{ tag }}</span>
  41. {% endfor %}
  42. </td>
  43. </tr>
  44. {% endif %}
  45. <tr>
  46. <th>Period</th>
  47. <td>{{ check.timeout|hc_duration }}</td>
  48. </tr>
  49. <tr>
  50. <th>Grace Time</th>
  51. <td>{{ check.grace|hc_duration }}</td>
  52. </tr>
  53. <tr>
  54. <th>Last Ping</th>
  55. <td>
  56. {% if check.last_ping %}
  57. {{ check.last_ping|naturaltime }}
  58. {% else %}
  59. Never
  60. {% endif %}
  61. </td>
  62. </tr>
  63. </table>
  64. <div>
  65. <a
  66. href="#"
  67. data-name="{{ check.name }}"
  68. data-tags="{{ check.tags }}"
  69. data-url="{% url 'hc-update-name' check.code %}"
  70. class="btn btn-default my-checks-name">
  71. Rename
  72. </a>
  73. <a
  74. href="#"
  75. data-url="{% url 'hc-update-timeout' check.code %}"
  76. data-timeout="{{ check.timeout.total_seconds }}"
  77. data-grace="{{ check.grace.total_seconds }}"
  78. class="btn btn-default timeout-grace">Change Period</a>
  79. <a href="{% url 'hc-log' check.code %}" class="btn btn-default">Log</a>
  80. </div>
  81. </li>
  82. {% endfor %}
  83. </ul>