diff --git a/frontend/src/app/dashboard/admin/apps/page.tsx b/frontend/src/app/dashboard/admin/apps/page.tsx index 4639c7f..86313bf 100644 --- a/frontend/src/app/dashboard/admin/apps/page.tsx +++ b/frontend/src/app/dashboard/admin/apps/page.tsx @@ -47,12 +47,34 @@ export default function AdminAppsPage() { onError: () => toast.error('Failed to delete application'), }); + // Compute status counts from apps + const statusCounts = apps.reduce( + (acc, app) => { + const status = app.deployments?.[0]?.status || 'pending'; + if (status === 'running') acc.running++; + else if (status === 'stopped') acc.stopped++; + else if (status === 'failed' || status === 'build_failed') acc.failed++; + else if (status === 'building' || status === 'deploying') acc.deploying++; + else acc.pending++; + return acc; + }, + { running: 0, stopped: 0, failed: 0, deploying: 0, pending: 0 }, + ); + if (isLoading) { return (
+
+ {[1, 2, 3, 4, 5].map((i) => ( +
+
+
+
+ ))} +
{[1, 2, 3, 4].map((i) => ( @@ -82,6 +104,30 @@ export default function AdminAppsPage() {
+ {/* Status Summary Cards */} +
+
+

{statusCounts.running}

+

Running

+
+
+

{statusCounts.deploying}

+

Deploying

+
+
+

{statusCounts.pending}

+

Pending

+
+
+

{statusCounts.stopped}

+

Stopped

+
+
+

{statusCounts.failed}

+

Failed

+
+
+ {/* Search */}
🔍