🌐 i18n(translation): add archive-related translations
- add new translation keys for archive feature in both German and English
✨ feat(server): implement archived servers feature
- create endpoints for listing and restoring archived servers
- add HTML template for displaying archived servers
- update navigation to include archived servers link
This commit is contained in:
parent
c6a2ed928b
commit
d0622ae361
4 changed files with 138 additions and 0 deletions
|
|
@ -63,6 +63,9 @@
|
|||
<a href="/map" class="text-slate-300 hover:text-white underline-offset-2 hover:underline">
|
||||
{{ t("nav.map") }}
|
||||
</a>
|
||||
<a href="/servers/archived" class="text-slate-300 hover:text-white underline-offset-2 hover:underline">
|
||||
{{ t("nav.archive") }}
|
||||
</a>
|
||||
<a
|
||||
href="/servers/new"
|
||||
class="inline-flex items-center gap-1 rounded-lg bg-indigo-500 px-3 py-1.5 font-medium hover:bg-indigo-400 focus:outline-none focus:ring focus:ring-indigo-500/40"
|
||||
|
|
|
|||
73
app/templates/servers_archived.html
Normal file
73
app/templates/servers_archived.html
Normal file
|
|
@ -0,0 +1,73 @@
|
|||
{% extends "base.html" %}
|
||||
{% block content %}
|
||||
<div class="flex flex-col gap-4">
|
||||
<div class="flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3">
|
||||
<div>
|
||||
<h1 class="text-lg font-semibold tracking-tight">{{ t("archive.title") }}</h1>
|
||||
<p class="text-xs text-slate-400">
|
||||
{{ t("archive.subtitle") }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% if servers %}
|
||||
<div class="overflow-hidden rounded-xl border border-slate-800 bg-slate-900/60">
|
||||
<table class="min-w-full text-sm">
|
||||
<thead class="bg-slate-900/80">
|
||||
<tr class="text-xs uppercase tracking-wide text-slate-400">
|
||||
<th class="px-3 py-2 text-left">{{ t("table.name") }}</th>
|
||||
<th class="px-3 py-2 text-left">{{ t("table.provider") }}</th>
|
||||
<th class="px-3 py-2 text-left">{{ t("table.type") }}</th>
|
||||
<th class="px-3 py-2 text-left">{{ t("table.location") }}</th>
|
||||
<th class="px-3 py-2 text-left">{{ t("table.ipv4") }}</th>
|
||||
<th class="px-3 py-2 text-right">{{ t("table.action") }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for s in servers %}
|
||||
<tr class="border-t border-slate-800/80 hover:bg-slate-800/50">
|
||||
<td class="px-3 py-2">
|
||||
<div class="flex items-center gap-2">
|
||||
<div>
|
||||
<span class="text-slate-100 font-medium">{{ s.name }}</span>
|
||||
{% if s.hostname %}
|
||||
<div class="text-[11px] text-slate-400">{{ s.hostname }}</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td class="px-3 py-2 text-slate-200">{{ s.provider }}</td>
|
||||
<td class="px-3 py-2">
|
||||
<span class="inline-flex rounded-full bg-slate-800 px-2 py-0.5 text-[11px] text-slate-300">
|
||||
{{ s.type }}
|
||||
</span>
|
||||
</td>
|
||||
<td class="px-3 py-2 text-slate-200">
|
||||
{% if s.location %}{{ s.location }}{% else %}<span class="text-slate-500">–</span>{% endif %}
|
||||
</td>
|
||||
<td class="px-3 py-2 text-slate-200">
|
||||
{% if s.ipv4 %}{{ s.ipv4 }}{% else %}<span class="text-slate-500">–</span>{% endif %}
|
||||
</td>
|
||||
<td class="px-3 py-2 text-right text-slate-200">
|
||||
<form method="post" action="/servers/{{ s.id }}/unarchive">
|
||||
<input type="hidden" name="csrf_token" value="{{ csrf_token }}" />
|
||||
<button
|
||||
type="submit"
|
||||
class="text-emerald-200 hover:text-emerald-100 underline text-xs"
|
||||
>
|
||||
{{ t("archive.restore") }}
|
||||
</button>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="rounded-xl border border-dashed border-slate-700 bg-slate-900/40 p-6 text-sm text-slate-300">
|
||||
{{ t("archive.empty") }}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
Loading…
Add table
Add a link
Reference in a new issue