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.

99 lines
2.3 KiB

  1. {% load humanize hc_extras %}
  2. <style>
  3. .checks {
  4. margin: 30px 0;
  5. width: 100%;
  6. font-size: 16px;
  7. }
  8. .checks th {
  9. text-align: left;
  10. padding: 8px;
  11. font-size: 12px;
  12. color: #9BA2AB;
  13. }
  14. .checks td {
  15. border-top: 1px solid #EDEFF2;
  16. padding: 16px 8px;
  17. }
  18. .badge {
  19. font-size: 10px;
  20. color: white;
  21. padding: 4px;
  22. font-family: sans;
  23. }
  24. .new { background: #AAA; }
  25. .up { background: #5cb85c; }
  26. .grace { background: #f0ad4e; }
  27. .down { background: #d9534f; }
  28. .unnamed {
  29. color: #74787E;
  30. font-style: italic;
  31. }
  32. .tag {
  33. font-size: 12px;
  34. background-color: #eee;
  35. padding: 2px 4px;
  36. color: #555;
  37. }
  38. </style>
  39. <table class="checks" cellpadding="0" cellspacing="0">
  40. <tr>
  41. <th></th>
  42. <th>Name</th>
  43. <th>Last Ping</th>
  44. </tr>
  45. {% for check in checks %}
  46. <tr>
  47. <td>
  48. {% if check.get_status == "new" %}
  49. <span class="badge new">NEW</span>
  50. {% elif check.get_status == "paused" %}
  51. <span class="badge new">PAUSED</span>
  52. {% elif check.in_grace_period %}
  53. <span class="badge grace">LATE</span>
  54. {% elif check.get_status == "up" %}
  55. <span class="badge up">UP</span>
  56. {% elif check.get_status == "down" %}
  57. <span class="badge down">DOWN</span>
  58. {% endif %}
  59. </td>
  60. <td>
  61. {% if check.name %}
  62. {% if check.name|length > 20 %}
  63. <small>{{ check.name }}</small>
  64. {% else %}
  65. {{ check.name }}
  66. {% endif %}
  67. {% else %}
  68. <span class="unnamed">unnamed</span>
  69. {% endif %}
  70. {% if check.tags %}
  71. <br />
  72. {% for tag in check.tags_list %}
  73. <span class="tag">{{ tag }}</span>
  74. {% endfor %}
  75. {% endif %}
  76. </td>
  77. <td>
  78. {% if check.last_ping %}
  79. {{ check.last_ping|naturaltime }}
  80. {% else %}
  81. Never
  82. {% endif %}
  83. </td>
  84. <td>
  85. <a class="view-log" href="{{ check.log_url }}">Log</a>
  86. </td>
  87. </tr>
  88. {% endfor %}
  89. </table>