{# Devices list page — Settings › Devices. Two concerns on one page: 1. The "current browser" card, whose state is resolved client-side by /static/push.js (the server doesn't know which stored row, if any, belongs to the browser viewing this page). We render all four possible states' DOM hooks and let the script swap copy + disable the toggle as appropriate. 2. The server-side subscription table: every row in ``push_subscriptions``, with a friendly UA label, delete action, and a single "Send test push" button that fans out to all rows. #} {% extends "settings/_base.html" %} {% from "_macros.html" import confirm_dialog %} {% block section_header %}

Devices

Browsers subscribed to push notifications from Agent Drop. Each device appears once per browser profile; re-subscribing refreshes the row rather than adding a duplicate.

{% endblock %} {% block settings_head_extra %} {% endblock %} {% block settings_content %} {# Flash band — denylisted notice kinds only. #} {% if notice == "sent-ok" %}
Test push sent.{% if detail %} {{ detail }}{% endif %}
{% elif notice == "sent-empty" %}
No devices subscribed yet, so the test push had nowhere to go. Click Enable on this device below to add one.
{% elif notice == "failed" %}
Test push failed.{% if detail %} {{ detail }}{% endif %}
{% elif notice == "deleted" %}
Device removed.
{% endif %} {# ----- This browser card ----------------------------------------- #}

This browser

{% if not vapid_configured %}

Web Push isn't configured on this server. Generate keys with make vapid-keys, set AGENTDROP_VAPID_PUBLIC_KEY, AGENTDROP_VAPID_PRIVATE_KEY, and AGENTDROP_VAPID_SUBJECT, then restart.

{% else %}

Checking subscription state…

{% endif %}
{# ----- All subscriptions ---------------------------------------- #}

All subscribed devices

{% if subscriptions %}
{% for sub in subscriptions %} {% endfor %}
Device Subscribed Last used Actions
{{ sub.label }}
{% if sub.user_agent %}
{{ sub.user_agent }}
{% endif %}
{{ sub.created_at.strftime("%Y-%m-%d") }} {% if sub.last_used_at %} {{ sub.last_used_at.strftime("%Y-%m-%d") }} {% else %} — {% endif %}
{{ confirm_dialog( form_id="delete-device-" ~ sub.id, title="Remove this device?", message="It will stop receiving push notifications.", confirm_text="Remove device", danger=True, ) }}
{% else %}
No devices subscribed yet.

Enable notifications on at least one browser above to start receiving drops as push notifications.

{% endif %}
{% if vapid_configured %} {% endif %} {% endblock %}