From 3efed854bb582588be182b7e378b202da564b5fb Mon Sep 17 00:00:00 2001 From: Leo dev Date: Fri, 2 Jan 2026 14:05:06 +0100 Subject: [PATCH] Deployments patch --- src/app/deployments/page.tsx | 147 ++++++++++++++++------------------- src/lib/types.ts | 2 +- 2 files changed, 66 insertions(+), 83 deletions(-) diff --git a/src/app/deployments/page.tsx b/src/app/deployments/page.tsx index 6e75de2..ebd8cbe 100644 --- a/src/app/deployments/page.tsx +++ b/src/app/deployments/page.tsx @@ -13,20 +13,20 @@ import { GitBranch, } from "lucide-react"; import { useEffect, useState } from "react"; -import { Deployment } from "@/lib/types"; +import { Application, Deployment } from "@/lib/types"; import { getDeployments } from "@/core/server/deployment"; import { getApplications } from "@/core/application"; +import { cn } from "@/lib/utils"; export default function DeploymentsPage() { + const [applications, setApplications] = useState([]); const [deployments, setDeployments] = useState([]); useEffect(() => { const fetch = async () => { - setDeployments( - (await getDeployments(await getApplications())).filter( - (d) => d !== null - ) - ); + const apps = await getApplications(); + setApplications(apps); + setDeployments((await getDeployments(apps)).filter((d) => d !== null)); }; fetch(); }, []); @@ -46,91 +46,74 @@ export default function DeploymentsPage() { - - - {/* Desktop table */} -
- - - - {["Application", "Status", "Actions"].map((h) => ( - - ))} - - - - {deployments.map((dep) => ( - - - - - - - - ))} - -
- {h} -
-
- - {dep.image} -
-
{dep.status} -
- - - -
-
-
- - {/* Mobile cards */} -
- {deployments.map((dep) => ( -
-
-
- - {dep.image} -
- {dep.status} +
+ {deployments.map((dep) => ( +
+
+ +
+
+ { + applications.find((app) => + app.deployments.includes(dep.image) + )?.name + }
+
+ {/* {dep.version} */} +
+
+
+
+ {/* {dep.time} */} +
+
+ ))} +
- {/*
+ {/* Mobile cards */} +
+ {deployments.map((dep) => ( +
+
+
+ + {dep.image} +
+ {dep.status} +
+ + {/*
By
{dep.deployedBy}
*/} -
- - - -
-
- ))} +
+ + + +
- - + ))} +
); } diff --git a/src/lib/types.ts b/src/lib/types.ts index 1d51e62..776f1c5 100644 --- a/src/lib/types.ts +++ b/src/lib/types.ts @@ -62,7 +62,7 @@ export interface Deployment { container: string; cpu: number; memory: number; - status: "running" | "stopped"; + status: "running" | "stopped" | "pending"; ports: [number, number][]; }