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.

85 lines
3.0 KiB

  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.fail %}
  14. <span class="label label-danger">Failure</span>
  15. {% elif event.start %}
  16. <span class="label label-start">Started</span>
  17. {% else %}
  18. <span class="label label-success">OK</span>
  19. {% endif %}
  20. </td>
  21. <td class="details">
  22. {% if event.scheme == "email" %}
  23. {{ event.ua }}
  24. {% else %}
  25. {{ event.scheme|upper }}
  26. {{ event.method }}
  27. {% if event.remote_addr %}
  28. from {{ event.remote_addr }}
  29. {% endif %}
  30. <span class="ua-body">
  31. {% if event.ua %}
  32. - {{ event.ua|truncatechars:80 }}
  33. {% endif %}
  34. </span>
  35. {% endif %}
  36. </td>
  37. </tr>
  38. {% endif %}
  39. {% if event.check_status %}
  40. <tr class="missing" data-dt="{{ event.created.isoformat }}">
  41. <td class="n-cell">
  42. <span class="icon-missing"></span>
  43. </td>
  44. <td class="date"></td>
  45. <td class="time"></td>
  46. <td class="alert-info" colspan="2">
  47. {% if event.channel.kind == "email" %}
  48. Sent email alert to {{ event.channel.value }}
  49. {% elif event.channel.kind == "slack" %}
  50. Sent Slack alert
  51. {% if event.channel.slack_channel %}
  52. to {{ event.channel.slack_channel }}
  53. {% endif %}
  54. {% elif event.channel.kind == "pd" %}
  55. Sent alert to PagerDuty
  56. {% elif event.channel.kind == "pagertree" %}
  57. Sent alert to PagerTree
  58. {% elif event.channel.kind == "opsgenie" %}
  59. Sent alert to OpsGenie
  60. {% elif event.channel.kind == "hipchat" %}
  61. Sent alert to HipChat
  62. {% elif event.channel.kind == "po" %}
  63. Sent a Pushover notification
  64. {% elif event.channel.kind == "webhook" %}
  65. Called webhook {{ event.channel.url_down }}
  66. {% else %}
  67. Sent alert to {{ event.channel.kind|capfirst }}
  68. {% endif %}
  69. {% if event.error %}
  70. <br />
  71. <strong>Error: {{ event.error }}</strong>
  72. {% endif %}
  73. </td>
  74. </tr>
  75. {% endif %}
  76. {% endfor %}
  77. </table>
  78. {% if check.n_pings > 20 %}
  79. <p class="text-center">
  80. <a href="{% url 'hc-log' check.code %}">Show More&hellip;</a>
  81. </p>
  82. {% endif %}
  83. {% else %}
  84. <div class="alert alert-info">This check has not received any pings yet.</div>
  85. {% endif %}