feat: settings and deploy docs

This commit is contained in:
opencode committed 2026-10-18 10:36:43 +02:00
1 parent 8b33242db1
commit 39f782057c
10 files changed
+194

No files matched your search

+39
View File
@@ -0,0 +1,39 @@
import Link from "next/link";
import { getDb } from "@/lib/db";
import { DEFAULT_TAGE_VORHER } from "@/lib/settings";
import { TestButtons } from "./test-buttons";
export const dynamic = "force-dynamic";
export default async function SettingsPage() {
const db = getDb();
const last = await db.notificationLog.findFirst({ orderBy: { sentAt: "desc" } });
return (
<main className="mx-auto max-w-xl space-y-4 p-6">
<Link href="/" className="text-sm underline">← Zurück</Link>
<h1 className="text-xl font-bold">Einstellungen</h1>
<section className="rounded border p-4">
<h2 className="font-medium">Standard-Erinnerungstage</h2>
<p className="text-sm text-gray-600">Neue Gutscheine erhalten diese Erinnerungsregeln: {DEFAULT_TAGE_VORHER.join(", ")} Tage vorher.</p>
</section>
<TestButtons />
<section className="rounded border p-4 text-sm">
<h2 className="font-medium">Letzter Cron-Lauf</h2>
{last ? (
<p>
{last.sentAt.toLocaleString("de-DE")} · {last.kanal} an {last.empfaenger} · {last.status}
{last.fehler ? ` · Fehler: ${last.fehler}` : ""}
</p>
) : (
<p>Noch keine Benachrichtigung versendet.</p>
)}
</section>
<section className="rounded border p-4 text-sm text-gray-600">
<h2 className="font-medium text-black">Konfiguration (.env)</h2>
<p>SMTP_HOST, SMTP_PORT, SMTP_USER, SMTP_PASS, MAIL_FROM, TELEGRAM_BOT_TOKEN, CRON_SECRET, APP_URL.</p>
<h2 className="mt-2 font-medium text-black">Backup</h2>
<p>SQLite-Datei sichern: Volume <code>gutschein-data</code> bzw. Datei <code>/data/gutscheine.db</code> regelmäßig kopieren.</p>
</section>
</main>
);
}