{# alerts/_history_page.html — one page of alert episodes (#5316), then the sentinel that loads the next page as the reader nears it (core.paging, pref 172). An episode is one stretch out of quiet: what it reached, for how long, its worst reading, who was told; its transitions fold under it. #} {% from "_macros.html" import status_badge, scroll_more, scroll_end %} {% set cols = 3 + (0 if chosen else 1) + (1 if show_notified else 0) + (1 if show_action else 0) %} {% for ep in episodes %} {%- if ep.began_here %}{{ ep.start|ago }}{% else %}earlier{% endif -%} {% if not chosen %} {{ ep.rule.name }}
{{ source_label(ep.rule.source_module) }} · {{ ep.rule.resource_name }}
{% endif %} {% if not ep.began_here and ep.steps|length == 1 %} {%- set s = ep.steps[0] %}{{ status_badge(s.from_state) }} → {{ status_badge(s.to_state) }} {% else %} {{ status_badge(ep.worst) }} {%- if ep.ongoing %} {% if ep.began_here %}for {{ ep.duration|duration }}, {% endif %}still going {%- elif ep.continues %} cleared later (above) {%- elif ep.began_here %} for {{ ep.duration|duration }} · cleared {{ ep.end|ago }} {%- else %} cleared {{ ep.end|ago }}{% endif %} {% endif %} {% for n in ep.notes %}
{{ n }}
{% endfor %} {% if ep.steps|length > 1 %}
{{ ep.steps|length }} changes of state
    {% for s in ep.steps %}
  1. {{ status_badge(s.from_state) }} → {{ status_badge(s.to_state) }} {{ s.value }} · {{ s.at|ago }}
  2. {% endfor %}
{% endif %} {%- if ep.reading %}{{ ep.reading }} ({{ ep.fires_when }}) {%- else %}no reading ({{ ep.fires_when }}){% endif -%} {% if show_notified %} {% if ep.muted_by %} muted · {{ ep.muted_by }} {% if ep.released %}
notified when the window ended
{% endif %} {% endif %} {% for label, sent, error in ep.deliveries %}
{% if sent %}{{ label }} sent {% else %}{{ label }} failed {% if error %}
{{ error }}
{% endif %} {% endif %}
{% endfor %} {% if not ep.muted_by and not ep.deliveries %}—{% endif %} {% endif %} {% if show_action %} {% for run_id in ep.runs %}
Ansible run
{% else %}—{% endfor %} {% endif %} {% endfor %} {% if after %} {{ scroll_more("/alerts/history?before=" ~ (after|urlencode) ~ "&range=" ~ (current_range|urlencode) ~ (("&rule=" ~ (chosen.id|urlencode)) if chosen else ""), cols=cols) }} {% else %} {{ scroll_end(cols=cols) }} {% endif %}