{% extends "base.html" %} {% block title %}{{ subscription.url }} — painfree{% endblock %} {% block body %}

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

{{ subscription.url }}

{% if subscription.parked %}

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

{{ t('webhook.parked_why', failures=subscription.consecutive_failures) }} {{ t('webhook.parked_owed', count=owed) }}

{% if subscription.last_error %}

{{ subscription.last_error }}

{% endif %}
{% elif not subscription.enabled %}

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

{{ t('webhook.paused_why') }} {{ t('webhook.waiting_count', count=owed) }}

{% endif %} {% if pinged %}

{{ t('webhook.pinged') }} {{ pinged }}. {{ t('webhook.pinged_why') }}

{% endif %} {% if subscription.rotating %}

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

{{ t('webhook.rotating_why', since=subscription.secret_rotated_at | moment, generation=subscription.secret_generation) }}

{% if may('webhooks:manage') %}
{% endif %}
{% endif %}
{{ t('webhook_secret.subscription') }}{{ subscription.subscription_id }}
{{ t('webhook_new.description') }}{{ subscription.description or '—' }}
{{ t('common.connection') }} {% if subscription.connection_id %}{{ subscription.connection_id }}{% else %}{{ t('common.every_connection') }}{% endif %}
{{ t('webhooks.events') }}{{ subscription.event_types | join(', ') }}
{{ t('webhooks.health') }}{{ subscription.health }}
{{ t('webhook.consecutive_failures') }}{{ subscription.consecutive_failures | count }}
{{ t('webhooks.last_delivery') }} {{ subscription.last_delivery_at | moment }} {%- if subscription.last_status %}, HTTP {{ subscription.last_status }}{% endif %} {% if subscription.last_error %}
{{ subscription.last_error }}{% endif %}
{{ t('webhook.waiting_to_deliver') }}{{ owed | count }}
{{ t('webhook.signing_secret') }} {{ t('webhooks.generation', number=subscription.secret_generation) }}, {{ t('webhook.sealed') }}
{{ t('connection.registered') }}{{ subscription.created_at | moment }}
{% if may('webhooks:manage') %}

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

{% if subscription.parked or not subscription.enabled %}
{% else %}
{% endif %} {% if not subscription.rotating %}
{% endif %}

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

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

{% for name in event_types %}
{% endfor %}

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

{{ t('webhook.remove_why', count=owed) }}

{% endif %}

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

{% if deliveries %} {% for row in deliveries %} {% endfor %}
{{ t('webhook.delivery') }}{{ t('order.event') }} {{ t('common.state') }}{{ t('order.attempts') }} {{ t('webhook.answer') }}{{ t('webhook.occurred') }} {{ t('webhook.delivered') }}
{{ row.delivery_id }}
{{ row.event_id }}
{{ row.event_type }} {% if row.event_type == ping_event_type %}
{{ t('webhook.test_event') }}{% endif %} {% if row.order_id %}
{{ row.order_id }}{% endif %}
{{ row.state }} {{ row.attempts | count }}{% if row.next_attempt_at and row.state == 'pending' %}
{{ t('webhook.next_attempt') }} {{ row.next_attempt_at | moment }}{% endif %}
{% if row.last_status %}HTTP {{ row.last_status }}{% else %}—{% endif %} {% if row.last_error %}
{{ row.last_error }}{% endif %}
{{ row.occurred_at | moment }} {{ row.delivered_at | moment }}
{% else %}

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

{% endif %}
{% endblock %}