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.

140 lines
4.8 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 == "pagertree" %}
  85. Sent alert to PagerTree
  86. {% elif event.channel.kind == "opsgenie" %}
  87. Sent alert to OpsGenie
  88. {% elif event.channel.kind == "hipchat" %}
  89. Sent alert to HipChat
  90. {% elif event.channel.kind == "po" %}
  91. Sent a Pushover notification
  92. {% elif event.channel.kind == "webhook" %}
  93. Called webhook {{ event.channel.url_down }}
  94. {% else %}
  95. Sent alert to {{ event.channel.kind|capfirst }}
  96. {% endif %}
  97. {% if event.error %}
  98. <br />
  99. <strong>Error: {{ event.error }}</strong>
  100. {% endif %}
  101. </td>
  102. </tr>
  103. {% endif %}
  104. {% endfor %}
  105. </table>
  106. {% if show_limit_notice and limit < 10000 %}
  107. <p class="alert alert-info">
  108. <strong>Showing last {{ limit }} pings.</strong>
  109. Want to see more?
  110. <a href="{% url 'hc-pricing' %}">
  111. Upgrade your account!
  112. </a>
  113. </p>
  114. {% endif %}
  115. </div>
  116. {% else %}
  117. <div class="alert alert-info">Log is empty. This check has not received any pings yet.</div>
  118. {% endif %}
  119. </div>
  120. </div>
  121. {% endblock %}
  122. {% block scripts %}
  123. {% compress js %}
  124. <script src="{% static 'js/jquery-2.1.4.min.js' %}"></script>
  125. <script src="{% static 'js/bootstrap.min.js' %}"></script>
  126. <script src="{% static 'js/moment.min.js' %}"></script>
  127. <script src="{% static 'js/log.js' %}"></script>
  128. {% endcompress %}
  129. {% endblock %}