diff --git a/ui/src/pages/Dashboard/Dashboard.tsx b/ui/src/pages/Dashboard/Dashboard.tsx index 4947702e..03a3365f 100644 --- a/ui/src/pages/Dashboard/Dashboard.tsx +++ b/ui/src/pages/Dashboard/Dashboard.tsx @@ -3,6 +3,7 @@ import { useParams } from 'react-router'; import { StatCard, StatusDot, Badge, MonoText, Sparkline, DataTable, DetailPanel, ProcessorTimeline, RouteFlow, + Alert, Collapsible, CodeBlock, } from '@cameleer/design-system'; import type { Column } from '@cameleer/design-system'; import { useSearchExecutions, useExecutionStats, useStatsTimeseries, useExecutionDetail, useProcessorSnapshot } from '../../api/queries/executions'; @@ -22,6 +23,8 @@ export default function Dashboard() { const [detailTab, setDetailTab] = useState('overview'); const [processorIdx, setProcessorIdx] = useState(null); + const timeWindowSeconds = (timeRange.end.getTime() - timeRange.start.getTime()) / 1000; + const { data: stats } = useExecutionStats(timeFrom, timeTo, routeId, appId); const { data: timeseries } = useStatsTimeseries(timeFrom, timeTo, routeId, appId); const { data: searchResult } = useSearchExecutions({ @@ -62,56 +65,88 @@ export default function Dashboard() { { label: 'Overview', value: 'overview', content: ( -
-
Details
-
-
- Exchange ID - {detail.executionId} -
-
- Status - -
-
- Route - {detail.routeId} -
-
- Duration - {detail.durationMs}ms -
- {detail.errorMessage && ( + <> +
+
Details
+
- Error - {detail.errorMessage} + Exchange ID + {detail.executionId}
- )} +
+ Status + +
+
+ Route + {detail.routeId} +
+
+ Duration + {detail.durationMs}ms +
+
-
+ {detail.errorMessage && ( +
+
Errors
+ + {detail.errorMessage.split(':')[0]} +
{detail.errorMessage.includes(':') ? detail.errorMessage.substring(detail.errorMessage.indexOf(':') + 1).trim() : ''}
+
+ {detail.errorStackTrace && ( + + + + )} +
+ )} + ), }, { label: 'Processors', value: 'processors', - content: detail.children ? ( - setProcessorIdx(i)} - selectedIndex={processorIdx ?? undefined} - /> - ) :
No processor data
, + content: (() => { + const procList = detail.processors?.length ? detail.processors : (detail.children ?? []); + return procList.length ? ( + setProcessorIdx(i)} + selectedIndex={processorIdx ?? undefined} + /> + ) :
No processor data
; + })(), }, ] : []; return (
- - - - - + 0 ? `${((stats?.totalCount ?? 0) / timeWindowSeconds).toFixed(2)} ex/s` : '0.00 ex/s'} + sparkline={sparklineData} + /> + 0 ? `${((stats?.failedCount ?? 0) / stats!.totalCount * 100).toFixed(1)}%` : '0.0%'} + accent="error" + /> + + +