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.

114 lines
4.2 KiB

9 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. <table id="checks-table" class="table hidden-xs">
  3. <tr>
  4. <th></th>
  5. <th class="th-name">Name</th>
  6. <th>
  7. <a id="show-urls" class="active" href="#">URL</a>
  8. <a id="show-emails" href="#">Email</a>
  9. </th>
  10. <th class="th-period">
  11. Period <br />
  12. <span class="checks-subline">Grace</span>
  13. </th>
  14. <th>Last Ping</th>
  15. <th></th>
  16. </tr>
  17. {% for check in checks %}
  18. <tr class="checks-row">
  19. <td class="indicator-cell">
  20. {% if check.get_status == "new" %}
  21. <span class="glyphicon glyphicon-question-sign new"></span>
  22. {% elif check.get_status == "up" %}
  23. <span class="glyphicon glyphicon-ok-sign up"></span>
  24. {% elif check.get_status == "grace" %}
  25. <span class="glyphicon glyphicon-exclamation-sign grace"></span>
  26. {% elif check.get_status == "down" %}
  27. <span class="glyphicon glyphicon-exclamation-sign down"></span>
  28. {% elif check.get_status == "paused" %}
  29. <span class="glyphicon glyphicon-minus-sign paused"></span>
  30. {% endif %}
  31. </td>
  32. <td class="name-cell">
  33. <div data-name="{{ check.name }}"
  34. data-tags="{{ check.tags }}"
  35. data-url="{% url 'hc-update-name' check.code %}"
  36. class="my-checks-name {% if not check.name %}unnamed{% endif %}">
  37. <div>{{ check.name|default:"unnamed" }}</div>
  38. {% for tag in check.tags_list %}
  39. <span class="label label-tag">{{ tag }}</span>
  40. {% endfor %}
  41. </div>
  42. </td>
  43. <td class="url-cell">
  44. <div class="placeholder">{{ check.url }}</div>
  45. <div class="my-checks-url">
  46. <input
  47. data-toggle="tooltip"
  48. title="Click to select"
  49. class="selectable"
  50. type="text"
  51. value="{{ check.url }}"
  52. readonly />
  53. </div>
  54. <div class="my-checks-email off">
  55. <input
  56. class="selectable"
  57. type="text"
  58. value="{{ check.email }}"
  59. readonly />
  60. </div>
  61. </td>
  62. <td class="timeout-cell">
  63. <span
  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="timeout-grace">
  68. {{ check.timeout|hc_duration }}
  69. <br />
  70. <span class="checks-subline">
  71. {{ check.grace|hc_duration }}
  72. </span>
  73. </span>
  74. </td>
  75. <td>
  76. {% if check.last_ping %}
  77. <span
  78. data-toggle="tooltip"
  79. title="{{ check.last_ping|date:'N j, Y, P e' }}">
  80. {{ check.last_ping|naturaltime }}
  81. </span>
  82. {% else %}
  83. Never
  84. {% endif %}
  85. </td>
  86. <td>
  87. <div class="check-menu dropdown">
  88. <button class="btn btn-sm btn-default dropdown-toggle" type="button" data-toggle="dropdown">
  89. <span class="glyphicon glyphicon-cog" aria-hidden="true"></span>
  90. </button>
  91. <ul class="dropdown-menu">
  92. <li>
  93. <a href="{% url 'hc-log' check.code %}">
  94. <span class="glyphicon glyphicon-time"></span>
  95. Log
  96. </a>
  97. </li>
  98. <li role="separator" class="divider"></li>
  99. <li>
  100. <a href="#" class="check-menu-remove"
  101. data-name="{{ check.name_then_code }}"
  102. data-url="{% url 'hc-remove-check' check.code %}">
  103. <span class="glyphicon glyphicon-trash"></span>
  104. Remove
  105. </a>
  106. </li>
  107. </ul>
  108. </div>
  109. </td>
  110. </tr>
  111. {% endfor %}
  112. </table>