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.

151 lines
5.2 KiB

8 years ago
9 years ago
  1. {% extends "base.html" %}
  2. {% load compress humanize static hc_extras %}
  3. {% block title %}Ping Log - {{ site_name }}{% endblock %}
  4. {% block content %}
  5. <div class="row">
  6. <div class="col-sm-12">
  7. <ol class="breadcrumb">
  8. <li><a href="{% url 'hc-checks' check.project.code %}">{{ check.project }}</a></li>
  9. <li>
  10. <a href="{% url 'hc-details' check.code %}">
  11. {{ check.name_then_code }}
  12. </a>
  13. </li>
  14. <li class="active">Log</li>
  15. <li id="format-switcher-container" class="pull-right hidden-xs">
  16. <div id="format-switcher" class="btn-group" data-toggle="buttons">
  17. <label class="btn btn-default btn-xs" data-format="UTC">
  18. <input type="radio" name="date-format" checked>
  19. UTC
  20. </label>
  21. {% if check.kind == "cron" and check.tz != "UTC" %}
  22. <label class="btn btn-default btn-xs" data-format="{{ check.tz }}">
  23. <input type="radio" name="date-format">
  24. {{ check.tz }}
  25. </label>
  26. {% endif %}
  27. <label class="btn btn-default btn-xs active" data-format="local">
  28. <input type="radio" name="date-format">
  29. Browser's time zone
  30. </label>
  31. </div>
  32. </li>
  33. </ol>
  34. {% if events %}
  35. <div class="table-responsive">
  36. <table class="table" id="log">
  37. {% for event in events %}
  38. {% if event.n %}
  39. <tr class="ok" data-dt="{{ event.created.isoformat }}" data-url="{% url 'hc-ping-details' check.code event.n %}">
  40. <td class="n-cell">
  41. <span class="hash">#</span>{{ event.n }}
  42. </td>
  43. <td class="date"></td>
  44. <td class="time"></td>
  45. <td class="event">
  46. {% if event.kind == "fail" %}
  47. <span class="label label-danger">Failure</span>
  48. {% elif event.kind == "start" %}
  49. <span class="label label-start">Started</span>
  50. {% elif event.kind == "ign" %}
  51. <span class="label label-ign">Ignored</span>
  52. {% else %}
  53. <span class="label label-success">OK</span>
  54. {% endif %}
  55. </td>
  56. <td class="details">
  57. {% if event.delta %}
  58. <div class="delta">
  59. <span class="icon-timer"></span>
  60. {{ event.delta|hms }}
  61. </div>
  62. {% endif %}
  63. {% if event.scheme == "email" %}
  64. {{ event.ua }}
  65. <span class="ua-body">
  66. {% if event.body %}
  67. - {{ event.body|truncatechars:150 }}
  68. {% endif %}
  69. </span>
  70. {% else %}
  71. {{ event.scheme|upper }}
  72. {{ event.method }}
  73. {% if event.remote_addr %}
  74. from {{ event.remote_addr }}
  75. {% endif %}
  76. <span class="ua-body">
  77. {% if event.ua %}
  78. - {{ event.ua }}
  79. {% endif %}
  80. {% if event.body %}
  81. - {{ event.body|truncatechars:150 }}
  82. {% endif %}
  83. </span>
  84. {% endif %}
  85. </td>
  86. </tr>
  87. {% endif %}
  88. {% if event.check_status %}
  89. <tr class="missing" data-dt="{{ event.created.isoformat }}">
  90. <td class="n-cell">
  91. <span class="icon-missing"></span>
  92. </td>
  93. <td class="date"></td>
  94. <td class="time"></td>
  95. <td class="alert-info" colspan="2">
  96. {% include "front/event_summary.html" %}
  97. </td>
  98. </tr>
  99. {% endif %}
  100. {% endfor %}
  101. </table>
  102. {% if show_limit_notice and limit < 1000 %}
  103. <p class="alert alert-info">
  104. <strong>Showing last {{ limit }} pings.</strong>
  105. Want to see more?
  106. <a href="{% url 'hc-pricing' %}">
  107. Upgrade your account!
  108. </a>
  109. </p>
  110. {% endif %}
  111. </div>
  112. {% else %}
  113. <div class="alert alert-info">Log is empty. This check has not received any pings yet.</div>
  114. {% endif %}
  115. </div>
  116. </div>
  117. <div id="ping-details-modal" class="modal">
  118. <div class="modal-dialog">
  119. <div class="modal-content">
  120. <div id="ping-details-body">Loading</div>
  121. <div class="modal-footer">
  122. <button type="button" class="btn btn-default" data-dismiss="modal">Got It!</button>
  123. </div>
  124. </div>
  125. </div>
  126. </div>
  127. {% endblock %}
  128. {% block scripts %}
  129. {% compress js %}
  130. <script src="{% static 'js/jquery-2.1.4.min.js' %}"></script>
  131. <script src="{% static 'js/bootstrap.min.js' %}"></script>
  132. <script src="{% static 'js/moment.min.js' %}"></script>
  133. <script src="{% static 'js/moment-timezone-with-data-10-year-range.min.js' %}"></script>
  134. <script src="{% static 'js/log.js' %}"></script>
  135. {% endcompress %}
  136. {% endblock %}