{% extends base_template %} {# One wording per message. The badge and the flash of the same warning are the two constants of views.py, handed in as `shared_queue_warning` and `shared_queue_ack_warning`, so the page and the notice cannot drift apart. #} {% macro shared_badge(names, acking, name_them=false) %} {%- if names -%} ⚠ shared queue{% if name_them %}: {{ names | join(', ') }}{% endif %}{% if acking %} — messages deleted{% endif %} {%- endif -%} {% endmacro %} {% macro ack_unmatched_cell(on) %} {%- if on -%} on {%- else -%} — {%- endif -%} {% endmacro %} {% block content %}
{# Flash messages #} {% with messages = get_flashed_messages(with_categories=true) %} {% for category, message in messages %}
{{ message }}
{% endfor %} {% endwith %} {# --- Connections block --- #}

Connections

{% if conn_status_error %}

⚠ {{ conn_status_error }}

{% elif conn_statuses %} {% for cs in conn_statuses %} {% endfor %}
conn_id Status Consumers Broker consumers Last reconcile Last Error
{{ cs.conn_id }} {% if cs.status == 'connected' %} ● connected {% elif cs.status == 'error' %} ✕ error {% elif cs.status == 'degraded' %} ○ degraded {% else %} ○ {{ cs.status }} {% endif %} {{ cs.consumer_count }} {% if cs.broker_consumer_count is none %} — {% elif cs.counts_mismatch %} ⚠ {{ cs.broker_consumer_count }} {% else %} {{ cs.broker_consumer_count }} {% endif %} {% if cs.age_seconds is none %} — {% elif cs.is_stale %} ⚠ {{ cs.age_display }} ago {% else %} {{ cs.age_display }} ago {% endif %} {{ cs.last_error or '—' }}
{% else %}

No connections established yet.

{% endif %}
{# --- Subscriptions table --- #}

Subscriptions {# The form behind this button writes through the same mapping the notice below says could not be read, so it would answer with a 500 for as long as the notice stands. #} {% if not subscriptions_error %} + Create subscription {% endif %}

{% if subscriptions_error %}

⚠ {{ subscriptions_error }}

{% elif subscriptions %} {% for item in subscriptions %} {% if item.is_group is defined and item.is_group %} {# ---- Grouped row (multiple queues, shared cooldown) ---- #} {% else %} {# ---- Single-queue row (no group_key) ---- #} {% endif %} {% endfor %}
DAG Queue(s) conn_id Cooldown Ack unmatched Source Status Last Error Actions
{{ item.dag_id }} {% if active_dag_ids is defined and active_dag_ids is not none and item.dag_id not in active_dag_ids %} ⚠ dag not found {% endif %} {% for q in item.queue_names %} {{ q }} {% endfor %} {{ shared_badge(item.shared_queue_names, item.shared_acking, name_them=true) }} {{ item.conn_id }} {% if item.cooldown %} {{ item.cooldown }}s {% else %} — {% endif %} {{ ack_unmatched_cell(item.ack_unmatched) }} {% if item.source == 'dag_file' %} dag_file {% else %} ui {% endif %} {% if not item.enabled %} disabled {% else %} {{ item.display_status }} {% endif %} {{ item.last_error or '—' }}
Edit {% if item.source == 'ui' %}
{% endif %}
{{ item.dag_id }} {% if active_dag_ids is defined and active_dag_ids is not none and item.dag_id not in active_dag_ids %} ⚠ dag not found {% endif %} {{ item.queue_name }} {{ shared_badge(item.shared_queue_names, item.shared_acking) }} {{ item.conn_id }} {% if item.cooldown %} {{ item.cooldown }}s {% else %} — {% endif %} {{ ack_unmatched_cell(item.ack_unmatched) }} {% if item.source == 'dag_file' %} dag_file {% else %} ui {% endif %} {% if not item.enabled %} disabled {% elif item.consumer_status == 'listening' %} listening {% elif item.consumer_status == 'connecting' %} connecting {% elif item.consumer_status == 'error' %} error {% elif item.consumer_status == 'disconnected' %} ○ disconnected {% else %} {{ item.consumer_status }} {% endif %} {{ item.last_error or '—' }}
Edit {% if item.source == 'ui' %}
{% endif %}
{% else %}

No subscriptions yet. Create the first one or add @rmq_trigger to a DAG file.

{% endif %}
{% endblock %}