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.

123 lines
4.3 KiB

10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
  1. {% extends "base.html" %}
  2. {% load humanize staticfiles %}
  3. {% block content %}
  4. <div class="row">
  5. <div class="col-sm-12">
  6. <h1>My Checks</h1>
  7. {% if checks %}
  8. <table id="checks-table" class="table table-hover">
  9. <tr>
  10. <th></th>
  11. <th class="th-name">Name</th>
  12. <th>URL</th>
  13. <th>Frequency</th>
  14. <th>Last Ping</th>
  15. </tr>
  16. {% for check in checks %}
  17. <tr class="checks-row">
  18. <td class="indicator-cell">
  19. {% if check.status == "new" %}
  20. <span class="glyphicon glyphicon-question-sign new"></span>
  21. {% elif now < check.alert_after %}
  22. <span class="glyphicon glyphicon-ok-sign up"></span>
  23. {% else %}
  24. <span class="glyphicon glyphicon-exclamation-sign down"></span>
  25. {% endif %}
  26. </td>
  27. <td class="name-cell">
  28. <form
  29. method="post"
  30. action="{% url 'hc-update-name' check.code %}"
  31. class="name-edit form-inline inactive">
  32. {% csrf_token %}
  33. <input
  34. name="name"
  35. type="text"
  36. value="{{ check.name }}"
  37. placeholder="unnamed"
  38. class="input-name form-control" />
  39. <button class="btn btn-primary" type="submit">
  40. <span class="glyphicon glyphicon-ok"></span>
  41. </button>
  42. <button class="btn btn-default name-edit-cancel">
  43. <span class="glyphicon glyphicon-remove"></span>
  44. </button>
  45. </form>
  46. </td>
  47. <td class="url-cell">
  48. <code>http://healthchecks.io{% url 'hc-ping' check.code %}</code>
  49. </td>
  50. <td class="timeout-cell inactive">
  51. <div class="timeout-dialog popover bottom">
  52. <div class="arrow"></div>
  53. <div class="popover-content">
  54. <form
  55. method="post"
  56. action="{% url 'hc-update-timeout' check.code %}"
  57. class="form-inline">
  58. {% csrf_token %}
  59. <select class="form-control" name="timeout">
  60. {% for label, value in timeout_choices %}
  61. {% if check.timeout == value %}
  62. <option selected>{{ label }}</option>
  63. {% else %}
  64. <option>{{ label }}</option>
  65. {% endif %}
  66. {% endfor %}
  67. </select>
  68. <button class="btn btn-primary" type="submit">
  69. <span class="glyphicon glyphicon-ok"></span>
  70. </button>
  71. <button class="btn btn-default timeout-edit-cancel">
  72. <span class="glyphicon glyphicon-remove"></span>
  73. </button>
  74. </form>
  75. </div>
  76. </div>
  77. <span class="timeout">
  78. {% for label, value in timeout_choices %}
  79. {% if check.timeout == value %}
  80. {{ label }}
  81. {% endif %}
  82. {% endfor %}
  83. </span>
  84. </td>
  85. <td>
  86. {% if check.last_ping %}
  87. <span
  88. data-toggle="tooltip"
  89. title="{{ check.last_ping }}">
  90. {{ check.last_ping|naturaltime }}
  91. </span>
  92. {% else %}
  93. Never
  94. {% endif %}
  95. </td>
  96. </tr>
  97. {% endfor %}
  98. </table>
  99. {% else %}
  100. <div class="alert alert-info">You don't have any checks yet.</div>
  101. {% endif %}
  102. </div>
  103. </div>
  104. <div class="row">
  105. <div class="col-sm-4 center-block"></div>
  106. <form method="post" action="{% url 'hc-add-check' %}">
  107. {% csrf_token %}
  108. <input type="submit" class="btn btn-primary btn-lg" value="Add Check">
  109. </form>
  110. </div>
  111. </div>
  112. {% endblock %}
  113. {% block scripts %}
  114. <script src="{% static 'js/checks.js' %}"></script>
  115. {% endblock %}