From 05f6d61cea52f833f26e265da35e68ef7e3469b7 Mon Sep 17 00:00:00 2001
From: Linus Rath <139418639+rathlinus@users.noreply.github.com>
Date: Wed, 25 Mar 2026 10:58:05 +0100
Subject: [PATCH] feat: reorganize admin layout and enhance dashboard with
settings sections
---
app/admin/layout.tsx | 121 ++++++++++++++++++---------
app/admin/page.tsx | 194 +++++++++++++++++--------------------------
2 files changed, 161 insertions(+), 154 deletions(-)
diff --git a/app/admin/layout.tsx b/app/admin/layout.tsx
index c7eb1734..7c2c1f1a 100644
--- a/app/admin/layout.tsx
+++ b/app/admin/layout.tsx
@@ -19,15 +19,35 @@ import { cn } from '@/lib/utils';
import { useConfig } from '@/hooks/use-config';
import { useThemeStore } from '@/stores/theme-store';
-const NAV_ITEMS = [
- { href: '/admin', label: 'Dashboard', icon: LayoutDashboard },
- { href: '/admin/settings', label: 'Settings', icon: Settings },
- { href: '/admin/branding', label: 'Branding', icon: Palette },
- { href: '/admin/auth', label: 'Authentication', icon: Shield },
- { href: '/admin/policy', label: 'Policy', icon: Scale },
- { href: '/admin/plugins', label: 'Plugins', icon: Puzzle },
- { href: '/admin/themes', label: 'Themes', icon: SwatchBook },
- { href: '/admin/logs', label: 'Audit Log', icon: ScrollText },
+const NAV_GROUPS = [
+ {
+ label: 'Overview',
+ items: [
+ { href: '/admin', label: 'Dashboard', icon: LayoutDashboard },
+ ],
+ },
+ {
+ label: 'Configuration',
+ items: [
+ { href: '/admin/settings', label: 'Settings', icon: Settings },
+ { href: '/admin/branding', label: 'Branding', icon: Palette },
+ { href: '/admin/auth', label: 'Authentication', icon: Shield },
+ { href: '/admin/policy', label: 'Policy', icon: Scale },
+ ],
+ },
+ {
+ label: 'Extensions',
+ items: [
+ { href: '/admin/plugins', label: 'Plugins', icon: Puzzle },
+ { href: '/admin/themes', label: 'Themes', icon: SwatchBook },
+ ],
+ },
+ {
+ label: 'System',
+ items: [
+ { href: '/admin/logs', label: 'Audit Log', icon: ScrollText },
+ ],
+ },
];
export default function AdminLayout({ children }: { children: React.ReactNode }) {
@@ -41,9 +61,11 @@ export default function AdminLayout({ children }: { children: React.ReactNode })
: (appLogoLightUrl || appLogoDarkUrl || loginLogoLightUrl);
useEffect(() => {
- checkAuth();
+ if (pathname !== '/admin/login') {
+ checkAuth();
+ }
// eslint-disable-next-line react-hooks/exhaustive-deps
- }, []);
+ }, [pathname]);
async function checkAuth() {
try {
@@ -84,8 +106,8 @@ export default function AdminLayout({ children }: { children: React.ReactNode })
return (
{/* Sidebar */}
-