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.

108 lines
3.5 KiB

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
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|sortchecks:sort %}
  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="icon-close"></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 == "paused" %}
  25. <span class="label label-default">PAUSED</span>
  26. {% elif check.in_grace_period %}
  27. <span class="label label-warning">LATE</span>
  28. {% elif check.get_status == "up" %}
  29. <span class="label label-success">UP</span>
  30. {% elif check.get_status == "down" %}
  31. <span class="label label-danger">DOWN</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. {% if check.kind == "simple " %}
  46. <tr>
  47. <th>Period</th>
  48. <td>{{ check.timeout|hc_duration }}</td>
  49. </tr>
  50. {% elif check.kind == "cron" %}
  51. <tr>
  52. <th>Schedule</th>
  53. <td>{{ check.schedule }}</td>
  54. </tr>
  55. {% endif %}
  56. <tr>
  57. <th>Grace Time</th>
  58. <td>{{ check.grace|hc_duration }}</td>
  59. </tr>
  60. <tr>
  61. <th>Last Ping</th>
  62. <td>
  63. {% if check.last_ping %}
  64. {{ check.last_ping|naturaltime }}
  65. {% else %}
  66. Never
  67. {% endif %}
  68. </td>
  69. </tr>
  70. </table>
  71. <div>
  72. <a
  73. href="#"
  74. data-name="{{ check.name }}"
  75. data-tags="{{ check.tags }}"
  76. data-url="{% url 'hc-update-name' check.code %}"
  77. class="btn btn-default my-checks-name">
  78. Rename
  79. </a>
  80. <a
  81. href="#"
  82. data-kind="{{ check.kind }}"
  83. data-url="{% url 'hc-update-timeout' check.code %}"
  84. data-timeout="{{ check.timeout.total_seconds }}"
  85. data-grace="{{ check.grace.total_seconds }}"
  86. data-schedule="{{ check.schedule }}"
  87. data-tz="{{ check.tz }}"
  88. class="btn btn-default timeout-grace">
  89. {% if check.kind == "simple" %}
  90. Change Period
  91. {% elif check.kind == "cron" %}
  92. Change Schedule
  93. {% endif %}
  94. </a>
  95. <a href="{% url 'hc-log' check.code %}" class="btn btn-default">Log</a>
  96. </div>
  97. </li>
  98. {% endfor %}
  99. </ul>