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.

136 lines
4.6 KiB

4 years ago
  1. <!DOCTYPE html>
  2. {% load hc_extras humanize %}
  3. <p>
  4. "{{ check.name_then_code }}" is {{ check.status|upper }}.
  5. <a href="{{ check.details_url }}">View on {% site_name %}&hellip;</a>
  6. </p>
  7. {% if check.desc %}
  8. <p>
  9. <b>Description</b><br>
  10. {{ check.desc|linebreaksbr }}
  11. </p>
  12. {% endif %}
  13. {% cycle '' '</tr><tr>' as trtr silent %}
  14. <table>
  15. <tr>
  16. {% if check.project.name %}
  17. <td style="padding-right: 32px; padding-bottom: 8px; vertical-align: top;">
  18. <b>Project</b><br>
  19. {{ check.project.name }}
  20. </td>
  21. {{ trtr|safe }} {% cycle trtr %}
  22. {% endif %}
  23. {% if check.tags_list %}
  24. <td style="padding-right: 32px; padding-bottom: 8px; vertical-align: top;">
  25. <b>Tags</b><br>
  26. {% for tag in check.tags_list %}
  27. <code style="background-color: #eeeeee; padding: 2px 4px; border-radius: 2px;">{{ tag }}</code>
  28. {% endfor %}
  29. </td>
  30. {{ trtr|safe }} {% cycle trtr %}
  31. {% endif %}
  32. {% if check.kind == "simple" %}
  33. <td style="padding-right: 32px; padding-bottom: 8px; vertical-align: top;">
  34. <b>Period</b><br>
  35. {{ check.timeout|hc_duration }}
  36. </td>
  37. {{ trtr|safe }} {% cycle trtr %}
  38. {% endif %}
  39. {% if check.kind == "cron" %}
  40. <td style="padding-right: 32px; padding-bottom: 8px; vertical-align: top;">
  41. <b>Schedule</b><br>
  42. <code>{{ check.schedule }}</code>
  43. </td>
  44. {{ trtr|safe }} {% cycle trtr %}
  45. {% endif %}
  46. <td style="padding-right: 32px; padding-bottom: 8px; vertical-align: top;">
  47. <b>Total Pings</b><br>
  48. {{ check.n_pings }}
  49. {% if check.created %}(since {{ check.created|date:'M j, Y' }}){% endif %}
  50. </td>
  51. </tr>
  52. {% if ping %}
  53. <tr>
  54. <td style="padding-right: 32px; padding-bottom: 8px; vertical-align: top;">
  55. <b>Last Ping</b><br>
  56. {{ ping.created|naturaltime }}{% if ping.remote_addr %}, from {{ ping.remote_addr }}{% endif %}
  57. </td>
  58. <td style="padding-right: 32px; padding-bottom: 8px; vertical-align: top;">
  59. <b>Last Ping Type</b><br>
  60. {% if ping.exitstatus > 0 %}
  61. <span style="background-color: #f2dede; color: #333333; padding-left: 4px; padding-right: 4px; border-radius: 2px;">
  62. Exit status {{ ping.exitstatus }}
  63. </span>
  64. {% elif ping.exitstatus == 0 %}
  65. <span style="background-color: #dff0d8; color: #333333; padding-left: 4px; padding-right: 4px; border-radius: 2px;">
  66. Exit status 0
  67. </span>
  68. {% elif ping.kind == "fail" %}
  69. <span style="background-color: #f2dede; color: #333333; padding-left: 4px; padding-right: 4px; border-radius: 2px;">
  70. Failure
  71. </span>
  72. {% elif ping.kind == "start" %}
  73. <span style="background-color: #dff0d8; color: #333333; padding-left: 4px; padding-right: 4px; border-radius: 2px;">
  74. Started
  75. </span>
  76. {% elif ping.kind == "ign" %}
  77. <span style="background-color: #eeeeee; color: #333333; padding-left: 4px; padding-right: 4px; border-radius: 2px;">
  78. Ignored
  79. </span>
  80. {% else %}
  81. <span style="background-color: #dff0d8; color: #333333; padding-left: 4px; padding-right: 4px; border-radius: 2px;">
  82. Success
  83. </span>
  84. {% endif %}
  85. </td>
  86. </tr>
  87. {% endif %}
  88. </table>
  89. {% if ping and ping.body %}
  90. <p><b>Last Ping Body</b></p>
  91. <pre>{{ ping.body|slice:":10000"|linebreaksbr }}{% if ping.body|length > 10000 %} [truncated]{% endif %}</pre>
  92. {% endif %}
  93. {% if projects %}
  94. <p><b>Projects Overview</b></p>
  95. <table>
  96. {% for project in projects %}
  97. <tr>
  98. <td style="padding-right: 32px; padding-bottom: 4px;">
  99. <a href="{{ project.checks_url }}">{{ project }}</a>
  100. </td>
  101. <td style="padding-right: 32px; padding-bottom: 4px;">
  102. {% with project.get_n_down as n_down %}
  103. {% if n_down %}
  104. <b>{{ n_down }} check{{ n_down|pluralize }} down</b>
  105. {% else %}
  106. OK, all checks up
  107. {% endif %}
  108. {% endwith %}
  109. </td>
  110. </tr>
  111. {% endfor %}
  112. </table>
  113. {% endif %}
  114. <p style="color: #666666">
  115. &mdash;<br>
  116. {% site_name %}<br>
  117. <a href="{{ unsub_link }}" target="_blank" style="color: #666666; text-decoration: underline;">
  118. {% if check.project.name %}
  119. Unsubscribe from "{{ check.project.name }}" notifications
  120. {% else %}
  121. Unsubscribe
  122. {% endif %}
  123. </a>
  124. </p>