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.

94 lines
3.3 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.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|mins_secs }}
  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.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 == "opsgenie" %}
  67. Sent alert to OpsGenie
  68. {% elif event.channel.kind == "hipchat" %}
  69. Sent alert to HipChat
  70. {% elif event.channel.kind == "po" %}
  71. Sent a Pushover notification
  72. {% elif event.channel.kind == "webhook" %}
  73. Called webhook {{ event.channel.url_down }}
  74. {% else %}
  75. Sent alert to {{ event.channel.kind|capfirst }}
  76. {% endif %}
  77. {% if event.error %}
  78. <br />
  79. <strong>Error: {{ event.error }}</strong>
  80. {% endif %}
  81. </td>
  82. </tr>
  83. {% endif %}
  84. {% endfor %}
  85. </table>
  86. {% if check.n_pings > 20 %}
  87. <p class="text-center">
  88. <a href="{% url 'hc-log' check.code %}">Show More&hellip;</a>
  89. </p>
  90. {% endif %}
  91. {% else %}
  92. <div class="alert alert-info">This check has not received any pings yet.</div>
  93. {% endif %}