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

{% load hc_extras humanize %}
{
"@type": "MessageCard",
"@context": "https://schema.org/extensions",
"themeColor": "{% if check.status == "up" %}5cb85c{% endif %}{% if check.status == "down" %}d9534f{% endif %}",
"text": "“{{ check.name_then_code|escapejs }}” is {{ check.status|upper }}.",
"sections": [
{
"facts": [
{% if check.tags_list %}
{
"name": "Tags:",
"value": "{% for tag in check.tags_list %}`{{ tag|escapejs }}` {% endfor %}"
},
{% endif %}
{% if check.kind == "simple" %}
{
"name": "Period:",
"value": "{{ check.timeout|hc_duration }}"
},
{% elif check.kind == "cron" %}
{
"name": "Schedule:",
"value": "{{ check.schedule|escapejs }}"
},
{% endif %}
{
"name": "Last Ping:",
{% if check.last_ping %}
"value": "{{ check.last_ping|naturaltime }}"
{% else %}
"value": "Never"
{% endif %}
},
{
"name": "Total Pings:",
"value": "{{ check.n_pings }}"
}
],
"text": "{{ check.desc|escapejs }}"
}
],
"potentialAction": [
{
"@type": "OpenUri",
"name": "View in {% site_name %}",
"targets": [
{
"os": "default",
"uri": "{{ check.details_url }}"
}
]
}
]
}