{% extends "vantage/base.html" %} {% load static vantage i18n %} {% block head %}{% endblock %} {% block content %}

{{ page_title }}

{{ page_description }}

{% if writable %}
{% icon "plus" %}{% translate "New webhook" %}
{% endif %}
{% if new_secret %} {% endif %} {% comment %} Said out loud, as the jobs page does: with no queue configured, a delivery runs in the request that caused it, and retries wait for `manage.py vantage_webhooks`. {% endcomment %} {% if not backend.deferred %}

{% icon "activity" %} {% blocktranslate trimmed %} No task backend is configured, so deliveries are sent during the request that changed the record, and retries wait for manage.py vantage_webhooks. {% endblocktranslate %}

{% endif %}
{% if hooks %} {% for hook in hooks %} {% endfor %}
{% translate "Name" %} {% translate "URL" %} {% translate "Status" %} {% translate "Failed" %} {% translate "Actions" %}
{{ hook.name }} {{ hook.url }} {% if hook.active %}{% translate "Active" %}{% else %}{% translate "Paused" %}{% endif %} {{ hook.failing }}
{% csrf_token %}
{% if writable %} {% icon "pencil" %}{% translate "Edit" %} {% icon "trash" %}{% translate "Delete" %} {% endif %}
{% else %}
{% icon "send" class="v-empty-icon" %}

{% translate "No webhooks yet." %}

{% blocktranslate trimmed %} A webhook sends a signed POST to an address you choose when a record is created, changed or deleted, and keeps a log of every delivery. {% endblocktranslate %}

{% endif %}

{% translate "Deliveries" %}

{% if page_obj.object_list %} {% for d in page_obj %} {% endfor %}
{% translate "When" %} {% translate "Webhook" %} {% translate "Event" %} {% translate "Status" %} {% translate "Code" %} {% translate "Attempts" %} {% translate "Time" %}
{{ d.webhook.name }} {{ d.event }} {% if d.resource_key %}{{ d.resource_key }}{% if d.object_id %} #{{ d.object_id }}{% endif %}{% endif %} {{ d.get_status_display }} {% if d.error and d.status != "succeeded" %}

{{ d.error }}

{% endif %}
{{ d.response_code|default:"—" }} {{ d.attempts }} {% if d.duration_ms is not None %}{{ d.duration_ms }} ms{% else %}—{% endif %}
{% else %}

{% translate "No deliveries yet." %}

{% endif %}
{% if page_obj.has_other_pages %} {% endif %} {% endblock %}