From de3ac18b237ef33eca427899ace5c3cb9fc7b723 Mon Sep 17 00:00:00 2001 From: Klesti Selimaj Date: Sat, 14 Feb 2026 13:43:24 +0100 Subject: [PATCH] Improved deployments ui --- src/app/deployments/page.tsx | 125 +++++++++++++++-------------------- 1 file changed, 55 insertions(+), 70 deletions(-) diff --git a/src/app/deployments/page.tsx b/src/app/deployments/page.tsx index 19cf303..7a37fd5 100644 --- a/src/app/deployments/page.tsx +++ b/src/app/deployments/page.tsx @@ -2,16 +2,32 @@ import { useEffect, useMemo, useState } from "react"; import { DashboardLayout } from "@/components/dashboard/DashboardLayout"; -import { Card, CardContent } from "@/components/ui/card"; +import { + Card, + CardContent, + CardDescription, + CardHeader, + CardTitle, +} from "@/components/ui/card"; import { Badge } from "@/components/ui/badge"; import { Button } from "@/components/ui/button"; -import { Rocket, RotateCcw, Eye, MoreVertical, Plus } from "lucide-react"; +import { + Rocket, + RotateCcw, + Eye, + MoreVertical, + Plus, + Play, + Pause, + Trash, +} from "lucide-react"; import { Application, Deployment } from "@/lib/types"; import { getDeployments } from "@/lib/dockship/deploy"; import { getApps } from "@/lib/dockship/application"; import { cn } from "@/lib/utils"; import DeployAppDialog from "@/components/dialogs/DeployApp"; -import { useAsync } from "@/hooks/use-async"; +import { useAsync, useAsyncInterval } from "@/hooks/use-async"; +import RemoveDialog from "@/components/dialogs/Remove"; const statusDot = { running: "bg-chart-2", @@ -20,7 +36,7 @@ const statusDot = { } as const; export default function DeploymentsPage() { - const { value: apps } = useAsync([], getApps); + const { value: apps } = useAsyncInterval([], getApps, 5000); const { value: deployments, loading } = useAsync([], getDeployments, [apps]); @@ -44,7 +60,7 @@ export default function DeploymentsPage() { {loading ? "Loading…" - : `${deployments.length} deployment${deployments.length > 0 && 's'}`} + : `${deployments.length} deployment${deployments.length > 0 && "s"}`} @@ -55,79 +71,48 @@ export default function DeploymentsPage() { - {/* Desktop */} -
+
{deployments.map((dep) => { const appName = appNameByContainer.get(dep.container) ?? "Unknown app"; return ( -
-
- -
-
{appName}
-
+ + +
+
+ + {appName} + + {dep.ports.map(([to, from]) => ( + + {from} → {to} + + ))} + +
+

{dep.image} +

+
+ + {}} />
-
- -
- - - -
-
- ); - })} -
- - {/* Mobile */} -
- {deployments.map((dep) => { - const appName = - appNameByContainer.get(dep.container) ?? "Unknown app"; - - return ( -
-
-
- - {appName} -
- - {dep.status} - -
- -
- - - -
-
+ + ); })}