From 89ce6c79d7543bb86b3f69e381f1cc3c2a68ba9d Mon Sep 17 00:00:00 2001 From: Chaim Date: Mon, 4 May 2026 06:50:12 +0000 Subject: [PATCH] feat(settings): implement Registrations tab Replaces stub RegistrationsTab with a full read-only view grouped by client. Handles all 4 states: loading skeleton, fetch error, host_path_unavailable, empty list, and populated data with per-registration detail rows. Co-Authored-By: Claude Sonnet 4.6 --- .../_components/registrations-tab.tsx | 135 +++++++++++++++++- 1 file changed, 134 insertions(+), 1 deletion(-) diff --git a/web-ui/src/app/settings/_components/registrations-tab.tsx b/web-ui/src/app/settings/_components/registrations-tab.tsx index 94474d5..af3cdb1 100644 --- a/web-ui/src/app/settings/_components/registrations-tab.tsx +++ b/web-ui/src/app/settings/_components/registrations-tab.tsx @@ -1 +1,134 @@ -export function RegistrationsTab() { return
Registrations tab — coming soon
; } +"use client"; + +import { Plug, AlertCircle } from "lucide-react"; +import { Card, CardContent } from "@/components/ui/card"; +import { Skeleton } from "@/components/ui/skeleton"; +import { Badge } from "@/components/ui/badge"; +import { useMcpRegistrations } from "@/lib/api/settings"; + +export function RegistrationsTab() { + const { data, isPending, error } = useMcpRegistrations(); + + if (isPending) return ; + if (error) { + return ( + + + + שגיאה: {error.message} + + + ); + } + if (!data) return null; + + if (data.error === "host_path_unavailable") { + return ( + + +
+ + תיקיית /host לא זמינה בקונטיינר +
+

+ כדי להציג רישומי MCP, יש להוסיף volume mounts ב-Coolify. + ראה runbook ב- + + docs/runbooks/coolify-mcp-settings-volumes.md + +

+ {data.message && ( +

{data.message}

+ )} +
+
+ ); + } + + if (!data.registrations.length) { + return ( + + + לא נמצאו רישומי MCP. + + + ); + } + + // Group by client + const groups = new Map(); + for (const r of data.registrations) { + const arr = groups.get(r.client) ?? []; + arr.push(r); + groups.set(r.client, arr); + } + + return ( +
+
+ + סה"כ {data.registrations.length} רישומים +
+ {[...groups.entries()].map(([client, regs]) => ( + + +

+ {client} + + {regs.length} + +

+
+ {regs.map((r, i) => ( +
+
+ + {r.server_name} + + + {r.transport} + +
+
+ command: + + {r.command || "—"} + + args: + + {r.args.length ? JSON.stringify(r.args) : "[]"} + + cwd: + + {r.cwd || "—"} + + env keys: +
+ {r.env_keys.length === 0 ? ( + + ) : ( + r.env_keys.map((k) => ( + + {k} + + )) + )} +
+
+
+ ))} +
+
+
+ ))} +
+ ); +}