diff --git a/.claude/launch.json b/.claude/launch.json index 8a2ca19..04ee57b 100644 --- a/.claude/launch.json +++ b/.claude/launch.json @@ -3,17 +3,15 @@ "configurations": [ { "name": "backend", - "runtimeExecutable": "npx", - "runtimeArgs": ["tsx", "src/index.ts"], - "port": 3001, - "cwd": "server" + "runtimeExecutable": "npm", + "runtimeArgs": ["run", "--workspace=server", "dev"], + "port": 3002 }, { "name": "frontend", - "runtimeExecutable": "npx", - "runtimeArgs": ["vite", "--port", "5173"], - "port": 5173, - "cwd": "client" + "runtimeExecutable": "npm", + "runtimeArgs": ["run", "--workspace=client", "dev"], + "port": 5173 } ] } diff --git a/client/src/App.tsx b/client/src/App.tsx index 3ee718e..53afc34 100644 --- a/client/src/App.tsx +++ b/client/src/App.tsx @@ -14,7 +14,6 @@ import { ContainersPage } from "@/components/pages/ContainersPage" import { MemoryPage } from "@/components/pages/MemoryPage" import { StoragePage } from "@/components/pages/StoragePage" import { NetworkPage } from "@/components/pages/NetworkPage" -import { SettingsPage } from "@/components/pages/SettingsPage" import { NotificationsPage } from "@/components/pages/NotificationsPage" import { LoginPage } from "@/components/ui/animated-characters-login-page" import { useServerHealth } from "@/hooks/useServerHealth" @@ -45,12 +44,11 @@ const queryClient = new QueryClient({ }) const PAGE_TITLES: Record = { - dashboard: "Dashboard", - containers: "Containers", - memory: "Memory", - storage: "Storage", - network: "Network", - settings: "Settings", + dashboard: "Dashboard", + containers: "Containers", + memory: "Memory", + storage: "Storage", + network: "Network", notifications: "Notifications", } @@ -136,7 +134,7 @@ function DashboardContent({ activePage, onLogout }: { activePage: string; onLogo const system = data.system const memory = data.memory const disk = data.disk - const containers = data.docker ?? [] + const containers = Array.isArray(data.docker) ? data.docker : [] const nginx = data.nginx const renderPage = () => { @@ -149,8 +147,6 @@ function DashboardContent({ activePage, onLogout }: { activePage: string; onLogo return case "network": return - case "settings": - return case "notifications": return default: diff --git a/client/src/components/layout/Header.tsx b/client/src/components/layout/Header.tsx index f54facc..588ec3f 100644 --- a/client/src/components/layout/Header.tsx +++ b/client/src/components/layout/Header.tsx @@ -1,4 +1,4 @@ -import { RefreshCw, Bell } from "lucide-react" +import { RefreshCw } from "lucide-react" import { cn } from "@/lib/utils" import { Select, @@ -70,13 +70,6 @@ export function Header({ - -
BS
diff --git a/client/src/components/layout/Sidebar.tsx b/client/src/components/layout/Sidebar.tsx index 463c532..a77b65f 100644 --- a/client/src/components/layout/Sidebar.tsx +++ b/client/src/components/layout/Sidebar.tsx @@ -4,14 +4,15 @@ import { MemoryStick, HardDrive, Wifi, - Bell, Settings, HelpCircle, Server, LogOut, + Bell, } from "lucide-react" import { cn } from "@/lib/utils" import { Separator } from "@/components/ui/separator" +import { useNotificationSummary } from "@/hooks/useNotifications" interface NavItem { id: string @@ -20,17 +21,17 @@ interface NavItem { } const mainNav: NavItem[] = [ - { id: "dashboard", label: "Dashboard", icon: LayoutDashboard }, - { id: "containers", label: "Containers", icon: Container }, - { id: "memory", label: "Memory", icon: MemoryStick }, - { id: "storage", label: "Storage", icon: HardDrive }, - { id: "network", label: "Network", icon: Wifi }, - { id: "notifications", label: "Notifications", icon: Bell }, + { id: "dashboard", label: "Dashboard", icon: LayoutDashboard }, + { id: "containers", label: "Containers", icon: Container }, + { id: "memory", label: "Memory", icon: MemoryStick }, + { id: "storage", label: "Storage", icon: HardDrive }, + { id: "network", label: "Network", icon: Wifi }, + { id: "notifications", label: "Notifications", icon: Bell }, ] const bottomNav: NavItem[] = [ - { id: "settings", label: "Settings", icon: Settings }, - { id: "help", label: "Help & Support", icon: HelpCircle }, + { id: "settings", label: "Settings", icon: Settings }, + { id: "help", label: "Help & Support", icon: HelpCircle }, ] interface SidebarProps { @@ -43,10 +44,12 @@ function NavButton({ item, active, onClick, + badge, }: { item: NavItem active: boolean onClick: () => void + badge?: number }) { const Icon = item.icon return ( @@ -60,11 +63,25 @@ function NavButton({ )} > - {item.label} + {item.label} + {badge !== undefined && badge > 0 && ( + + {badge > 99 ? "99+" : badge} + + )} ) } +function NotificationBadge({ active, onClick, item }: { active: boolean; onClick: () => void; item: NavItem }) { + const { data } = useNotificationSummary() + const count = data ? data.activeCriticals + data.activeWarnings : 0 + return +} + export function Sidebar({ activePage, onNavigate, onLogout }: SidebarProps) { return (