|
1
|
{% extends "base.html" %} |
|
2
|
{% block title %}Shunned Artifacts — {{ 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">Shunned Artifacts</h2> |
|
10
|
</div> |
|
11
|
|
|
12
|
<div class="rounded-lg bg-red-900/20 border border-red-800/50 p-4 mb-6"> |
|
13
|
<div class="flex items-start gap-3"> |
|
14
|
<svg class="w-5 h-5 text-red-400 flex-shrink-0 mt-0.5" fill="none" stroke="currentColor" viewBox="0 0 24 24"> |
|
15
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L4.082 16.5c-.77.833.192 2.5 1.732 2.5z"/> |
|
16
|
</svg> |
|
17
|
<div> |
|
18
|
<h3 class="text-sm font-semibold text-red-300">Irreversible Operation</h3> |
|
19
|
<p class="text-xs text-red-400 mt-1"> |
|
20
|
Shunning permanently removes an artifact from the repository. This cannot be undone. |
|
21
|
Shunned artifacts are expunged from the database and will not be recovered through sync. |
|
22
|
Use this for spam, accidentally committed secrets, or legal compliance. |
|
23
|
</p> |
|
24
|
</div> |
|
25
|
</div> |
|
26
|
</div> |
|
27
|
|
|
28
|
<div class="rounded-lg bg-gray-800 border border-gray-700 p-6 mb-6" x-data="{ showForm: false, artifactUuid: '', confirmation: '' }"> |
|
29
|
<div class="flex items-center justify-between mb-4"> |
|
30
|
<h3 class="text-base font-semibold text-gray-200">Shun an Artifact</h3> |
|
31
|
<button @click="showForm = !showForm" |
|
32
|
class="text-sm text-brand-light hover:text-brand" |
|
33
|
x-text="showForm ? 'Cancel' : 'Shun New Artifact'"></button> |
|
34
|
</div> |
|
35
|
|
|
36
|
<form method="post" action="{% url 'fossil:shun_artifact' slug=project.slug %}" |
|
37
|
x-show="showForm" x-transition class="space-y-4"> |
|
38
|
{% csrf_token %} |
|
39
|
<div> |
|
40
|
<label for="artifact_uuid" class="block text-sm font-medium text-gray-300 mb-1">Artifact UUID (SHA hash)</label> |
|
41
|
<input type="text" name="artifact_uuid" id="artifact_uuid" required |
|
42
|
x-model="artifactUuid" |
|
43
|
placeholder="e.g. a1b2c3d4e5f6..." |
|
44
|
pattern="[0-9a-fA-F]{4,64}" |
|
45
|
title="Must be a hex hash (4-64 characters)" |
|
46
|
class="w-full rounded-md border-gray-600 bg-gray-900 text-gray-100 text-sm font-mono px-3 py-2 focus:border-brand focus:ring-brand"> |
|
47
|
</div> |
|
48
|
<div> |
|
49
|
<label for="reason" class="block text-sm font-medium text-gray-300 mb-1">Reason (optional)</label> |
|
50
|
<input type="text" name="reason" id="reason" |
|
51
|
placeholder="e.g. Accidentally committed API key" |
|
52
|
class="w-full rounded-md border-gray-600 bg-gray-900 text-gray-100 text-sm px-3 py-2 focus:border-brand focus:ring-brand"> |
|
53
|
</div> |
|
54
|
<div class="rounded-md bg-red-900/30 border border-red-700/50 p-3"> |
|
55
|
<label for="confirmation" class="block text-sm font-medium text-red-300 mb-1"> |
|
56
|
Type the first 8 characters of the UUID to confirm: |
|
57
|
<span class="font-mono text-red-200" x-text="artifactUuid.slice(0, 8).toLowerCase() || '________'"></span> |
|
58
|
</label> |
|
59
|
<input type="text" name="confirmation" id="confirmation" required |
|
60
|
x-model="confirmation" |
|
61
|
placeholder="Type to confirm..." |
|
62
|
class="w-full rounded-md border-red-700/50 bg-gray-900 text-gray-100 text-sm font-mono px-3 py-2 focus:border-red-500 focus:ring-red-500"> |
|
63
|
</div> |
|
64
|
<button type="submit" |
|
65
|
class="rounded-md bg-red-600 px-4 py-2 text-sm font-semibold text-white hover:bg-red-700" |
|
66
|
:disabled="confirmation.toLowerCase() !== artifactUuid.slice(0, 8).toLowerCase() || artifactUuid.length < 4"> |
|
67
|
Permanently Shun Artifact |
|
68
|
</button> |
|
69
|
</form> |
|
70
|
</div> |
|
71
|
|
|
72
|
{% if shunned %} |
|
73
|
<div class="rounded-lg bg-gray-800 border border-gray-700"> |
|
74
|
<div class="p-4 border-b border-gray-700"> |
|
75
|
<h3 class="text-base font-semibold text-gray-200">Currently Shunned ({{ shunned|length }})</h3> |
|
76
|
</div> |
|
77
|
<div class="divide-y divide-gray-700"> |
|
78
|
{% for uuid in shunned %} |
|
79
|
<div class="px-4 py-3"> |
|
80
|
<span class="text-sm font-mono text-gray-300">{{ uuid }}</span> |
|
81
|
</div> |
|
82
|
{% endfor %} |
|
83
|
</div> |
|
84
|
</div> |
|
85
|
{% else %} |
|
86
|
<div class="rounded-lg bg-gray-800 border border-gray-700 p-8 text-center"> |
|
87
|
<p class="text-sm text-gray-500">No artifacts have been shunned in this repository.</p> |
|
88
|
</div> |
|
89
|
{% endif %} |
|
90
|
{% endblock %} |
|
91
|
|