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.

53 lines
1.6 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. "sections": [
  7. {
  8. "facts": [
  9. {% if check.tags_list %}
  10. {
  11. "name": "Tags:",
  12. "value": "{% for tag in check.tags_list %}`{{ tag|escapejs }}` {% endfor %}"
  13. },
  14. {% endif %}
  15. {% if check.kind == "simple" %}
  16. {
  17. "name": "Period:",
  18. "value": "{{ check.timeout|hc_duration }}"
  19. },
  20. {% elif check.kind == "cron" %}
  21. {
  22. "name": "Schedule:",
  23. "value": "{{ check.schedule|escapejs }}"
  24. },
  25. {% endif %}
  26. {
  27. "name": "Last Ping:",
  28. {% if check.last_ping %}
  29. "value": "{{ check.last_ping|naturaltime }}"
  30. {% else %}
  31. "value": "Never"
  32. {% endif %}
  33. },
  34. {
  35. "name": "Total Pings:",
  36. "value": "{{ check.n_pings }}"
  37. }
  38. ]
  39. }
  40. ],
  41. "potentialAction": [
  42. {
  43. "@type": "OpenUri",
  44. "name": "View in {% site_name %}",
  45. "targets": [
  46. {
  47. "os": "default",
  48. "uri": "{{ check.details_url }}"
  49. }
  50. ]
  51. }
  52. ]
  53. }