diff --git a/apps/dashboard/src/app/dashboard/layout.tsx b/apps/dashboard/src/app/dashboard/layout.tsx index 9d2d476..76a0e83 100644 --- a/apps/dashboard/src/app/dashboard/layout.tsx +++ b/apps/dashboard/src/app/dashboard/layout.tsx @@ -19,11 +19,11 @@ import { authApi, api } from '@/lib/api/client'; import { toast } from '@/components/ui/toast'; const navItems = [ - { href: '/dashboard', label: 'Overview', icon: LayoutDashboard }, - { href: '/dashboard/tabs', label: 'Open Tabs', icon: ClipboardList }, - { href: '/dashboard/users', label: 'Users', icon: Monitor }, - { href: '/dashboard/commands', label: 'Command History', icon: Terminal }, - { href: '/dashboard/settings', label: 'Settings', icon: Settings }, + { href: '/dashboard', label: 'Overview', icon: LayoutDashboard, neededRole: 'viewer' }, + { href: '/dashboard/tabs', label: 'Open Tabs', icon: ClipboardList, neededRole: 'viewer' }, + { href: '/dashboard/users', label: 'Users', icon: Monitor, neededRole: 'admin' }, + { href: '/dashboard/commands', label: 'Command History', icon: Terminal, neededRole: 'viewer' }, + { href: '/dashboard/settings', label: 'Settings', icon: Settings, neededRole: 'viewer' }, ]; export default function DashboardLayout({ @@ -110,6 +110,11 @@ export default function DashboardLayout({ {navItems.map((item) => { const Icon = item.icon; const active = pathname === item.href; + + if (item.neededRole === 'admin' && user?.role !== 'admin') { + return null; + } + return ( - - - API - - - - Base URL - {process.env.NEXT_PUBLIC_API_URL || 'http://localhost:3001/api/v1'} - - - Swagger - - {process.env.NEXT_PUBLIC_API_URL?.replace('/api/v1', '/api/docs') || 'http://localhost:3001/api/docs'} - - - - {regDialog && ( diff --git a/apps/dashboard/src/components/empty-state.tsx b/apps/dashboard/src/components/empty-state.tsx index 3af9d18..fc68785 100644 --- a/apps/dashboard/src/components/empty-state.tsx +++ b/apps/dashboard/src/components/empty-state.tsx @@ -4,7 +4,6 @@ export function EmptyState({ title, description }: { title: string; description: return ( - 📠{title} {description}
{description}