diff --git a/ui/src/api/schema.d.ts b/ui/src/api/schema.d.ts index 27d6da13..a1db5f83 100644 --- a/ui/src/api/schema.d.ts +++ b/ui/src/api/schema.d.ts @@ -1916,9 +1916,9 @@ export interface components { }; /** @description Agent instance summary with runtime metrics */ AgentInstanceResponse: { - id: string; - name: string; - application: string; + instanceId: string; + displayName: string; + applicationId: string; status: string; routeIds: string[]; /** Format: date-time */ diff --git a/ui/src/components/LayoutShell.tsx b/ui/src/components/LayoutShell.tsx index 0ac5e843..7a5c7aa6 100644 --- a/ui/src/components/LayoutShell.tsx +++ b/ui/src/components/LayoutShell.tsx @@ -51,12 +51,12 @@ function buildSearchData( if (agents) { for (const agent of agents) { results.push({ - id: agent.id, + id: agent.instanceId, category: 'agent', - title: agent.name, - badges: [{ label: (agent.state || 'unknown').toUpperCase(), color: healthToColor((agent.state || '').toLowerCase()) }], - meta: `${agent.application} · ${agent.version || ''}${agent.agentTps != null ? ` · ${agent.agentTps.toFixed(1)} msg/s` : ''}`, - path: `/runtime/${agent.application}/${agent.id}`, + title: agent.displayName, + badges: [{ label: (agent.status || 'unknown').toUpperCase(), color: healthToColor((agent.status || '').toLowerCase()) }], + meta: `${agent.applicationId} · ${agent.version || ''}${agent.tps != null ? ` · ${agent.tps.toFixed(1)} msg/s` : ''}`, + path: `/runtime/${agent.applicationId}/${agent.instanceId}`, }); } } diff --git a/ui/src/pages/AgentHealth/AgentHealth.tsx b/ui/src/pages/AgentHealth/AgentHealth.tsx index 779cde70..59a5a47a 100644 --- a/ui/src/pages/AgentHealth/AgentHealth.tsx +++ b/ui/src/pages/AgentHealth/AgentHealth.tsx @@ -70,7 +70,7 @@ interface AppGroup { function groupByApp(agentList: AgentInstance[]): AppGroup[] { const map = new Map(); for (const a of agentList) { - const app = a.application; + const app = a.applicationId; const list = map.get(app) ?? []; list.push(a); map.set(app, list); @@ -225,7 +225,7 @@ export default function AgentHealth() { title="Open instance page" onClick={(e) => { e.stopPropagation(); - navigate(`/agents/${row.application}/${row.id}`); + navigate(`/agents/${row.applicationId}/${row.instanceId}`); }} > @@ -236,7 +236,7 @@ export default function AgentHealth() { key: 'name', header: 'Instance', render: (_val, row) => ( - {row.name ?? row.id} + {row.displayName ?? row.instanceId} ), }, { @@ -298,7 +298,7 @@ export default function AgentHealth() { ); function handleInstanceClick(inst: AgentInstance) { - navigate(`/runtime/${inst.application}/${inst.id}`); + navigate(`/runtime/${inst.applicationId}/${inst.instanceId}`); } const isFullWidth = !!appId; @@ -526,9 +526,9 @@ export default function AgentHealth() { ) : undefined } > - - columns={instanceColumns} - data={group.instances} + + columns={instanceColumns as Column[]} + data={group.instances.map(i => ({ ...i, id: i.instanceId }))} onRowClick={handleInstanceClick} pageSize={50} flush diff --git a/ui/src/pages/AgentInstance/AgentInstance.tsx b/ui/src/pages/AgentInstance/AgentInstance.tsx index 3182cfe3..33c8190e 100644 --- a/ui/src/pages/AgentInstance/AgentInstance.tsx +++ b/ui/src/pages/AgentInstance/AgentInstance.tsx @@ -48,13 +48,13 @@ export default function AgentInstance() { const { data: timeseries } = useStatsTimeseries(timeFrom, timeTo, undefined, appId); const agent = useMemo( - () => (agents || []).find((a: any) => a.id === instanceId) as any, + () => (agents || []).find((a: any) => a.instanceId === instanceId) as any, [agents, instanceId], ); // Stat card metrics (latest 1 bucket) const { data: latestMetrics } = useAgentMetrics( - agent?.id || null, + agent?.instanceId || null, ['jvm.cpu.process', 'jvm.memory.heap.used', 'jvm.memory.heap.max'], 1, ); @@ -65,7 +65,7 @@ export default function AgentInstance() { // Chart metrics (60 buckets) const { data: jvmMetrics } = useAgentMetrics( - agent?.id || null, + agent?.instanceId || null, ['jvm.cpu.process', 'jvm.memory.heap.used', 'jvm.memory.heap.max', 'jvm.threads.count', 'jvm.gc.time'], 60, ); @@ -236,7 +236,7 @@ export default function AgentInstance() { {appId} - {agent.name} + {agent.displayName} {agent.version && } diff --git a/ui/src/pages/Exchanges/ExchangeHeader.tsx b/ui/src/pages/Exchanges/ExchangeHeader.tsx index 07ff4d34..a9ddc7e9 100644 --- a/ui/src/pages/Exchanges/ExchangeHeader.tsx +++ b/ui/src/pages/Exchanges/ExchangeHeader.tsx @@ -54,9 +54,9 @@ export function ExchangeHeader({ detail, onCorrelatedSelect, onClearSelection }: const { agentState, hasRouteControl, hasReplay } = useMemo(() => { if (!agents) return { agentState: undefined, hasRouteControl: false, hasReplay: false }; const agentList = agents as any[]; - const agent = detail.instanceId ? agentList.find((a: any) => a.id === detail.instanceId) : undefined; + const agent = detail.instanceId ? agentList.find((a: any) => a.instanceId === detail.instanceId) : undefined; return { - agentState: agent?.state?.toLowerCase() as 'live' | 'stale' | 'dead' | undefined, + agentState: agent?.status?.toLowerCase() as 'live' | 'stale' | 'dead' | undefined, hasRouteControl: agentList.some((a: any) => a.capabilities?.routeControl === true), hasReplay: agentList.some((a: any) => a.capabilities?.replay === true), };