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.

75 lines
4.1 KiB

  1. {% load humanize hc_extras %}
  2. {% regroup checks by project as groups %}
  3. <table style="margin: 0; width: 100%; font-size: 16px;" cellpadding="0" cellspacing="0">
  4. {% for group in groups %}
  5. <tr>
  6. <td colspan="2" style="font-weight: bold; padding: 32px 8px 8px 8px; color: #333;">
  7. {{ group.grouper|mangle_link }}
  8. </td>
  9. <td style="padding: 32px 8px 8px 8px; margin: 0; font-size: 12px; color: #9BA2AB; font-family: Helvetica, Arial, sans-serif;">Last Ping</td>
  10. </tr>
  11. {% for check in group.list|sortchecks:sort %}
  12. <tr>
  13. <td style="border-top: 1px solid #EDEFF2; padding: 16px 8px;">
  14. <table cellpadding="0" cellspacing="0">
  15. <tr>
  16. {% with check.get_status_with_started as status %}
  17. {% if status == "new" %}
  18. <td style="background: #AAA; font-family: Helvetica, Arial, sans-serif; font-weight: bold; font-size: 10px; line-height: 10px; color: white; padding: 6px; margin: 0; border-radius: 3px;">NEW</td>
  19. {% elif status == "paused" %}
  20. <td style="background: #AAA; font-family: Helvetica, Arial, sans-serif; font-weight: bold; font-size: 10px; line-height: 10px; color: white; padding: 6px; border-radius: 3px;">PAUSED</td>
  21. {% elif status == "grace" %}
  22. <td style="background: #f0ad4e; font-family: Helvetica, Arial, sans-serif; font-weight: bold; font-size: 10px; line-height: 10px; color: white; padding: 6px; border-radius: 3px;">LATE</td>
  23. {% elif status == "up" %}
  24. <td style="background: #5cb85c; font-family: Helvetica, Arial, sans-serif; font-weight: bold; font-size: 10px; line-height: 10px; color: white; padding: 6px; border-radius: 3px;">UP</td>
  25. {% elif status == "started" %}
  26. <td style="background: #5cb85c; font-family: Helvetica, Arial, sans-serif; font-weight: bold; font-size: 10px; line-height: 10px; color: white; padding: 6px; border-radius: 3px;">STARTED</td>
  27. {% elif status == "down" %}
  28. <td style="background: #d9534f; font-family: Helvetica, Arial, sans-serif; font-weight: bold; font-size: 10px; line-height: 10px; color: white; padding: 6px; border-radius: 3px;">DOWN</td>
  29. {% endif %}
  30. {% endwith %}
  31. </tr>
  32. </table>
  33. </td>
  34. <td style="border-top: 1px solid #EDEFF2; padding: 16px 8px; font-family: Helvetica, Arial, sans-serif;">
  35. {% if check.name %}
  36. {% if check.name|length > 20 %}
  37. <small>{{ check.name|mangle_link }}</small>
  38. {% else %}
  39. {{ check.name|mangle_link }}
  40. {% endif %}
  41. {% else %}
  42. <span style="color: #74787E; font-style: italic;">unnamed</span>
  43. {% endif %}
  44. {% if check.tags %}
  45. <br />
  46. <table cellpadding="0" cellspacing="0">
  47. <tr>
  48. {% for tag in check.tags_list %}
  49. <td style="padding-right: 4px">
  50. <table cellpadding="0" cellspacing="0">
  51. <tr>
  52. <td style="background: #eee; font-family: Helvetica, Arial, sans-serif; font-size: 10px; line-height: 10px; color: #555; padding: 4px; margin: 0; border-radius: 2px;">
  53. {{ tag|mangle_link }}
  54. </td>
  55. </tr>
  56. </table>
  57. </td>
  58. {% endfor %}
  59. </tr>
  60. </table>
  61. {% endif %}
  62. </td>
  63. <td style="border-top: 1px solid #EDEFF2; padding: 16px 8px; font-family: Helvetica, Arial, sans-serif;">
  64. {% if check.last_ping %}
  65. {{ check.last_ping|naturaltime }}
  66. {% else %}
  67. Never
  68. {% endif %}
  69. <br />
  70. <a href="{{ check.details_url }}" target="_blank">Details…</a>
  71. </td>
  72. </tr>
  73. {% endfor %}
  74. {% endfor %}
  75. </table>
  76. <br />