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.

55 lines
1.8 KiB

  1. {% load hc_extras humanize %}
  2. {
  3. "@type": "MessageCard",
  4. "@context": "https://schema.org/extensions",
  5. "themeColor": "{% if check.status == "up" %}5cb85c{% endif %}{% if check.status == "down" %}d9534f{% endif %}",
  6. "text": "“{{ check.name_then_code|escapejs }}” is {{ check.status|upper }}.",
  7. "sections": [
  8. {
  9. "facts": [
  10. {% if check.tags_list %}
  11. {
  12. "name": "Tags:",
  13. "value": "{% for tag in check.tags_list %}`{{ tag|escapejs }}` {% endfor %}"
  14. },
  15. {% endif %}
  16. {% if check.kind == "simple" %}
  17. {
  18. "name": "Period:",
  19. "value": "{{ check.timeout|hc_duration }}"
  20. },
  21. {% elif check.kind == "cron" %}
  22. {
  23. "name": "Schedule:",
  24. "value": "{{ check.schedule|escapejs }}"
  25. },
  26. {% endif %}
  27. {
  28. "name": "Last Ping:",
  29. {% if check.last_ping %}
  30. "value": "{{ check.last_ping|naturaltime }}"
  31. {% else %}
  32. "value": "Never"
  33. {% endif %}
  34. },
  35. {
  36. "name": "Total Pings:",
  37. "value": "{{ check.n_pings }}"
  38. }
  39. ],
  40. "text": "{{ check.desc|escapejs }}"
  41. }
  42. ],
  43. "potentialAction": [
  44. {
  45. "@type": "OpenUri",
  46. "name": "View in {% site_name %}",
  47. "targets": [
  48. {
  49. "os": "default",
  50. "uri": "{{ check.details_url }}"
  51. }
  52. ]
  53. }
  54. ]
  55. }