FossilRepo

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

Keyboard Shortcuts

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