@@ -10,18 +10,29 @@ import {
1010import { Skeleton } from "@/components/ui/skeleton" ;
1111import { useBackend } from "@/providers/BackendProvider" ;
1212import { useFetchContainerExecutionState } from "@/services/executionService" ;
13+ import {
14+ type ComponentSpec ,
15+ isGraphImplementation ,
16+ } from "@/utils/componentSpec" ;
1317import { EXIT_CODE_OOM } from "@/utils/constants" ;
1418import { formatDate , formatDuration } from "@/utils/date" ;
1519
1620import { InfoBox } from "../InfoBox" ;
1721
1822interface ExecutionDetailsProps {
1923 executionId : string ;
24+ componentSpec ?: ComponentSpec ;
2025}
2126
22- export const ExecutionDetails = ( { executionId } : ExecutionDetailsProps ) => {
27+ export const ExecutionDetails = ( {
28+ executionId,
29+ componentSpec,
30+ } : ExecutionDetailsProps ) => {
2331 const { backendUrl } = useBackend ( ) ;
2432
33+ const isSubgraph =
34+ componentSpec && isGraphImplementation ( componentSpec . implementation ) ;
35+
2536 const {
2637 data : containerState ,
2738 isLoading : isLoadingContainerState ,
@@ -63,86 +74,92 @@ export const ExecutionDetails = ({ executionId }: ExecutionDetailsProps) => {
6374 </ span >
6475 </ div >
6576
66- { isLoadingContainerState && (
67- < div className = "space-y-2" >
68- < div className = "flex items-center gap-2" >
69- < Skeleton className = "h-3 w-12" />
70- < Skeleton className = "h-3 w-32" />
71- </ div >
72- < div className = "flex items-center gap-2" >
73- < Skeleton className = "h-3 w-20" />
74- < Skeleton className = "h-3 w-24" />
75- < Skeleton className = "h-3 w-40" />
76- </ div >
77- </ div >
78- ) }
77+ { ! isSubgraph && (
78+ < >
79+ { isLoadingContainerState && (
80+ < div className = "space-y-2" >
81+ < div className = "flex items-center gap-2" >
82+ < Skeleton className = "h-3 w-12" />
83+ < Skeleton className = "h-3 w-32" />
84+ </ div >
85+ < div className = "flex items-center gap-2" >
86+ < Skeleton className = "h-3 w-20" />
87+ < Skeleton className = "h-3 w-24" />
88+ < Skeleton className = "h-3 w-40" />
89+ </ div >
90+ </ div >
91+ ) }
7992
80- { containerStateError && (
81- < InfoBox title = "Failed to load container state" variant = "error" >
82- { containerStateError . message }
83- </ InfoBox >
84- ) }
93+ { containerStateError && (
94+ < InfoBox title = "Failed to load container state" variant = "error" >
95+ { containerStateError . message }
96+ </ InfoBox >
97+ ) }
8598
86- { ! ! containerState ?. exit_code && (
87- < div className = "flex flex-wrap items-center gap-1" >
88- < span className = "font-medium text-xs text-destructive" >
89- Exit Code:
90- </ span >
91- < span className = "text-xs text-destructive" >
92- { containerState . exit_code }
93- </ span >
94- { containerState . exit_code === EXIT_CODE_OOM && (
95- < span className = "text-xs text-destructive" >
96- (Out of Memory)
97- </ span >
99+ { ! ! containerState ?. exit_code && (
100+ < div className = "flex flex-wrap items-center gap-1" >
101+ < span className = "font-medium text-xs text-destructive" >
102+ Exit Code:
103+ </ span >
104+ < span className = "text-xs text-destructive" >
105+ { containerState . exit_code }
106+ </ span >
107+ { containerState . exit_code === EXIT_CODE_OOM && (
108+ < span className = "text-xs text-destructive" >
109+ (Out of Memory)
110+ </ span >
111+ ) }
112+ </ div >
98113 ) }
99- </ div >
100- ) }
101114
102- { containerState ?. started_at && (
103- < div className = "flex items-center gap-2" >
104- < span className = "font-medium text-xs text-foreground min-w-fit" >
105- Started:
106- </ span >
107- < span className = "text-xs text-muted-foreground" >
108- { formatDate ( containerState . started_at ) }
109- </ span >
110- </ div >
111- ) }
115+ { containerState ?. started_at && (
116+ < div className = "flex items-center gap-2" >
117+ < span className = "font-medium text-xs text-foreground min-w-fit" >
118+ Started:
119+ </ span >
120+ < span className = "text-xs text-muted-foreground" >
121+ { formatDate ( containerState . started_at ) }
122+ </ span >
123+ </ div >
124+ ) }
112125
113- { containerState ?. ended_at && containerState ?. started_at && (
114- < div className = "flex items-center gap-2" >
115- < span className = "font-medium text-xs text-foreground min-w-fit" >
116- Completed in:
117- </ span >
118- < span className = "text-xs text-muted-foreground" >
119- { formatDuration (
120- containerState . started_at ,
121- containerState . ended_at ,
122- ) }
123- </ span >
124- < span className = "text-xs text-muted-foreground" >
125- ({ formatDate ( containerState . ended_at ) } )
126- </ span >
127- </ div >
128- ) }
126+ { containerState ?. ended_at && containerState ?. started_at && (
127+ < div className = "flex items-center gap-2" >
128+ < span className = "font-medium text-xs text-foreground min-w-fit" >
129+ Completed in:
130+ </ span >
131+ < span className = "text-xs text-muted-foreground" >
132+ { formatDuration (
133+ containerState . started_at ,
134+ containerState . ended_at ,
135+ ) }
136+ </ span >
137+ < span className = "text-xs text-muted-foreground" >
138+ ({ formatDate ( containerState . ended_at ) } )
139+ </ span >
140+ </ div >
141+ ) }
129142
130- { podName && (
131- < div className = "flex items-center gap-2" >
132- < span className = "font-medium text-xs text-foreground min-w-fit" >
133- Pod Name:
134- </ span >
135- < span className = "text-xs text-muted-foreground" > { podName } </ span >
136- </ div >
137- ) }
143+ { podName && (
144+ < div className = "flex items-center gap-2" >
145+ < span className = "font-medium text-xs text-foreground min-w-fit" >
146+ Pod Name:
147+ </ span >
148+ < span className = "text-xs text-muted-foreground" >
149+ { podName }
150+ </ span >
151+ </ div >
152+ ) }
138153
139- { ! isLoadingContainerState &&
140- ! containerState &&
141- ! containerStateError && (
142- < div className = "text-xs text-muted-foreground" >
143- Container state not available
144- </ div >
145- ) }
154+ { ! isLoadingContainerState &&
155+ ! containerState &&
156+ ! containerStateError && (
157+ < div className = "text-xs text-muted-foreground" >
158+ Container state not available
159+ </ div >
160+ ) }
161+ </ >
162+ ) }
146163 </ CollapsibleContent >
147164 </ Collapsible >
148165 </ div >
0 commit comments