{% extends "base.html" %} {% from "components/ui.html" import action, ago, breadcrumb, card, csrf_field, danger_card, empty, fact, facts, icon, related, secret_card, webhook_state with context %} {% from "components/webhook.html" import webhook_fields %} {% block title %}Webhook · {{ APP_NAME }}{% endblock %} {% block heading %}{{ webhook.url }}{% endblock %} {% block subheading %}{{ breadcrumb([("Webhooks", "/ui/webhooks"), (webhook.url, None)]) }}{% endblock %} {% block content %} {% if secret %} {% call secret_card("Signing secret", secret) %}Keep it with the receiver. It checks X-Mailbox-Signature with it. Only this service keeps it besides, encrypted.{% endcall %} {% endif %} {% set state %}{{ webhook_state(webhook.last_error, detail=False) }}{% endset %} {% call facts("Webhook", tags=state) %} {{ fact("URL", webhook.url, cls="mono") }} {% call fact("Events") %}{% for event in webhook.events %}{{ event }} {% endfor %}{% endcall %} {% call fact("Accounts") %}{% if webhook.accounts is none %}every account you may read, also later ones{% else %}{% for account in webhook.accounts %}{{ names.get(account, account) }}{% if not loop.last %}, {% endif %}{% endfor %}{% endif %}{% endcall %} {{ fact("Created", webhook.created_at | when) }} {{ fact("Last delivery", webhook.last_delivery_at | when) }} {% if webhook.last_error %}{{ fact("Last error", webhook.last_error) }}{% endif %} {{ fact("Id", webhook.id, cls="mono") }} {% endcall %} {% call related("Last deliveries", count=webhook.deliveries | length, meta="the newest 20 posts") %}
{% if webhook.deliveries %}
{% for attempt in webhook.deliveries %} {% endfor %}
WhenEventsAnswerDelivery
{{ ago(attempt.at) }} {{ attempt.events }} {% if attempt.error is none %}{{ attempt.status }} {% else %}{{ attempt.status if attempt.status is not none else "no answer" }}{{ attempt.error }}{% endif %} {{ attempt.delivery_id[:16] }}…
{% else %}{{ empty("Nothing posted yet.") }}{% endif %}
{% endcall %} {% if can_update %}
{{ csrf_field() }} {% call card("Change", meta="Its deliveries and where its posts stand stay, its secret too.") %} {{ webhook_fields(typed, events, accounts) }}
{% endcall %}
{% endif %} {% if can_renew %} {% call card("Signing secret") %}
A new secret is shown once. The one before stops at once: the receiver needs the new one before the next post. {{ action("/ui/webhooks/" ~ webhook.id ~ "/secret", "New secret", confirm="Make a new signing secret? The one before stops at once, so the receiver refuses the next posts until it has the new one.", cls="", icon="arrow-clockwise") }}
{% endcall %} {% endif %} {% if can_delete %} {{ danger_card("Remove", "The service stops posting to this URL. What it posted stays with the receiver.", "/ui/webhooks/" ~ webhook.id ~ "/delete", "Remove webhook", "Remove the webhook " ~ webhook.url ~ "?") }} {% endif %} {% endblock %}