"use client"; import { DashboardLayout } from "@/components/dashboard/DashboardLayout"; import { Card, CardContent } from "@/components/ui/card"; import { Badge } from "@/components/ui/badge"; import { Button } from "@/components/ui/button"; import { Play, Square, RotateCcw, MoreVertical, Plus } from "lucide-react"; import { Progress } from "@/components/ui/progress"; import DeployApplication from "@/components/dialogs/DeployApplication"; import { useEffect, useState } from "react"; import { Application } from "@/lib/types"; import { getApplications } from "@/core/application"; export default function ApplicationsPage() { const [applications, setApplications] = useState([]); useEffect(() => { const fetch = async () => { setApplications(await getApplications()); }; fetch(); }, []); return ( {/* Header */}
{applications.length} apps {applications.filter((a) => a.status === "running").length} running
{applications.map((app, i) => (
{/* Status & Name */}
{/* {app.status} */}
{app.name}
{app.image}
{/* Replicas */}
Replicas
{app.replicas}
{/* CPU */}
CPU
{app.cpu}%
{/* Memory */}
Memory
{app.memory}%
{/* Network */}
Network
{app.network}
{/* Ports */}
Ports
{app.ports?.length > 0 ? ( app.ports.map((port) => ( {port} )) ) : ( — )}
{/* Actions */}
{app.status === "running" ? ( ) : ( )}
))}
); }