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.

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