FossilRepo
| c588255… | ragelink | 1 | {% extends "base.html" %} |
| c588255… | ragelink | 2 | {% block title %}SSH Keys — Fossilrepo{% endblock %} |
| c588255… | ragelink | 3 | |
| c588255… | ragelink | 4 | {% block content %} |
| 0e40dc2… | ragelink | 5 | <div class="mb-4"> |
| 0e40dc2… | ragelink | 6 | <a href="{% url 'accounts:profile' %}" class="text-sm text-brand-light hover:text-brand">← Back to Profile</a> |
| 0e40dc2… | ragelink | 7 | </div> |
| c588255… | ragelink | 8 | <h1 class="text-2xl font-bold text-gray-100 mb-6">SSH Keys</h1> |
| c588255… | ragelink | 9 | |
| c588255… | ragelink | 10 | <div class="rounded-lg bg-gray-800 border border-gray-700 p-6 mb-6"> |
| c588255… | ragelink | 11 | <h2 class="text-lg font-semibold text-gray-200 mb-4">Add SSH Key</h2> |
| c588255… | ragelink | 12 | <form method="post" class="space-y-4"> |
| c588255… | ragelink | 13 | {% csrf_token %} |
| c588255… | ragelink | 14 | <div> |
| c588255… | ragelink | 15 | <label for="title" class="block text-sm font-medium text-gray-300 mb-1">Title</label> |
| c588255… | ragelink | 16 | <input type="text" name="title" id="title" required placeholder="e.g. Work laptop" |
| c588255… | ragelink | 17 | 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"> |
| c588255… | ragelink | 18 | </div> |
| c588255… | ragelink | 19 | <div> |
| c588255… | ragelink | 20 | <label for="public_key" class="block text-sm font-medium text-gray-300 mb-1">Public Key</label> |
| c588255… | ragelink | 21 | <textarea name="public_key" id="public_key" rows="4" required |
| c588255… | ragelink | 22 | placeholder="ssh-ed25519 AAAA... user@host" |
| c588255… | ragelink | 23 | 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"></textarea> |
| c588255… | ragelink | 24 | <p class="mt-1 text-xs text-gray-500">Paste your public key (usually from ~/.ssh/id_ed25519.pub)</p> |
| c588255… | ragelink | 25 | </div> |
| c588255… | ragelink | 26 | <button type="submit" class="rounded-md bg-brand px-4 py-2 text-sm font-semibold text-white hover:bg-brand-hover"> |
| c588255… | ragelink | 27 | Add Key |
| c588255… | ragelink | 28 | </button> |
| c588255… | ragelink | 29 | </form> |
| c588255… | ragelink | 30 | </div> |
| c588255… | ragelink | 31 | |
| c588255… | ragelink | 32 | {% if keys %} |
| c588255… | ragelink | 33 | <div class="rounded-lg bg-gray-800 border border-gray-700"> |
| c588255… | ragelink | 34 | <div class="p-4 border-b border-gray-700"> |
| c588255… | ragelink | 35 | <h2 class="text-lg font-semibold text-gray-200">Your Keys</h2> |
| c588255… | ragelink | 36 | </div> |
| c588255… | ragelink | 37 | <div class="divide-y divide-gray-700"> |
| c588255… | ragelink | 38 | {% for key in keys %} |
| c588255… | ragelink | 39 | <div class="p-4 flex items-center justify-between"> |
| c588255… | ragelink | 40 | <div> |
| c588255… | ragelink | 41 | <div class="text-sm font-medium text-gray-200">{{ key.title }}</div> |
| c588255… | ragelink | 42 | <div class="text-xs text-gray-500 font-mono mt-1">{{ key.fingerprint }}</div> |
| c588255… | ragelink | 43 | <div class="text-xs text-gray-500 mt-1"> |
| c588255… | ragelink | 44 | {{ key.key_type|upper }} · Added {{ key.created_at|timesince }} ago |
| c588255… | ragelink | 45 | {% if key.last_used_at %}· Last used {{ key.last_used_at|timesince }} ago{% endif %} |
| c588255… | ragelink | 46 | </div> |
| c588255… | ragelink | 47 | </div> |
| c588255… | ragelink | 48 | <form hx-post="{% url 'accounts:ssh_key_delete' pk=key.pk %}" hx-confirm="Delete SSH key '{{ key.title }}'?"> |
| c588255… | ragelink | 49 | {% csrf_token %} |
| c588255… | ragelink | 50 | <button type="submit" class="text-sm text-red-400 hover:text-red-300">Delete</button> |
| c588255… | ragelink | 51 | </form> |
| c588255… | ragelink | 52 | </div> |
| c588255… | ragelink | 53 | {% endfor %} |
| c588255… | ragelink | 54 | </div> |
| c588255… | ragelink | 55 | </div> |
| c588255… | ragelink | 56 | {% else %} |
| c588255… | ragelink | 57 | <div class="text-center py-12 text-gray-500"> |
| c588255… | ragelink | 58 | <p class="text-sm">No SSH keys added yet.</p> |
| c588255… | ragelink | 59 | <p class="text-xs mt-1">Add an SSH key to clone and push Fossil repos over SSH.</p> |
| c588255… | ragelink | 60 | </div> |
| c588255… | ragelink | 61 | {% endif %} |
| c588255… | ragelink | 62 | {% endblock %} |