{% extends "base.html" %} {% block title %}{{ t('schedules.title') }} — painfree{% endblock %} {% block body %}

{{ t('schedules.heading') }}

{{ t('schedules.lede') }}

{# The reason an operator opens this page. Above the table, before any filter. `failing` is derived from the engine's own return-code table, so a `090005` cannot end up here. #} {% if failing %}

{{ t('schedules.failing_heading', count=failing | length) }}

{{ t('schedules.failing_why') }}

{% endif %} {% if behind %}

{{ t('schedules.behind_heading', count=behind | length) }}

{{ t('schedules.behind_why') }}

{% endif %}
{% if may('schedules:manage') %} {{ t('schedules.add') }} {% endif %}
{% if schedules %} {% for row in schedules %} {# The BTF is the bank's own order parameters. Every value in this cell is a protocol identifier and none of them is translated. #} {% endfor %}
{{ t('schedules.schedule') }}{{ t('schedules.fetches') }} {{ t('common.connection') }}{{ t('schedules.cadence') }} {{ t('webhooks.health') }}{{ t('schedules.last_run') }} {{ t('schedules.covered_through_column') }}{{ t('schedules.next_due') }}
{{ row.description or row.label }}
{{ row.schedule_id }}
{{ row.label }}
{{ t('schedules.service') }} {{ row.service_name }}{% if row.scope %}, {{ t('schedules.scope') }} {{ row.scope }}{% endif %}{% if row.container %}, {{ row.container }}{% endif %}
{{ row.connection_id }} {{ row.cadence.total_seconds() | int | cadence }} {{ row.health }} {% if row.running %}
{{ t('schedules.running_now') }}{% endif %}
{% if last_runs[row.schedule_id] %} {% set run = last_runs[row.schedule_id] %} {{ run.state }} {% if run.state == 'empty' %}
{{ t('schedules.bank_had_nothing') }} {% elif run.state == 'complete' %}
{{ t('schedules.statement_count', count=run.statements) }} {% elif run.return_code %}
{{ run.return_code }}{% endif %}
{{ row.last_run_at | moment }} {% else %} {{ t('schedules.never_run') }} {% endif %}
{% if windows[row.schedule_id].dated %} {{ row.fetched_through | day if row.fetched_through else '—' }} {% if windows[row.schedule_id].behind %}
{{ t('schedules.days_outstanding', count=windows[row.schedule_id].days_behind) }} {% endif %} {% else %} {{ t('schedules.no_date_range') }} {% endif %}
{{ row.due_at | moment }}
{% else %}

{{ t('schedules.empty') }}

{% endif %}
{% endblock %}