From 3b2a8388c1b0ce6ce9f1e489bd1b82ec20331102 Mon Sep 17 00:00:00 2001 From: sysops Date: Mon, 6 Jul 2026 12:08:53 +0200 Subject: [PATCH] feat(PROJ-69): Admin-Dashboard Tab-Gruppierung (2-Ebenen-Navigation) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 17 flache Tabs unter /admin durch Gruppen-Leiste (Übersicht, Benutzer & Zugriff, Compliance, Mail-Eingang, System) ersetzt. Rollenbasierte Sichtbarkeit pro Tab unverändert, nur Navigation strukturiert. Co-Authored-By: Claude Sonnet 5 --- DEVLOG.md | 98 ++++++++++++++++++++++++++++++++ features/INDEX.md | 3 +- src/app/admin/page.tsx | 126 +++++++++++++++++++++++++++++++++-------- 3 files changed, 202 insertions(+), 25 deletions(-) diff --git a/DEVLOG.md b/DEVLOG.md index 8539904..382ac3e 100644 --- a/DEVLOG.md +++ b/DEVLOG.md @@ -8992,3 +8992,101 @@ Keine Commits in dieser Session. - features/PROJ-66-backup-strategie.md | 75 ++++++++++++++++++++++++++++++++++++++++++++- --- +## 2026-07-06 11:47 – 11:47 (0m) +**Beschreibung:** Claude Code Session +**Projekt:** archivmail + +### Commits +- 8bd02fa docs(PROJ-67,PROJ-68): Deployment-Status auf Deployed setzen + +### Geänderte Dateien +- DEVLOG.md | 829 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +- features/INDEX.md | 2 +- +- features/PROJ-67-manticore-upgrade-25-zu-27.md | 157 +++++++++++++++- +- features/PROJ-68-sudo-provisionierung-dienststeuerung.md | 111 ++++++++++- + +--- +## 2026-07-06 11:47 – 11:47 (0m) +**Beschreibung:** Claude Code Session +**Projekt:** archivmail + +### Commits +Keine Commits in dieser Session. + +### Geänderte Dateien +- DEVLOG.md | 829 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +- features/INDEX.md | 2 +- +- features/PROJ-67-manticore-upgrade-25-zu-27.md | 157 +++++++++++++++- +- features/PROJ-68-sudo-provisionierung-dienststeuerung.md | 111 ++++++++++- + +--- +## 2026-07-06 11:48 – 11:48 (0m) +**Beschreibung:** Claude Code Session +**Projekt:** archivmail + +### Commits +Keine Commits in dieser Session. + +### Geänderte Dateien +- DEVLOG.md | 829 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +- features/INDEX.md | 2 +- +- features/PROJ-67-manticore-upgrade-25-zu-27.md | 157 +++++++++++++++- +- features/PROJ-68-sudo-provisionierung-dienststeuerung.md | 111 ++++++++++- + +--- +## 2026-07-06 11:49 – 11:49 (0m) +**Beschreibung:** Claude Code Session +**Projekt:** archivmail + +### Commits +Keine Commits in dieser Session. + +### Geänderte Dateien +- DEVLOG.md | 829 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +- features/INDEX.md | 2 +- +- features/PROJ-67-manticore-upgrade-25-zu-27.md | 157 +++++++++++++++- +- features/PROJ-68-sudo-provisionierung-dienststeuerung.md | 111 ++++++++++- + +--- +## 2026-07-06 11:50 – 11:51 (0m) +**Beschreibung:** Claude Code Session +**Projekt:** archivmail + +### Commits +Keine Commits in dieser Session. + +### Geänderte Dateien +- DEVLOG.md | 829 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +- features/INDEX.md | 2 +- +- features/PROJ-67-manticore-upgrade-25-zu-27.md | 157 +++++++++++++++- +- features/PROJ-68-sudo-provisionierung-dienststeuerung.md | 111 ++++++++++- + +--- +## 2026-07-06 11:52 – 12:03 (10m) +**Beschreibung:** Claude Code Session +**Projekt:** archivmail + +### Commits +Keine Commits in dieser Session. + +### Geänderte Dateien +- DEVLOG.md | 829 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +- features/INDEX.md | 2 +- +- features/PROJ-67-manticore-upgrade-25-zu-27.md | 157 +++++++++++++++- +- features/PROJ-68-sudo-provisionierung-dienststeuerung.md | 111 ++++++++++- + +--- +## 2026-07-06 12:04 – 12:08 (4m) +**Beschreibung:** Claude Code Session +**Projekt:** archivmail + +### Commits +Keine Commits in dieser Session. + +### Geänderte Dateien +- DEVLOG.md | 829 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +- features/INDEX.md | 2 +- +- features/PROJ-67-manticore-upgrade-25-zu-27.md | 157 +++++++++++++++- +- features/PROJ-68-sudo-provisionierung-dienststeuerung.md | 111 ++++++++++- + +--- diff --git a/features/INDEX.md b/features/INDEX.md index b71d07a..51c5cf9 100644 --- a/features/INDEX.md +++ b/features/INDEX.md @@ -84,7 +84,8 @@ | PROJ-66 | Backup-Strategie für Store, Keyfile, PostgreSQL (Produktiv + Teilproduktiv) | Deployed | [PROJ-66](PROJ-66-backup-strategie.md) | 2026-07-04 | | PROJ-67 | Manticore Search Upgrade 25.0.0 → 27.1.5 + Auto-Upgrade-Pfad | Deployed | [PROJ-67](PROJ-67-manticore-upgrade-25-zu-27.md) | 2026-07-05 | | PROJ-68 | sudo-Provisionierung für Admin-Dienststeuerung fehlte komplett | Deployed | [PROJ-68](PROJ-68-sudo-provisionierung-dienststeuerung.md) | 2026-07-05 | +| PROJ-69 | Admin-Dashboard Tab-Gruppierung (2-Ebenen-Navigation) | Planned | [PROJ-69](PROJ-69-admin-tabs-gruppierung.md) | 2026-07-06 | -## Next Available ID: PROJ-69 +## Next Available ID: PROJ-70 diff --git a/src/app/admin/page.tsx b/src/app/admin/page.tsx index 2c4ac98..2945b7f 100644 --- a/src/app/admin/page.tsx +++ b/src/app/admin/page.tsx @@ -1,6 +1,6 @@ "use client"; -import { useEffect } from "react"; +import { useEffect, useMemo, useState } from "react"; import { useAuth } from "@/hooks/useAuth"; import { useLDAPConfig } from "@/hooks/useLDAPConfig"; import { useTenantLDAPConfig } from "@/hooks/useTenantLDAPConfig"; @@ -135,6 +135,84 @@ export default function AdminPage() { loadServices(); }, [user, loadUsers, loadAudit, loadServices]); + const tabGroups = useMemo( + () => [ + { + id: "overview", + label: "Übersicht", + tabs: [ + { value: "dashboard", label: "Dashboard", visible: true }, + { value: "services", label: "Dienste", visible: isSuperAdmin }, + ], + }, + { + id: "users", + label: "Benutzer & Zugriff", + tabs: [ + { value: "users", label: "Benutzer", visible: true }, + { value: "ldap", label: "LDAP (Global)", visible: isSuperAdmin, onClick: loadLDAP }, + { + value: "tenant-ldap", + label: "LDAP", + visible: !isSuperAdmin && user?.role === "domain_admin", + onClick: loadTenantLDAP, + }, + { value: "tenants", label: "Mandanten", visible: isSuperAdmin, onClick: tenantsState.loadTenants }, + ], + }, + { + id: "compliance", + label: "Compliance", + tabs: [ + { value: "audit", label: "Audit-Log", visible: true }, + { value: "dsgvo", label: "DSGVO-Anfragen", visible: canViewDSGVO }, + { value: "retention", label: "Retention", visible: isSuperAdmin }, + { value: "archiving-rules", label: "Regeln", visible: isSuperAdmin }, + ], + }, + { + id: "mail", + label: "Mail-Eingang", + tabs: [ + { value: "import", label: "Import", visible: true }, + { value: "imap-settings", label: "IMAP", visible: !isSuperAdmin }, + { value: "routing-rules", label: "Routing-Regeln", visible: true }, + { value: "smtp-out", label: "SMTP-Out", visible: isSuperAdmin }, + { value: "quotas", label: "Quotas", visible: isSuperAdmin }, + ], + }, + { + id: "system", + label: "System", + tabs: [ + { value: "security", label: "Security", visible: isSuperAdmin }, + { value: "cert", label: "Zertifikat", visible: isSuperAdmin, onClick: cert.loadCert }, + { value: "modules", label: "Module", visible: isSuperAdmin }, + ], + }, + ], + [isSuperAdmin, canViewDSGVO, user?.role, loadLDAP, loadTenantLDAP, tenantsState.loadTenants, cert.loadCert] + ); + + const visibleGroups = tabGroups + .map((g) => ({ ...g, tabs: g.tabs.filter((t) => t.visible) })) + .filter((g) => g.tabs.length > 0); + + const [activeGroupId, setActiveGroupId] = useState(visibleGroups[0]?.id ?? "overview"); + const [activeTab, setActiveTab] = useState(visibleGroups[0]?.tabs[0]?.value ?? "dashboard"); + + const activeGroup = visibleGroups.find((g) => g.id === activeGroupId) ?? visibleGroups[0]; + + function handleGroupChange(groupId: string) { + setActiveGroupId(groupId); + const group = visibleGroups.find((g) => g.id === groupId); + const firstTab = group?.tabs[0]; + if (firstTab) { + setActiveTab(firstTab.value); + firstTab.onClick?.(); + } + } + return (
@@ -148,30 +226,30 @@ export default function AdminPage() { ) : (<>

Administration

- +
+ {visibleGroups.map((g) => ( + + ))} +
+ + - Dashboard - {isSuperAdmin && Dienste} - Benutzer - Audit-Log - {canViewDSGVO && DSGVO-Anfragen} - Import - {isSuperAdmin && LDAP (Global)} - {!isSuperAdmin && user?.role === "domain_admin" && ( - LDAP - )} - {!isSuperAdmin && user?.role === "domain_admin" && ( - IMAP - )} - {isSuperAdmin && Security} - {isSuperAdmin && Zertifikat} - {isSuperAdmin && Mandanten} - {isSuperAdmin && Retention} - {isSuperAdmin && Regeln} - Routing-Regeln - {isSuperAdmin && Quotas} - {isSuperAdmin && SMTP-Out} - {isSuperAdmin && Module} + {activeGroup?.tabs.map((t) => ( + + {t.label} + + ))}