diff --git a/frontend/src/components/Layout.tsx b/frontend/src/components/Layout.tsx index 4ecaa19c..fdc3599e 100644 --- a/frontend/src/components/Layout.tsx +++ b/frontend/src/components/Layout.tsx @@ -7,7 +7,7 @@ import { useAuth } from '../hooks/useAuth' import { checkHealth } from '../api/health' import NotificationCenter from './NotificationCenter' import SystemStatus from './SystemStatus' -import { Menu } from 'lucide-react' +import { Menu, ChevronDown, ChevronRight } from 'lucide-react' interface LayoutProps { children: ReactNode @@ -20,12 +20,21 @@ export default function Layout({ children }: LayoutProps) { const saved = localStorage.getItem('sidebarCollapsed') return saved ? JSON.parse(saved) : false }) + const [expandedMenus, setExpandedMenus] = useState([]) const { logout, user } = useAuth() useEffect(() => { localStorage.setItem('sidebarCollapsed', JSON.stringify(isCollapsed)) }, [isCollapsed]) + const toggleMenu = (name: string) => { + setExpandedMenus(prev => + prev.includes(name) + ? prev.filter(item => item !== name) + : [...prev, name] + ) + } + const { data: health } = useQuery({ queryKey: ['health'], queryFn: checkHealth, @@ -41,6 +50,7 @@ export default function Layout({ children }: LayoutProps) { { name: 'Import Caddyfile', path: '/import', icon: '📥' }, { name: 'Settings', + path: '/settings', icon: '⚙️', children: [ { name: 'System', path: '/settings/system', icon: '⚙️' }, @@ -49,6 +59,7 @@ export default function Layout({ children }: LayoutProps) { }, { name: 'Tasks', + path: '/tasks', icon: '📋', children: [ { name: 'Backups', path: '/tasks/backups', icon: '💾' }, @@ -86,38 +97,72 @@ export default function Layout({ children }: LayoutProps) {