{% from "components/feedback.html" import badge, empty_state %} {# Alert rules panel — swapped into Notifications settings via HTMX. #}

Alert rules

When a value crosses a threshold, notify the channels subscribed to alert.fired. Checked every minute.

{% if rules %}
{% for r in rules %} {% endfor %}
RuleWatchesConditionLast valueState
{{ r.name }}{% if not r.enabled %} paused{% endif %} {{ r.source_label }} {{ r.condition }}{% if r.for_seconds %} for {{ r.for_seconds }}s{% endif %} {% if r.last_value is not none %}{{ "%g" | format(r.last_value) }}{% else %}—{% endif %} {% if r.state == "firing" %}{{ badge("firing", "error") }} {% elif r.state == "pending" %}{{ badge("pending", "warning") }} {% elif r.state == "error" %}{{ badge("error", "warning") }} {% else %}{{ badge("ok", "success") }}{% endif %}
{% else %} {{ empty_state("No alert rules yet", icon="bell-ring", title="Nothing is being watched", action_text="Create the first alert", action_onclick="this.closest('[x-data]').__x ? this.closest('[x-data]').__x.$data.open = true : null") }} {% endif %}