"swarm services short on swarm is 6." becomes "6 swarm services are short of their replicas.", with a Which line naming each service and how many of its tasks run. The swarm figures get labels, and the counting figures (swarm, mounts, drives, updates) read as sentences in the email, its subject and the Alerts page. A plugin names what its count counts through core.alerts.names_behind; the Docker plugin does for the three swarm figures, from the stored swarm. Webhooks get alert.which too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
29 lines
1.3 KiB
HTML
29 lines
1.3 KiB
HTML
{# An alert email's HTML part: a = mail.alert_facts(), link = the alerts page or "". #}
|
||
{% extends "_layout.html" %}
|
||
{% from "_parts.html" import badge, button, fact with context %}
|
||
{% block title %}{{ a.state }}: {{ a.rule }}{% endblock %}
|
||
{% block body %}
|
||
<tr><td style="padding:14px 24px 0 24px;">{{ badge(a.tone, a.state) }}</td></tr>
|
||
<tr><td style="padding:10px 24px 4px 24px;font:600 20px/1.35 {{ c.font }};color:{{ c.text }};">{{ a.headline }}</td></tr>
|
||
<tr><td style="padding:10px 24px 4px 24px;">
|
||
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0">
|
||
{{ fact("Rule", a.rule) }}
|
||
{{ fact("Resource", a.resource) }}
|
||
{{ fact("Reading", a.reading) }}
|
||
{% if a.which %}{{ fact("Which", a.which) }}{% endif %}
|
||
{{ fact("Fires when", a.condition) }}
|
||
{% call fact("When") %}{{ a.when }}{% if a.when_utc %}<br><span style="color:{{ c.muted }};">{{ a.when_utc }}</span>{% endif %}{% endcall %}
|
||
{% if a.note %}{{ fact("Note", a.note) }}{% endif %}
|
||
</table>
|
||
</td></tr>
|
||
{% if link %}
|
||
<tr><td style="padding:16px 24px 24px 24px;">{{ button(link, "View in Steward") }}</td></tr>
|
||
{% else %}
|
||
<tr><td style="padding:0 0 12px 0;"></td></tr>
|
||
{% endif %}
|
||
{% endblock %}
|
||
{% block footer %}
|
||
Steward sends this to everyone on its email list when an alert rule changes state.
|
||
Who gets it is set in Settings › Notifications.
|
||
{% endblock %}
|