import { useEffect, useMemo, useState } from "react"; import { Boxes, Info, RefreshCw, Server, ShieldCheck, Tags, } from "lucide-react"; import { EmptyState } from "@/components/EmptyState"; import type { EksCluster, EksNodegroup } from "@/api/aws/eks.api"; import { useEksClustersQuery, useEksNodegroupsQuery, } from "@/api/aws/eks.queries"; function statusClass(status?: string) { const normalized = status?.toLowerCase(); if (normalized === "active") return "healthy"; if (normalized === "creating" || normalized === "updating") return "degraded"; if (normalized === "failed" || normalized === "deleting") return "unavailable"; return "unknown"; } function formatDate(value?: string) { if (!value) return "—"; return new Intl.DateTimeFormat(undefined, { dateStyle: "medium", timeStyle: "short", }).format(new Date(value)); } function yesNo(value?: boolean) { if (value === undefined) return "—"; return value ? "Enabled" : "Disabled"; } function ClusterListItem({ cluster, active, onSelect, }: { cluster: EksCluster; active: boolean; onSelect: () => void; }) { return ( ); } function ClusterSummary({ cluster }: { cluster: EksCluster }) { const vpc = cluster.resourcesVpcConfig; return (
No tags returned for this cluster.
) : (| Name | Status | Capacity | Instances | Scaling | Updated |
|---|---|---|---|---|---|
| {nodegroup.name} | {nodegroup.status ?? "unknown"} | {nodegroup.capacityType ?? "—"} | {nodegroup.instanceTypes.join(", ") || "—"} | {nodegroup.scalingConfig ? `${nodegroup.scalingConfig.minSize ?? "?"}/${nodegroup.scalingConfig.desiredSize ?? "?"}/${nodegroup.scalingConfig.maxSize ?? "?"}` : "—"} | {formatDate(nodegroup.modifiedAt ?? nodegroup.createdAt)} |
Loading nodegroups...