Compare commits
3 Commits
7a4d7b6915
...
v0.0.2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ebe768711b | ||
|
|
af45f93854 | ||
|
|
da1d74309e |
@@ -36,7 +36,7 @@ class OpenSearchIndexIT extends AbstractPostgresIT {
|
|||||||
"OrderNotFoundException: order-12345 not found", null,
|
"OrderNotFoundException: order-12345 not found", null,
|
||||||
List.of(new ProcessorDoc("proc-1", "log", "COMPLETED",
|
List.of(new ProcessorDoc("proc-1", "log", "COMPLETED",
|
||||||
null, null, "request body with customer-99", null, null, null, null)),
|
null, null, "request body with customer-99", null, null, null, null)),
|
||||||
null, false);
|
null, false, false);
|
||||||
|
|
||||||
searchIndex.index(doc);
|
searchIndex.index(doc);
|
||||||
refreshOpenSearchIndices();
|
refreshOpenSearchIndices();
|
||||||
@@ -62,7 +62,7 @@ class OpenSearchIndexIT extends AbstractPostgresIT {
|
|||||||
now, now.plusMillis(50), 50L, null, null,
|
now, now.plusMillis(50), 50L, null, null,
|
||||||
List.of(new ProcessorDoc("proc-1", "bean", "COMPLETED",
|
List.of(new ProcessorDoc("proc-1", "bean", "COMPLETED",
|
||||||
null, null, "UniquePayloadIdentifier12345", null, null, null, null)),
|
null, null, "UniquePayloadIdentifier12345", null, null, null, null)),
|
||||||
null, false);
|
null, false, false);
|
||||||
|
|
||||||
searchIndex.index(doc);
|
searchIndex.index(doc);
|
||||||
refreshOpenSearchIndices();
|
refreshOpenSearchIndices();
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ class PostgresExecutionStoreIT extends AbstractPostgresIT {
|
|||||||
now, now.plusMillis(100), 100L,
|
now, now.plusMillis(100), 100L,
|
||||||
null, null, null,
|
null, null, null,
|
||||||
"REGULAR", null, null, null, null, null,
|
"REGULAR", null, null, null, null, null,
|
||||||
null, null, null, null, null, null, null, false);
|
null, null, null, null, null, null, null, false, false);
|
||||||
|
|
||||||
executionStore.upsert(record);
|
executionStore.upsert(record);
|
||||||
Optional<ExecutionRecord> found = executionStore.findById("exec-1");
|
Optional<ExecutionRecord> found = executionStore.findById("exec-1");
|
||||||
@@ -45,12 +45,12 @@ class PostgresExecutionStoreIT extends AbstractPostgresIT {
|
|||||||
"exec-dup", "route-a", "agent-1", "app-1",
|
"exec-dup", "route-a", "agent-1", "app-1",
|
||||||
"RUNNING", null, null, now, null, null, null, null, null,
|
"RUNNING", null, null, now, null, null, null, null, null,
|
||||||
null, null, null, null, null, null,
|
null, null, null, null, null, null,
|
||||||
null, null, null, null, null, null, null, false);
|
null, null, null, null, null, null, null, false, false);
|
||||||
ExecutionRecord second = new ExecutionRecord(
|
ExecutionRecord second = new ExecutionRecord(
|
||||||
"exec-dup", "route-a", "agent-1", "app-1",
|
"exec-dup", "route-a", "agent-1", "app-1",
|
||||||
"COMPLETED", null, null, now, now.plusMillis(200), 200L, null, null, null,
|
"COMPLETED", null, null, now, now.plusMillis(200), 200L, null, null, null,
|
||||||
"COMPLETE", null, null, null, null, null,
|
"COMPLETE", null, null, null, null, null,
|
||||||
null, null, null, null, null, null, null, false);
|
null, null, null, null, null, null, null, false, false);
|
||||||
|
|
||||||
executionStore.upsert(first);
|
executionStore.upsert(first);
|
||||||
executionStore.upsert(second);
|
executionStore.upsert(second);
|
||||||
@@ -68,7 +68,7 @@ class PostgresExecutionStoreIT extends AbstractPostgresIT {
|
|||||||
"exec-proc", "route-a", "agent-1", "app-1",
|
"exec-proc", "route-a", "agent-1", "app-1",
|
||||||
"COMPLETED", null, null, now, now.plusMillis(50), 50L, null, null, null,
|
"COMPLETED", null, null, now, now.plusMillis(50), 50L, null, null, null,
|
||||||
"COMPLETE", null, null, null, null, null,
|
"COMPLETE", null, null, null, null, null,
|
||||||
null, null, null, null, null, null, null, false);
|
null, null, null, null, null, null, null, false, false);
|
||||||
executionStore.upsert(exec);
|
executionStore.upsert(exec);
|
||||||
|
|
||||||
List<ProcessorRecord> processors = List.of(
|
List<ProcessorRecord> processors = List.of(
|
||||||
|
|||||||
@@ -61,6 +61,6 @@ class PostgresStatsStoreIT extends AbstractPostgresIT {
|
|||||||
startTime, startTime.plusMillis(durationMs), durationMs,
|
startTime, startTime.plusMillis(durationMs), durationMs,
|
||||||
status.equals("FAILED") ? "error" : null, null, null,
|
status.equals("FAILED") ? "error" : null, null, null,
|
||||||
null, null, null, null, null, null,
|
null, null, null, null, null, null,
|
||||||
null, null, null, null, null, null, null, false));
|
null, null, null, null, null, null, null, false, false));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -102,8 +102,8 @@ public class IngestionService {
|
|||||||
|
|
||||||
boolean hasTraceData = hasAnyTraceData(exec.getProcessors());
|
boolean hasTraceData = hasAnyTraceData(exec.getProcessors());
|
||||||
|
|
||||||
boolean isReplay = false;
|
boolean isReplay = exec.getReplayExchangeId() != null;
|
||||||
if (inputSnapshot != null && inputSnapshot.getHeaders() != null) {
|
if (!isReplay && inputSnapshot != null && inputSnapshot.getHeaders() != null) {
|
||||||
isReplay = "true".equalsIgnoreCase(
|
isReplay = "true".equalsIgnoreCase(
|
||||||
String.valueOf(inputSnapshot.getHeaders().get("X-Cameleer-Replay")));
|
String.valueOf(inputSnapshot.getHeaders().get("X-Cameleer-Replay")));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -210,7 +210,21 @@ function LayoutContent() {
|
|||||||
|
|
||||||
const handlePaletteSelect = useCallback((result: any) => {
|
const handlePaletteSelect = useCallback((result: any) => {
|
||||||
if (result.path) {
|
if (result.path) {
|
||||||
navigate(result.path, { state: result.path ? { sidebarReveal: result.path } : undefined });
|
const state: Record<string, unknown> = { sidebarReveal: result.path };
|
||||||
|
|
||||||
|
// For exchange/attribute results, pass selectedExchange in state
|
||||||
|
if (result.category === 'exchange' || result.category === 'attribute') {
|
||||||
|
const parts = result.path.split('/').filter(Boolean);
|
||||||
|
if (parts.length === 4 && parts[0] === 'exchanges') {
|
||||||
|
state.selectedExchange = {
|
||||||
|
executionId: parts[3],
|
||||||
|
applicationName: parts[1],
|
||||||
|
routeId: parts[2],
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
navigate(result.path, { state });
|
||||||
}
|
}
|
||||||
setPaletteOpen(false);
|
setPaletteOpen(false);
|
||||||
}, [navigate, setPaletteOpen]);
|
}, [navigate, setPaletteOpen]);
|
||||||
|
|||||||
@@ -20,17 +20,35 @@ import type { SelectedExchange } from '../Dashboard/Dashboard';
|
|||||||
export default function ExchangesPage() {
|
export default function ExchangesPage() {
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
const location = useLocation();
|
const location = useLocation();
|
||||||
const { appId: scopedAppId, routeId: scopedRouteId } = useParams<{ appId?: string; routeId?: string }>();
|
const { appId: scopedAppId, routeId: scopedRouteId, exchangeId: scopedExchangeId } =
|
||||||
|
useParams<{ appId?: string; routeId?: string; exchangeId?: string }>();
|
||||||
|
|
||||||
// Restore selection from browser history state (enables Back/Forward)
|
// Restore selection from browser history state (enables Back/Forward)
|
||||||
const stateSelected = (location.state as any)?.selectedExchange as SelectedExchange | undefined;
|
const stateSelected = (location.state as any)?.selectedExchange as SelectedExchange | undefined;
|
||||||
const [selected, setSelectedInternal] = useState<SelectedExchange | null>(stateSelected ?? null);
|
|
||||||
|
|
||||||
// Sync from history state when the user navigates Back/Forward
|
// Derive selection from URL params when no state-based selection exists (Cmd-K, bookmarks)
|
||||||
|
const urlDerivedExchange: SelectedExchange | null =
|
||||||
|
(scopedExchangeId && scopedAppId && scopedRouteId)
|
||||||
|
? { executionId: scopedExchangeId, applicationName: scopedAppId, routeId: scopedRouteId }
|
||||||
|
: null;
|
||||||
|
|
||||||
|
const [selected, setSelectedInternal] = useState<SelectedExchange | null>(stateSelected ?? urlDerivedExchange);
|
||||||
|
|
||||||
|
// Sync selection from history state or URL params on navigation changes
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const restored = (location.state as any)?.selectedExchange as SelectedExchange | undefined;
|
const restored = (location.state as any)?.selectedExchange as SelectedExchange | undefined;
|
||||||
setSelectedInternal(restored ?? null);
|
if (restored) {
|
||||||
}, [location.state]);
|
setSelectedInternal(restored);
|
||||||
|
} else if (scopedExchangeId && scopedAppId && scopedRouteId) {
|
||||||
|
setSelectedInternal({
|
||||||
|
executionId: scopedExchangeId,
|
||||||
|
applicationName: scopedAppId,
|
||||||
|
routeId: scopedRouteId,
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
setSelectedInternal(null);
|
||||||
|
}
|
||||||
|
}, [location.state, scopedExchangeId, scopedAppId, scopedRouteId]);
|
||||||
|
|
||||||
const [splitPercent, setSplitPercent] = useState(50);
|
const [splitPercent, setSplitPercent] = useState(50);
|
||||||
const containerRef = useRef<HTMLDivElement>(null);
|
const containerRef = useRef<HTMLDivElement>(null);
|
||||||
@@ -52,10 +70,15 @@ export default function ExchangesPage() {
|
|||||||
});
|
});
|
||||||
}, [navigate, location.pathname, location.search, location.state]);
|
}, [navigate, location.pathname, location.search, location.state]);
|
||||||
|
|
||||||
// Clear selection: push a history entry without selection (so Back returns to selected state)
|
// Clear selection: navigate up to route level when URL has exchangeId
|
||||||
const handleClearSelection = useCallback(() => {
|
const handleClearSelection = useCallback(() => {
|
||||||
setSelectedInternal(null);
|
setSelectedInternal(null);
|
||||||
}, []);
|
if (scopedExchangeId && scopedAppId && scopedRouteId) {
|
||||||
|
navigate(`/exchanges/${scopedAppId}/${scopedRouteId}`, {
|
||||||
|
state: { ...location.state, selectedExchange: undefined },
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}, [scopedExchangeId, scopedAppId, scopedRouteId, navigate, location.state]);
|
||||||
|
|
||||||
const handleSplitterDown = useCallback((e: React.PointerEvent) => {
|
const handleSplitterDown = useCallback((e: React.PointerEvent) => {
|
||||||
e.currentTarget.setPointerCapture(e.pointerId);
|
e.currentTarget.setPointerCapture(e.pointerId);
|
||||||
|
|||||||
Reference in New Issue
Block a user