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.

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