mirror of
https://github.com/healthchecks/healthchecks.git
synced 2025-04-12 00:01:19 +00:00

* Instead of check.n_pings (int) use last_ping().n * Instead of check.last_ping (datetime) use last_ping().created There is a time gap from creating a flip object to processing it (sending out an alert). We want the notification to reflect the check's state at the moment the flip was created. To do this, we use the Transport.last_ping() helper method which retrieves the last ping *that is not newer than the flip*. This commit updates transport classes and templates to use Transport.last_ping() consistently everywhere.
44 lines
No EOL
1.5 KiB
HTML
44 lines
No EOL
1.5 KiB
HTML
{% load hc_extras humanize linemode %}{% linemode %}
|
|
{% autoescape off %}
|
|
{% if check.project.name %}
|
|
{% line %}Project: {{ check.project.name }}{% endline %}
|
|
{% endif %}
|
|
|
|
{% if check.tags_list %}
|
|
{% line %}Tags: {{ check.tags_list|join:", " }}{% endline %}
|
|
{% endif %}
|
|
|
|
{% if check.kind == "simple" %}
|
|
{% line %}Period: {{ check.timeout|hc_duration }}{% endline %}
|
|
{% endif %}
|
|
|
|
{% if check.kind == "cron" %}
|
|
{% line %}Schedule: {{ check.schedule }}{% endline %}
|
|
{% line %}Time Zone: {{ check.tz }}{% endline %}
|
|
{% endif %}
|
|
|
|
{% line %}Total Pings: {% if ping %}{{ ping.n }}{% else %}0{% endif %}{% endline %}
|
|
|
|
{% if ping is None %}
|
|
{% line %}Last Ping: Never{% endline %}
|
|
{% else %}
|
|
{% line %}Last Ping: {{ ping.get_kind_display }}, {{ ping.created|naturaltime }}{% endline %}
|
|
{% endif %}
|
|
|
|
{% if down_checks is not None %}
|
|
{% line %}{% endline %}
|
|
{% if down_checks %}
|
|
{% if down_checks|length > 10 %}
|
|
{% line %}{{ down_checks|length }} other checks are {% if status == "down" %}also{% else %}still{% endif %} down.{% endline %}
|
|
{% else %}
|
|
{% line %}The following checks are {% if status == "down" %}also{% else %}still{% endif %} down:{% endline %}
|
|
{% for c in down_checks %}
|
|
{% line %}• {{ c.name_then_code }} (last ping: {{ c.last_ping|naturaltime|default:"never" }}){% endline %}
|
|
{% endfor %}
|
|
{% endif %}
|
|
{% else %}
|
|
{% line %}All the other checks are up.{% endline %}
|
|
{% endif %}
|
|
{% endif %}
|
|
{% endautoescape %}
|
|
{% endlinemode %} |