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.

138 lines
4.7 KiB

9 years ago
8 years ago
9 years ago
  1. {% extends "base.html" %}
  2. {% load compress humanize staticfiles hc_extras %}
  3. {% block title %}My Checks - {% 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' %}">Checks</a></li>
  9. <li>{{ check.name_then_code }}</li>
  10. <li class="active">Log</li>
  11. <li id="format-switcher-container" class="pull-right">
  12. <div id="format-switcher" class="btn-group" data-toggle="buttons">
  13. <label class="btn btn-default btn-xs" data-format="utc">
  14. <input type="radio" name="date-format" checked>
  15. UTC
  16. </label>
  17. <label class="btn btn-default btn-xs active" data-format="local">
  18. <input type="radio" name="date-format">
  19. Local Time
  20. </label>
  21. </div>
  22. </li>
  23. </ol>
  24. {% if events %}
  25. <div class="table-responsive">
  26. <table class="table" id="log">
  27. <tr>
  28. <th></th>
  29. <th class="datetime">
  30. <span class="date">Date</span>
  31. <span class="time">Time</span>
  32. </th>
  33. <th class="ip">IP</th>
  34. <th class="protocol">Protocol</th>
  35. <th class="ua">User Agent</th>
  36. </tr>
  37. {% for event in events %}
  38. {% if event.n %}
  39. <tr class="ok {% if record.early %} early {% endif %}">
  40. <td class="n-cell">
  41. <span class="hash">#</span>{{ event.n }}
  42. </td>
  43. <td class="datetime" data-raw="{{ event.created.isoformat }}">
  44. <div>
  45. <span class="date"></span>
  46. <span class="time"></span>
  47. {% if 0 %}
  48. <span class="label label-tag">early</span>
  49. {% endif %}
  50. </div>
  51. </td>
  52. <td class="ip">
  53. {{ event.remote_addr|default:"" }}
  54. </td>
  55. <td class="protocol">
  56. {{ event.scheme }}
  57. </td>
  58. <td class="ua">
  59. {{ event.ua }}
  60. </td>
  61. </tr>
  62. {% endif %}
  63. {% if event.check_status %}
  64. <tr class="missing">
  65. <td class="n-cell">
  66. <span class="icon-missing"></span>
  67. </td>
  68. <td class="datetime" data-raw="{{ event.created.isoformat }}">
  69. <div>
  70. <span class="date"></span>
  71. <span class="time"></span>
  72. </div>
  73. </td>
  74. <td colspan="3" class="alert-info">
  75. {% if event.channel.kind == "email" %}
  76. Sent email alert to {{ event.channel.value }}
  77. {% elif event.channel.kind == "slack" %}
  78. Sent Slack alert
  79. {% if event.channel.slack_channel %}
  80. to {{ event.channel.slack_channel }}
  81. {% endif %}
  82. {% elif event.channel.kind == "pd" %}
  83. Sent alert to PagerDuty
  84. {% elif event.channel.kind == "opsgenie" %}
  85. Sent alert to OpsGenie
  86. {% elif event.channel.kind == "hipchat" %}
  87. Sent alert to HipChat
  88. {% elif event.channel.kind == "po" %}
  89. Sent a Pushover notification
  90. {% elif event.channel.kind == "webhook" %}
  91. Called webhook {{ event.channel.url_down }}
  92. {% else %}
  93. Sent alert to {{ event.channel.kind|capfirst }}
  94. {% endif %}
  95. {% if event.error %}
  96. <br />
  97. <strong>Error: {{ event.error }}</strong>
  98. {% endif %}
  99. </td>
  100. </tr>
  101. {% endif %}
  102. {% endfor %}
  103. </table>
  104. {% if show_limit_notice and limit < 10000 %}
  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. {% endblock %}
  120. {% block scripts %}
  121. {% compress js %}
  122. <script src="{% static 'js/jquery-2.1.4.min.js' %}"></script>
  123. <script src="{% static 'js/bootstrap.min.js' %}"></script>
  124. <script src="{% static 'js/moment.min.js' %}"></script>
  125. <script src="{% static 'js/log.js' %}"></script>
  126. {% endcompress %}
  127. {% endblock %}