feat(cms): add storage based website content management
This commit is contained in:
parent
7d5689cfa4
commit
12d31f5468
31 changed files with 1347 additions and 158 deletions
|
|
@ -3,6 +3,7 @@ import AdminShell from "@/components/admin/AdminShell";
|
|||
import { requireAdminSession } from "@/lib/admin/auth";
|
||||
import { adminConfigurationStatus, appVersion, checkStorage, configDirectory, dataDirectory, isDockerEnvironment, olympusStatus, uploadDirectory } from "@/lib/runtime/config";
|
||||
import { getSmtpSettings, isSmtpConfigured } from "@/lib/mail/config";
|
||||
import { getContentSystemStatus } from "@/lib/content/service";
|
||||
|
||||
export default async function AdminSystemPage() {
|
||||
if (!await requireAdminSession()) redirect("/admin/login");
|
||||
|
|
@ -13,7 +14,7 @@ export default async function AdminSystemPage() {
|
|||
} catch {
|
||||
storage = "error";
|
||||
}
|
||||
const smtpSettings = await getSmtpSettings();
|
||||
const [smtpSettings, contentStatus] = await Promise.all([getSmtpSettings(), getContentSystemStatus()]);
|
||||
const smtpConfigured = isSmtpConfigured(smtpSettings);
|
||||
|
||||
return (
|
||||
|
|
@ -37,6 +38,10 @@ export default async function AdminSystemPage() {
|
|||
<div><dt>SMTP</dt><dd>{smtpConfigured ? "configured" : "missing"}</dd></div>
|
||||
<div><dt>Letzte SMTP-Testmail</dt><dd>{smtpSettings.lastTestAt ? `${new Date(smtpSettings.lastTestAt).toLocaleString("de-DE")} (${smtpSettings.lastTestStatus})` : "keine"}</dd></div>
|
||||
<div><dt>Letzter SMTP-Formularversand</dt><dd>{smtpSettings.lastDeliveryAt ? `${new Date(smtpSettings.lastDeliveryAt).toLocaleString("de-DE")} (${smtpSettings.lastDeliveryStatus})` : "keiner"}</dd></div>
|
||||
<div><dt>Content Version</dt><dd>{contentStatus.version}</dd></div>
|
||||
<div><dt>Letzte Content-Änderung</dt><dd>{contentStatus.lastModified ? new Date(contentStatus.lastModified).toLocaleString("de-DE") : "keine"}</dd></div>
|
||||
<div><dt>Anzahl Seiten</dt><dd>{contentStatus.pageCount}</dd></div>
|
||||
<div><dt>Anzahl Medien</dt><dd>{contentStatus.mediaCount}</dd></div>
|
||||
</dl>
|
||||
</section>
|
||||
<section className="admin-card">
|
||||
|
|
|
|||
|
|
@ -1,18 +1,13 @@
|
|||
import { redirect } from "next/navigation";
|
||||
import AdminShell from "@/components/admin/AdminShell";
|
||||
import ContentManager from "@/components/admin/ContentManager";
|
||||
import { requireAdminSession } from "@/lib/admin/auth";
|
||||
|
||||
const editablePages = [
|
||||
["Startseite", "Hero, Vorteile, Textblöcke"],
|
||||
["Leistungen", "Funktechnik, Messtechnik, Servicebereiche"],
|
||||
["Funkgeräte-Service", "Diagnose, Abgleich, Fehlerbilder"],
|
||||
["Reparatur", "Reparaturannahme und Hinweise"],
|
||||
["Über uns", "Profil und Werkstattbeschreibung"],
|
||||
["Kontakt", "Kontakttext und Hinweise"],
|
||||
] as const;
|
||||
import { listMediaFiles } from "@/lib/admin/media";
|
||||
import { getAllContent } from "@/lib/content/service";
|
||||
|
||||
export default async function AdminWebsitePage() {
|
||||
if (!await requireAdminSession()) redirect("/admin/login");
|
||||
const [content, mediaFiles] = await Promise.all([getAllContent(), listMediaFiles()]);
|
||||
|
||||
return (
|
||||
<AdminShell>
|
||||
|
|
@ -20,19 +15,7 @@ export default async function AdminWebsitePage() {
|
|||
<p className="eyebrow">Website</p>
|
||||
<h1>Website-Inhalte</h1>
|
||||
</div>
|
||||
<section className="admin-card">
|
||||
<h2>Editierbare Inhalte</h2>
|
||||
<p className="admin-muted">Diese Foundation bereitet die Inhaltsverwaltung vor. Die öffentliche Website bleibt bis zur finalen Publishing-Funktion weiterhin quellcodebasiert.</p>
|
||||
<div className="admin-detail-grid">
|
||||
{editablePages.map(([title, description]) => (
|
||||
<article key={title} className="admin-detail">
|
||||
<h3>{title}</h3>
|
||||
<p>{description}</p>
|
||||
<button className="button light" type="button" disabled>Bearbeiten vorbereitet</button>
|
||||
</article>
|
||||
))}
|
||||
</div>
|
||||
</section>
|
||||
<ContentManager initialContent={content} mediaFiles={mediaFiles} />
|
||||
</AdminShell>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue