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.

98 lines
3.5 KiB

6 years ago
6 years ago
  1. {% load hc_extras %}
  2. {% if events %}
  3. <table class="table" id="log">
  4. {% for event in events %}
  5. {% if event.n %}
  6. <tr class="ok" data-dt="{{ event.created.isoformat }}" data-url="{% url 'hc-ping-details' check.code event.n %}">
  7. <td class="n-cell">
  8. <span class="hash">#</span>{{ event.n }}
  9. </td>
  10. <td class="date"></td>
  11. <td class="time"></td>
  12. <td class="text-right">
  13. {% if event.kind == "fail" %}
  14. <span class="label label-danger">Failure</span>
  15. {% elif event.kind == "start" %}
  16. <span class="label label-start">Started</span>
  17. {% elif event.kind == "ign" %}
  18. <span class="label label-ign">Ignored</span>
  19. {% else %}
  20. <span class="label label-success">OK</span>
  21. {% endif %}
  22. </td>
  23. <td class="details">
  24. {% if event.delta %}
  25. <div class="delta">
  26. <span class="icon-timer"></span>
  27. {{ event.delta|hms }}
  28. </div>
  29. {% endif %}
  30. {% if event.scheme == "email" %}
  31. {{ event.ua }}
  32. {% else %}
  33. {{ event.scheme|upper }}
  34. {{ event.method }}
  35. {% if event.remote_addr %}
  36. from {{ event.remote_addr }}
  37. {% endif %}
  38. <span class="ua-body">
  39. {% if event.ua %}
  40. - {{ event.ua|truncatechars:80 }}
  41. {% endif %}
  42. </span>
  43. {% endif %}
  44. </td>
  45. </tr>
  46. {% endif %}
  47. {% if event.check_status %}
  48. <tr class="missing" data-dt="{{ event.created.isoformat }}">
  49. <td class="n-cell">
  50. <span class="icon-missing"></span>
  51. </td>
  52. <td class="date"></td>
  53. <td class="time"></td>
  54. <td class="alert-info" colspan="2">
  55. {% if event.channel.kind == "email" %}
  56. Sent email alert to {{ event.channel.email_value }}
  57. {% elif event.channel.kind == "slack" %}
  58. Sent Slack alert
  59. {% if event.channel.slack_channel %}
  60. to {{ event.channel.slack_channel }}
  61. {% endif %}
  62. {% elif event.channel.kind == "pd" %}
  63. Sent alert to PagerDuty
  64. {% elif event.channel.kind == "pagertree" %}
  65. Sent alert to PagerTree
  66. {% elif event.channel.kind == "pagerteam" %}
  67. Sent alert to Pager Team
  68. {% elif event.channel.kind == "opsgenie" %}
  69. Sent alert to OpsGenie
  70. {% elif event.channel.kind == "hipchat" %}
  71. Sent alert to HipChat
  72. {% elif event.channel.kind == "po" %}
  73. Sent a Pushover notification
  74. {% elif event.channel.kind == "webhook" %}
  75. Called webhook {{ event.channel.url_down }}
  76. {% else %}
  77. Sent alert to {{ event.channel.kind|capfirst }}
  78. {% endif %}
  79. {% if event.error %}
  80. <br />
  81. <strong>Error: {{ event.error }}</strong>
  82. {% endif %}
  83. </td>
  84. </tr>
  85. {% endif %}
  86. {% endfor %}
  87. </table>
  88. <p class="text-center">
  89. <a href="{% url 'hc-log' check.code %}">Show More&hellip;</a>
  90. </p>
  91. {% else %}
  92. <div class="alert no-events">
  93. You will see a live-updating log of received pings here. <br />
  94. This check has not received any pings yet.
  95. </div>
  96. {% endif %}