fix: update frontend field names for identity rename (applicationId, instanceId)
The backend identity rename (applicationName → applicationId, agentId → instanceId) was not reflected in the frontend. This caused drilldown to fail (detail.applicationName was undefined, disabling the diagram fetch) and various display issues. Updated schema.d.ts, ExchangeHeader, ExecutionDiagram, Dashboard, AgentHealth, AgentInstance, LayoutShell, LogTab, InfoTab, DetailPanel, ExchangesPage, and tracing-store. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -12,7 +12,7 @@ import styles from './ExchangeHeader.module.css';
|
||||
|
||||
interface ExchangeHeaderProps {
|
||||
detail: ExecutionDetail;
|
||||
onCorrelatedSelect?: (executionId: string, applicationName: string, routeId: string) => void;
|
||||
onCorrelatedSelect?: (executionId: string, applicationId: string, routeId: string) => void;
|
||||
onClearSelection?: () => void;
|
||||
}
|
||||
|
||||
@@ -50,17 +50,17 @@ export function ExchangeHeader({ detail, onCorrelatedSelect, onClearSelection }:
|
||||
const attrs = Object.entries(detail.attributes ?? {});
|
||||
|
||||
// Look up agent state for icon coloring + route control capability
|
||||
const { data: agents } = useAgents(undefined, detail.applicationName);
|
||||
const { data: agents } = useAgents(undefined, detail.applicationId);
|
||||
const { agentState, hasRouteControl, hasReplay } = useMemo(() => {
|
||||
if (!agents) return { agentState: undefined, hasRouteControl: false, hasReplay: false };
|
||||
const agentList = agents as any[];
|
||||
const agent = detail.agentId ? agentList.find((a: any) => a.id === detail.agentId) : undefined;
|
||||
const agent = detail.instanceId ? agentList.find((a: any) => a.id === detail.instanceId) : undefined;
|
||||
return {
|
||||
agentState: agent?.state?.toLowerCase() as 'live' | 'stale' | 'dead' | undefined,
|
||||
hasRouteControl: agentList.some((a: any) => a.capabilities?.routeControl === true),
|
||||
hasReplay: agentList.some((a: any) => a.capabilities?.replay === true),
|
||||
};
|
||||
}, [agents, detail.agentId]);
|
||||
}, [agents, detail.instanceId]);
|
||||
|
||||
const roles = useAuthStore((s) => s.roles);
|
||||
const canControl = roles.some(r => r === 'OPERATOR' || r === 'ADMIN');
|
||||
@@ -80,21 +80,21 @@ export function ExchangeHeader({ detail, onCorrelatedSelect, onClearSelection }:
|
||||
</>
|
||||
)}
|
||||
<span className={styles.separator} />
|
||||
<button className={styles.linkBtn} onClick={() => { onClearSelection?.(); navigate(`/exchanges/${detail.applicationName}`); }} title="Show all exchanges for this application">
|
||||
<span className={styles.app}>{detail.applicationName}</span>
|
||||
<button className={styles.linkBtn} onClick={() => { onClearSelection?.(); navigate(`/exchanges/${detail.applicationId}`); }} title="Show all exchanges for this application">
|
||||
<span className={styles.app}>{detail.applicationId}</span>
|
||||
</button>
|
||||
<button className={styles.linkBtn} onClick={() => { onClearSelection?.(); navigate(`/exchanges/${detail.applicationName}/${detail.routeId}`); }} title="Show all exchanges for this route">
|
||||
<button className={styles.linkBtn} onClick={() => { onClearSelection?.(); navigate(`/exchanges/${detail.applicationId}/${detail.routeId}`); }} title="Show all exchanges for this route">
|
||||
<span className={styles.route}>{detail.routeId}</span>
|
||||
<GitBranch size={12} className={styles.icon} />
|
||||
</button>
|
||||
{detail.agentId && (
|
||||
{detail.instanceId && (
|
||||
<>
|
||||
<span className={styles.separator} />
|
||||
<button className={styles.linkBtn} onClick={() => navigate(`/runtime/${detail.applicationName}`)} title="All agents for this application">
|
||||
<span className={styles.app}>{detail.applicationName}</span>
|
||||
<button className={styles.linkBtn} onClick={() => navigate(`/runtime/${detail.applicationId}`)} title="All agents for this application">
|
||||
<span className={styles.app}>{detail.applicationId}</span>
|
||||
</button>
|
||||
<button className={styles.linkBtn} onClick={() => navigate(`/runtime/${detail.applicationName}/${detail.agentId}`)} title="Agent details">
|
||||
<MonoText size="xs">{detail.agentId}</MonoText>
|
||||
<button className={styles.linkBtn} onClick={() => navigate(`/runtime/${detail.applicationId}/${detail.instanceId}`)} title="Agent details">
|
||||
<MonoText size="xs">{detail.instanceId}</MonoText>
|
||||
<Server size={12} className={agentState === 'live' ? styles.iconLive : agentState === 'stale' ? styles.iconStale : agentState === 'dead' ? styles.iconDead : styles.icon} />
|
||||
</button>
|
||||
</>
|
||||
@@ -105,11 +105,11 @@ export function ExchangeHeader({ detail, onCorrelatedSelect, onClearSelection }:
|
||||
{/* Route control / replay — only if agent supports it AND user has operator+ role */}
|
||||
{canControl && (hasRouteControl || hasReplay) && (
|
||||
<RouteControlBar
|
||||
application={detail.applicationName}
|
||||
application={detail.applicationId}
|
||||
routeId={detail.routeId}
|
||||
hasRouteControl={hasRouteControl}
|
||||
hasReplay={hasReplay}
|
||||
agentId={detail.agentId}
|
||||
agentId={detail.instanceId}
|
||||
exchangeId={detail.exchangeId}
|
||||
inputHeaders={detail.inputHeaders}
|
||||
inputBody={detail.inputBody}
|
||||
@@ -135,7 +135,7 @@ export function ExchangeHeader({ detail, onCorrelatedSelect, onClearSelection }:
|
||||
className={`${styles.chainNode} ${statusCls} ${isCurrent ? styles.chainNodeCurrent : ''}`}
|
||||
onClick={() => {
|
||||
if (!isCurrent && onCorrelatedSelect) {
|
||||
onCorrelatedSelect(ce.executionId, ce.applicationName ?? detail.applicationName, ce.routeId);
|
||||
onCorrelatedSelect(ce.executionId, ce.applicationId ?? detail.applicationId, ce.routeId);
|
||||
}
|
||||
}}
|
||||
title={`${ce.executionId}\n${ce.routeId} \u2014 ${formatDuration(ce.durationMs)}${isReplay ? '\n(replay)' : ''}`}
|
||||
|
||||
Reference in New Issue
Block a user