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.

153 lines
5.3 KiB

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.exitstatus %}
  47. <span class="label label-danger">Status {{ event.exitstatus }}</span>
  48. {% elif event.kind == "fail" %}
  49. <span class="label label-danger">Failure</span>
  50. {% elif event.kind == "start" %}
  51. <span class="label label-start">Started</span>
  52. {% elif event.kind == "ign" %}
  53. <span class="label label-ign">Ignored</span>
  54. {% else %}
  55. <span class="label label-success">OK</span>
  56. {% endif %}
  57. </td>
  58. <td class="details">
  59. {% if event.delta %}
  60. <div class="delta">
  61. <span class="ic-timer"></span>
  62. {{ event.delta|hms }}
  63. </div>
  64. {% endif %}
  65. {% if event.scheme == "email" %}
  66. {{ event.ua }}
  67. <span class="ua-body">
  68. {% if event.body %}
  69. - {{ event.body|truncatechars:150 }}
  70. {% endif %}
  71. </span>
  72. {% else %}
  73. {{ event.scheme|upper }}
  74. {{ event.method }}
  75. {% if event.remote_addr %}
  76. from {{ event.remote_addr }}
  77. {% endif %}
  78. <span class="ua-body">
  79. {% if event.ua %}
  80. - {{ event.ua }}
  81. {% endif %}
  82. {% if event.body %}
  83. - {{ event.body|truncatechars:150 }}
  84. {% endif %}
  85. </span>
  86. {% endif %}
  87. </td>
  88. </tr>
  89. {% endif %}
  90. {% if event.check_status %}
  91. <tr class="missing" data-dt="{{ event.created.isoformat }}">
  92. <td class="n-cell">
  93. <span class="ic-missing"></span>
  94. </td>
  95. <td class="date"></td>
  96. <td class="time"></td>
  97. <td class="alert-info" colspan="2">
  98. {% include "front/event_summary.html" %}
  99. </td>
  100. </tr>
  101. {% endif %}
  102. {% endfor %}
  103. </table>
  104. {% if show_limit_notice and limit < 1000 %}
  105. <p class="alert alert-info">
  106. <strong>Showing last {{ limit }} pings.</strong>
  107. Want to see more?
  108. <a href="{% url 'hc-pricing' %}">
  109. Upgrade your account!
  110. </a>
  111. </p>
  112. {% endif %}
  113. </div>
  114. {% else %}
  115. <div class="alert alert-info">Log is empty. This check has not received any pings yet.</div>
  116. {% endif %}
  117. </div>
  118. </div>
  119. <div id="ping-details-modal" class="modal">
  120. <div class="modal-dialog">
  121. <div class="modal-content">
  122. <div id="ping-details-body">Loading</div>
  123. <div class="modal-footer">
  124. <button type="button" class="btn btn-default" data-dismiss="modal">Got It!</button>
  125. </div>
  126. </div>
  127. </div>
  128. </div>
  129. {% endblock %}
  130. {% block scripts %}
  131. {% compress js %}
  132. <script src="{% static 'js/jquery-2.1.4.min.js' %}"></script>
  133. <script src="{% static 'js/bootstrap.min.js' %}"></script>
  134. <script src="{% static 'js/moment.min.js' %}"></script>
  135. <script src="{% static 'js/moment-timezone-with-data-10-year-range.min.js' %}"></script>
  136. <script src="{% static 'js/log.js' %}"></script>
  137. {% endcompress %}
  138. {% endblock %}