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 staticfiles %}
  2. {
  3. "message": "“{{ check.name_then_code|escapejs }}” is {{ check.status|upper }}.",
  4. {% if check.status == "up" %}
  5. "color": "green",
  6. {% else %}
  7. "color": "red",
  8. {% endif %}
  9. "card": {
  10. "style": "application",
  11. "url": "{% site_root %}{% url 'hc-log' check.code %}",
  12. "format": "medium",
  13. "id": "{{ check.code }}",
  14. "title": "{{ check.name_then_code|escapejs }}",
  15. "icon": {
  16. {% if check.status == "up" %}
  17. "url": "{% site_root %}{% static 'img/up.png' %}"
  18. {% else %}
  19. "url": "{% site_root %}{% static 'img/down.png' %}"
  20. {% endif %}
  21. },
  22. "attributes": [
  23. {% if check.kind == "simple" %}
  24. {"label": "Period",
  25. "value": {"label": "{{ check.timeout|hc_duration }}"}
  26. },
  27. {% elif check.kind == "cron" %}
  28. {"label": "Schedule",
  29. "value": {"label": "{{ check.schedule|escapejs }}"}
  30. },
  31. {% endif %}
  32. {"label": "Last Ping",
  33. {% if check.last_ping %}
  34. "value": {"label": "{{ check.last_ping|naturaltime }}"}
  35. {% else %}
  36. "value": {"label": "Never"}
  37. {% endif %}
  38. },
  39. {% if check.tags_list %}
  40. {"label": "Tags",
  41. "value": {"label": "{{ check.tags_list|join:", " }}"}
  42. },
  43. {% endif %}
  44. {"label": "Total Pings",
  45. "value": {"label": "{{ check.n_pings }}"}
  46. }
  47. ],
  48. "activity": {
  49. "html": "“{{ check.name_then_code|escapejs }}” is {{ check.status|upper }}."
  50. }
  51. }
  52. }