Reapply "Add missing admin action files and navigation links"

This reverts commit 4d515bc400.
This commit is contained in:
Simo committed 2026-07-11 20:52:56 +02:00
1 parent 96ed768f14
commit 5b4228261a
338 files changed
+28143 -5948

No files matched your search

+20 -12
View File
@@ -90,9 +90,7 @@ export default async function AdminRadioApiKeysPage() {
{dbError ? (
<div className="admin-card" style={{ marginTop: "1rem" }}>
<p className="text-xs text-gray-500 dark:text-gray-400 m-0">
{t("apiKeysForm.dbError")}
</p>
<p className="text-xs text-gray-500 dark:text-gray-400 m-0">{t("apiKeysForm.dbError")}</p>
</div>
) : (
<div className="grid grid-cols-[repeat(auto-fit,minmax(180px,1fr))] gap-3.5 mb-6">
@@ -115,9 +113,7 @@ export default async function AdminRadioApiKeysPage() {
<section className="mt-6">
<h2>{t("apiKeysForm.generateKey")}</h2>
<p className="text-xs text-gray-500 dark:text-gray-400">
{t("apiKeysForm.generateHint")}
</p>
<p className="text-xs text-gray-500 dark:text-gray-400">{t("apiKeysForm.generateHint")}</p>
<form action={createApiKey} className="admin-card">
<div className="grid grid-cols-1 gap-4 md:grid-cols-2">
<div>
@@ -190,17 +186,29 @@ export default async function AdminRadioApiKeysPage() {
<tbody>
{keys.map((k) => (
<tr key={String(k.id)}>
<td className="text-sm text-gray-500 dark:text-gray-400 whitespace-nowrap">{String(k.id)}</td>
<td className="text-sm text-gray-500 dark:text-gray-400 whitespace-nowrap">
{String(k.id)}
</td>
<td>{k.name}</td>
<td>
<code title={t("apiKeysForm.maskedHint")}>{maskKey(k.key)}</code>
</td>
<td className="text-sm text-gray-500 dark:text-gray-400 whitespace-nowrap">{k.allowedIps || t("apiKeysForm.any")}</td>
<td className="text-sm text-gray-500 dark:text-gray-400 whitespace-nowrap">{k.rateLimit}/min</td>
<td className="text-sm text-gray-500 dark:text-gray-400 whitespace-nowrap">{formatDate(k.lastUsedAt)}</td>
<td className="text-sm text-gray-500 dark:text-gray-400 whitespace-nowrap">{formatDate(k.expiresAt)}</td>
<td className="text-sm text-gray-500 dark:text-gray-400 whitespace-nowrap">
{k.allowedIps || t("apiKeysForm.any")}
</td>
<td className="text-sm text-gray-500 dark:text-gray-400 whitespace-nowrap">
{k.rateLimit}/min
</td>
<td className="text-sm text-gray-500 dark:text-gray-400 whitespace-nowrap">
{formatDate(k.lastUsedAt)}
</td>
<td className="text-sm text-gray-500 dark:text-gray-400 whitespace-nowrap">
{formatDate(k.expiresAt)}
</td>
<td>
<span className={`inline-block text-[0.72rem] font-bold px-2 py-0.5 rounded-full ${k.isActive ? "bg-green-600/20 text-[var(--color-text)]" : "bg-red-500/22 text-[var(--color-text)]"}`}>
<span
className={`inline-block text-[0.72rem] font-bold px-2 py-0.5 rounded-full ${k.isActive ? "bg-green-600/20 text-[var(--color-text)]" : "bg-red-500/22 text-[var(--color-text)]"}`}
>
{k.isActive ? t("apiKeysForm.activeLabel") : t("apiKeysForm.inactiveLabel")}
</span>
</td>