diff --git a/app/components/cluster-details.tsx b/app/components/cluster-details.tsx
index ad02a7b6..6ca24daf 100644
--- a/app/components/cluster-details.tsx
+++ b/app/components/cluster-details.tsx
@@ -7,7 +7,7 @@ import {
SheetTitle,
SheetTrigger,
} from "@/components/ui/sheet";
-import { Blocks, Cpu } from "lucide-react";
+import { Blocks, Cpu, Network } from "lucide-react";
import { useCallback, useEffect, useState } from "react";
import { SmallDeadRedCircle, SmallLiveGreenCircle } from "./circles";
import { Button } from "./ui/button";
@@ -32,6 +32,7 @@ import { DeadGrayCircle, DeadRedCircle, LiveGreenCircle } from "./circles";
import ErrorDisplay from "./error-display";
import { EventsOverlayButton } from "./events-overlay";
import { ServerConnectionStatus } from "./server-connection-pane";
+import { cn } from "@/lib/utils";
function toServiceName(name: string) {
return {name};
@@ -45,73 +46,110 @@ function toFunctionName(name: string, serviceName: string) {
return {name};
}
+function ControlPlaneBox() {
+ return (
+
+
+
+
+
+
+
+
+ Control Plane
+
+
+
+ api.inferable.ai
+
+
+
+
+ );
+}
+
function ServiceCard({
service,
clusterId,
+ index,
+ total,
}: {
service: ClientInferResponseBody[number];
clusterId: string;
+ index: number;
+ total: number;
}) {
return (
-
-
-
- {service.name === "InferableApplications" ? (
-
- ) : (
-
- )}
-
-
-
- {toServiceName(service.name)}
+
+
+
+
+
+
+
+ {service.name === "InferableApplications" ? (
+
+ ) : (
+
+ )}
-
- {service.functions?.length || 0} Functions
+
+
+ {toServiceName(service.name)}
+
+
+ {service.functions?.length || 0} Functions
+
+
+
+
+ Function
+ Description
+ Last Ping
+
+
+
+ {service.functions
+ ?.sort((a, b) => a.name.localeCompare(b.name))
+ .map((func) => (
+
+
+
+
+ {toFunctionName(func.name, service.name)}
+
+
+
+
+
+ {func.description || "No description"}
+
+
+ {new Date(service.timestamp) > new Date() ? (
+
+ Permanent Sync
+
+ ) : (
+ formatDistance(new Date(service.timestamp), new Date())
+ )}
+
+
+ ))}
+
+
-
-
-
- Function
- Description
- Last Ping
-
-
-
- {service.functions
- ?.sort((a, b) => a.name.localeCompare(b.name))
- .map((func) => (
-
-
-
-
- {toFunctionName(func.name, service.name)}
-
-
-
-
-
- {func.description || "No description"}
-
-
- {new Date(service.timestamp) > new Date() ? (
-
- Permanent Sync
-
- ) : (
- formatDistance(new Date(service.timestamp), new Date())
- )}
-
-
- ))}
-
-
);
}
@@ -143,18 +181,25 @@ export default function ServicesOverview({ clusterId }: { clusterId: string }) {
getClusterServices();
}, [getClusterServices]);
+ const sortedServices = services.sort((a, b) => a.name.localeCompare(b.name));
+
return (
-
- {services
- .sort((a, b) => a.name.localeCompare(b.name))
- .map((service) => (
-
- ))}
+
+
+ {sortedServices.length > 0 && (
+
+ )}
+
+ {sortedServices.map((service, index) => (
+
+ ))}
);