FossilRepo

fossilrepo / templates / fossil / webhook_list.html
Source Blame History 88 lines
c588255… ragelink 1 {% extends "base.html" %}
c588255… ragelink 2 {% block title %}Webhooks — {{ project.name }} — Fossilrepo{% endblock %}
c588255… ragelink 3
c588255… ragelink 4 {% block content %}
c588255… ragelink 5 <h1 class="text-2xl font-bold text-gray-100 mb-2">{{ project.name }}</h1>
c588255… ragelink 6 {% include "fossil/_project_nav.html" %}
c588255… ragelink 7
c588255… ragelink 8 <div class="flex items-center justify-between mb-6">
c588255… ragelink 9 <h2 class="text-lg font-semibold text-gray-200">Webhooks</h2>
c588255… ragelink 10 <div class="flex items-center gap-3">
7e1aaf6… ragelink 11 <span class="search-wrap">
c588255… ragelink 12 <input type="search"
c588255… ragelink 13 name="search"
c588255… ragelink 14 value="{{ search }}"
c588255… ragelink 15 placeholder="Search webhooks..."
7e1aaf6… ragelink 16 aria-label="Search webhooks"
c588255… ragelink 17 class="rounded-md border-gray-700 bg-gray-800 text-gray-100 shadow-sm focus:border-brand focus:ring-brand text-sm px-3 py-1.5"
c588255… ragelink 18 hx-get="{% url 'fossil:webhooks' slug=project.slug %}"
c588255… ragelink 19 hx-trigger="input changed delay:300ms, search"
c588255… ragelink 20 hx-target="#webhook-content"
c588255… ragelink 21 hx-swap="innerHTML"
7e1aaf6… ragelink 22 hx-push-url="true"
7e1aaf6… ragelink 23 hx-indicator="closest .search-wrap" />
7e1aaf6… ragelink 24 <svg class="search-spinner animate-spin h-4 w-4" fill="none" viewBox="0 0 24 24"><circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle><path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"></path></svg>
7e1aaf6… ragelink 25 </span>
c588255… ragelink 26 <a href="{% url 'fossil:webhook_create' slug=project.slug %}"
c588255… ragelink 27 class="inline-flex items-center rounded-md bg-brand px-3 py-1.5 text-sm font-semibold text-white shadow-sm hover:bg-brand-hover">
c588255… ragelink 28 Add Webhook
c588255… ragelink 29 </a>
c588255… ragelink 30 </div>
c588255… ragelink 31 </div>
c588255… ragelink 32
c588255… ragelink 33 <div id="webhook-content">
c588255… ragelink 34 {% if webhooks %}
c588255… ragelink 35 <div class="space-y-3">
c588255… ragelink 36 {% for webhook in webhooks %}
c588255… ragelink 37 <div class="rounded-lg bg-gray-800 border border-gray-700">
c588255… ragelink 38 <div class="px-5 py-4">
c588255… ragelink 39 <div class="flex items-start justify-between gap-4">
c588255… ragelink 40 <div class="flex-1 min-w-0">
c588255… ragelink 41 <div class="flex items-center gap-3 mb-1">
c588255… ragelink 42 <span class="text-sm font-medium text-gray-100 truncate">{{ webhook.url }}</span>
c588255… ragelink 43 {% if webhook.is_active %}
c588255… ragelink 44 <span class="inline-flex rounded-full bg-green-900/50 px-2 py-0.5 text-xs font-semibold text-green-300">Active</span>
c588255… ragelink 45 {% else %}
c588255… ragelink 46 <span class="inline-flex rounded-full bg-gray-700 px-2 py-0.5 text-xs font-semibold text-gray-400">Inactive</span>
c588255… ragelink 47 {% endif %}
c588255… ragelink 48 </div>
c588255… ragelink 49 <div class="flex items-center gap-3 text-xs text-gray-500 mt-1">
c588255… ragelink 50 <span>Events: {{ webhook.events }}</span>
c588255… ragelink 51 <span>Created {{ webhook.created_at|timesince }} ago</span>
c588255… ragelink 52 {% with last=webhook.deliveries.first %}
c588255… ragelink 53 {% if last %}
c588255… ragelink 54 <span>Last delivery: {% if last.success %}<span class="text-green-400">{{ last.response_status }}</span>{% else %}<span class="text-red-400">{{ last.response_status|default:"failed" }}</span>{% endif %}</span>
c588255… ragelink 55 {% endif %}
c588255… ragelink 56 {% endwith %}
c588255… ragelink 57 </div>
c588255… ragelink 58 </div>
c588255… ragelink 59 <div class="flex items-center gap-2 flex-shrink-0">
c588255… ragelink 60 <a href="{% url 'fossil:webhook_deliveries' slug=project.slug webhook_id=webhook.pk %}"
c588255… ragelink 61 class="text-xs text-gray-400 hover:text-brand-light">Deliveries</a>
c588255… ragelink 62 <a href="{% url 'fossil:webhook_edit' slug=project.slug webhook_id=webhook.pk %}"
c588255… ragelink 63 class="text-xs text-gray-400 hover:text-brand-light">Edit</a>
c588255… ragelink 64 <form method="post" action="{% url 'fossil:webhook_delete' slug=project.slug webhook_id=webhook.pk %}"
c588255… ragelink 65 class="inline" onsubmit="return confirm('Delete this webhook?')">
c588255… ragelink 66 {% csrf_token %}
c588255… ragelink 67 <button type="submit" class="text-xs text-red-400 hover:text-red-300">Delete</button>
c588255… ragelink 68 </form>
c588255… ragelink 69 </div>
c588255… ragelink 70 </div>
c588255… ragelink 71 </div>
c588255… ragelink 72 </div>
c588255… ragelink 73 {% endfor %}
c588255… ragelink 74 </div>
c588255… ragelink 75 {% else %}
c588255… ragelink 76 <div class="rounded-lg bg-gray-800 border border-gray-700 p-8 text-center">
c588255… ragelink 77 <p class="text-sm text-gray-500">{% if search %}No webhooks matching "{{ search }}".{% else %}No webhooks configured.{% endif %}</p>
c588255… ragelink 78 {% if not search %}
c588255… ragelink 79 <a href="{% url 'fossil:webhook_create' slug=project.slug %}"
c588255… ragelink 80 class="mt-3 inline-flex items-center rounded-md bg-brand px-3 py-1.5 text-sm font-semibold text-white shadow-sm hover:bg-brand-hover">
c588255… ragelink 81 Add the first webhook
c588255… ragelink 82 </a>
c588255… ragelink 83 {% endif %}
c588255… ragelink 84 </div>
c588255… ragelink 85 {% endif %}
c588255… ragelink 86 {% include "includes/_pagination.html" %}
c588255… ragelink 87 </div>
c588255… ragelink 88 {% endblock %}

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button