{% extends "base.html" %} {% import "_bank.html" as bank with context %} {% block title %}{{ schedule.description or schedule.label }} — painfree{% endblock %} {% block body %}

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

{{ schedule.description or schedule.label }} {{ t('schedules.on') }} {{ schedule.connection_id }}

{% if schedule.health == 'failing' %}

{{ t('schedule.failing') }}

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

{% if runs and runs[0].report_text %} {% endif %} {% if schedule.last_error %} {% endif %}
{{ t('schedule.bank_return_code') }} {{ schedule.last_return_code or '—' }}
{{ t('orders.report_text') }}{{ bank.words(runs[0].report_text) }}
{{ t('schedule.error') }}{{ schedule.last_error }}
{{ t('schedule.last_attempt') }}{{ schedule.last_run_at | moment }}
{{ t('schedule.next_attempt') }}{{ schedule.due_at | moment }}
{% elif not schedule.enabled %}

{{ t('webhook.paused') }}

{{ t('schedule.paused_why') }}

{% endif %} {% if created %}

{{ t('schedule.created', when=schedule.due_at | moment) }}

{% endif %} {% if queued %}

{% if queued == 'refetch' %}{{ t('schedule.queued_refetch') }}{% else %}{{ t('schedule.queued') }}{% endif %} {{ t('schedule.queued_why') }}

{% endif %}
{# Every value in the BTF row is a protocol identifier the bank publishes. Not one of them is translated, in any locale. #}
{{ t('schedules.schedule') }}{{ schedule.schedule_id }}
{{ t('webhook_new.description') }}{{ schedule.description or '—' }}
{{ t('schedules.fetches') }}{{ schedule.label }}
BTF ServiceName {{ schedule.service_name }} · MsgName {{ schedule.msg_name }} {% if schedule.msg_version %}· MsgVersion {{ schedule.msg_version }}{% endif %} {% if schedule.msg_variant %}· MsgVariant {{ schedule.msg_variant }}{% endif %} {% if schedule.scope %}· Scope {{ schedule.scope }}{% endif %} {% if schedule.service_option %}· Option {{ schedule.service_option }}{% endif %} {% if schedule.container %}· Container {{ schedule.container }}{% endif %}
{{ t('schedules.cadence') }}{{ schedule.cadence.total_seconds() | int | cadence }}
{{ t('webhooks.health') }}{{ schedule.health }}
{{ t('schedules.next_due') }}{{ schedule.due_at | moment }} {% if schedule.running %}
{{ t('schedule.claimed_by') }} {{ schedule.worker_id }}, {{ t('schedule.run_in_flight') }}{% endif %}
{{ t('schedules.last_run') }}{{ schedule.last_run_at | moment }} {%- if schedule.last_return_code %}, {{ schedule.last_return_code }}{% endif %}
{{ t('schedule.requested_by') }}{{ schedule.run_requested_by or '—' }}

{{ t('schedule.window') }}

{% if window.dated %}
{{ t('schedules.covered_through_column') }} {{ window.covered_through | day if window.covered_through else t('schedule.nothing_fetched') }}
{{ t('schedule.next_run_asks') }} {{ window.pending_start | day }} → {{ window.pending_end | day }} ({{ t('unit.day', count=window.days_pending) }})
{{ t('schedule.outstanding') }} {% if window.behind %}{{ t('schedule.outstanding_days', count=window.days_behind) }}{% else %}{{ t('schedule.outstanding_none') }}{% endif %}
{{ t('schedule.window_length') }}{{ t('schedule.window_length_value', count=schedule.window_days) }}

{{ t('schedule.window_hint') }}

{% else %}

{{ t('schedule.undated') }}

{% endif %}
{% if unfinished %}

{{ t('schedule.unfinished') }}

{{ t('schedule.unfinished_why') }}

{% for run in unfinished %} {% endfor %}
{{ t('schedule.run') }}{{ t('schedule.asked_for') }} {{ t('common.state') }}{{ t('schedules.bank_said_column') }} {{ t('common.when') }}
{{ run.run_id }} {{ run.window_start | day if run.window_start else '—' }} → {{ run.window_end | day if run.window_end else '—' }} {{ run.state }} {% if run.return_code %}{{ run.return_code }}{% endif %} {% if run.report_text %}
{{ bank.quiet(run.report_text) }}{% endif %} {% if run.last_error %}
{{ run.last_error }}{% endif %}
{{ run.started_at | moment }}
{% endif %} {% if may('schedules:manage') %}

{{ t('webhook.controls') }}

{% if schedule.enabled %}
{% else %}
{% endif %}

{{ t('schedule.controls_hint') }}

{% if window.dated %}

{{ t('schedule.refetch') }}

{{ t('schedule.refetch_body') }}

{{ t('schedule.refetch_safe') }} {{ t('schedule.refetch_safe_why') }}

{# ISO 8601, because that is what `` submits and what the handler parses. A localised value here would be a value the form cannot send: the display rule stops at the edge of a field. #}
{% endif %}

{{ t('webhook.configuration') }}

{{ t('webhook.remove') }}

{{ t('schedule.remove_why') }}

{% endif %}

{{ t('schedule.runs') }}

{% if runs %} {% for run in runs %} {% endfor %}
{{ t('schedule.run') }}{{ t('schedule.asked_for') }} {{ t('common.state') }}{{ t('schedules.bank_said_column') }} {{ t('order.ingested') }}{{ t('schedule.asked_for_by') }} {{ t('schedule.started') }}{{ t('schedule.finished') }}
{{ run.run_id }} {% if run.transaction_id %}
tx {{ run.transaction_id }}{% endif %}
{% if run.window_start %}{{ run.window_start | day }} → {{ run.window_end | day }}{% else %}{{ t('schedule.no_date_range') }}{% endif %} {{ run.state }} {% if run.state == 'empty' %}
{{ t('schedule.empty_is_normal') }}{% endif %} {% if run.state == 'complete' and not run.acknowledged %}
{{ t('schedule.not_acknowledged') }} {% endif %}
{% if run.return_code %}{{ run.return_code }}{% else %}—{% endif %} {% if run.report_text %}
{{ bank.quiet(run.report_text) }}{% endif %} {% if run.last_error %}
{{ run.last_error }}{% endif %}
{% if run.state == 'complete' %} {{ t('schedules.statement_count', count=run.statements) }} {% if run.duplicates %}
{{ t('schedule.already_held', count=run.duplicates) }}{% endif %}
{{ t('schedule.segments', count=run.segments) }}, {{ t('schedule.bytes', count=run.bytes) }} {% else %}—{% endif %}
{% if run.requested_by %}{{ run.requested_by }} {% else %}{{ t('schedule.the_cadence') }}{% endif %} {{ run.started_at | moment }} {{ run.finished_at | moment }}
{% else %}

{{ t('schedule.never_run') }}

{% endif %}
{% endblock %}