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.

54 lines
1.7 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. "text": "{{ check.desc|escapejs }}"
  40. }
  41. ],
  42. "potentialAction": [
  43. {
  44. "@type": "OpenUri",
  45. "name": "View in {% site_name %}",
  46. "targets": [
  47. {
  48. "os": "default",
  49. "uri": "{{ check.details_url }}"
  50. }
  51. ]
  52. }
  53. ]
  54. }