diff --git a/app/dashboard/applications/Applications.tsx b/app/dashboard/applications/Applications.tsx index 24f1fd2..8b0adc5 100644 --- a/app/dashboard/applications/Applications.tsx +++ b/app/dashboard/applications/Applications.tsx @@ -73,6 +73,7 @@ import { TooltipProvider, TooltipTrigger, } from "@/components/ui/tooltip" +import { StatusIndicator } from "@/components/status-indicator"; interface Application { id: number; @@ -440,20 +441,9 @@ export default function Dashboard() { >
-
-
-
+
-
+
{app.icon ? ( diff --git a/app/dashboard/servers/Servers.tsx b/app/dashboard/servers/Servers.tsx index fad3c4c..e332b07 100644 --- a/app/dashboard/servers/Servers.tsx +++ b/app/dashboard/servers/Servers.tsx @@ -58,7 +58,7 @@ import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs" import { Checkbox } from "@/components/ui/checkbox" import { ScrollArea } from "@/components/ui/scroll-area" import { DynamicIcon } from "lucide-react/dynamic" - +import { StatusIndicator } from "@/components/status-indicator" interface Server { id: number name: string @@ -832,14 +832,7 @@ export default function Dashboard() { {server.monitoring && (
-
-
-
+
)}
diff --git a/components/status-indicator.tsx b/components/status-indicator.tsx new file mode 100644 index 0000000..25d5862 --- /dev/null +++ b/components/status-indicator.tsx @@ -0,0 +1,38 @@ +"use client" + +import { cn } from "@/lib/utils" +import { Badge } from "@/components/ui/badge" + +interface StatusIndicatorProps { + isOnline?: boolean + className?: string + showLabel?: boolean + pulseAnimation?: boolean +} + +export function StatusIndicator({ + isOnline = false, + className, + showLabel = true, + pulseAnimation = true, +}: StatusIndicatorProps) { + return ( + + + {isOnline && pulseAnimation && ( + + )} + + {showLabel && {isOnline ? "Online" : "Offline"}} + + ) +}