@@ -109,51 +109,51 @@ export function BatchExecutionFullscreen({ kind, apiKind, namespace, name, resou
109109
110110 return (
111111 < div className = "flex h-full min-h-0 bg-theme-base" >
112- < aside className = "flex w-72 shrink-0 flex-col border-r border-theme-border bg-theme-surface" >
113- < div className = "border-b border-theme-border px-3 py-3" >
114- < div className = "flex items-center justify-between gap-2" >
115- < div >
116- < div className = "text-xs font-medium uppercase tracking-wide text-theme-text-tertiary" > Runs</ div >
117- < div className = "mt-1 text-sm font-semibold text-theme-text-primary" > { scheduled ? pluralizeRuns ( runs . length ) : RUN_KIND_LABEL [ apiKind ] ?? kind } </ div >
112+ { scheduled && (
113+ < aside className = "flex w-72 shrink-0 flex-col border-r border-theme-border bg-theme-surface" >
114+ < div className = "border-b border-theme-border px-3 py-3" >
115+ < div className = "flex items-center justify-between gap-2" >
116+ < div >
117+ < div className = "text-xs font-medium uppercase tracking-wide text-theme-text-tertiary" > Runs</ div >
118+ < div className = "mt-1 text-sm font-semibold text-theme-text-primary" > { pluralizeRuns ( runs . length ) } </ div >
119+ </ div >
120+ < span className = { clsx ( 'badge-sm' , phaseBadgeClass ( selectedRun ?. phase ?? source . state ) ) } > { selectedRun ?. phase ?? source . state } </ span >
118121 </ div >
119- < span className = { clsx ( 'badge-sm' , phaseBadgeClass ( selectedRun ?. phase ?? source . state ) ) } > { selectedRun ?. phase ?? source . state } </ span >
120- </ div >
121- { scheduled && (
122122 < div className = "mt-2 flex flex-wrap gap-1 text-[10px] text-theme-text-tertiary" >
123123 { phaseCounts . running > 0 && < span className = "rounded bg-theme-hover px-1.5 py-0.5" > { phaseCounts . running } running</ span > }
124124 { phaseCounts . failed > 0 && < span className = "rounded bg-theme-hover px-1.5 py-0.5" > { phaseCounts . failed } failed</ span > }
125125 { phaseCounts . succeeded > 0 && < span className = "rounded bg-theme-hover px-1.5 py-0.5" > { phaseCounts . succeeded } succeeded</ span > }
126126 </ div >
127- ) }
128- </ div >
127+ </ div >
129128
130- < div className = "min-h-0 flex-1 overflow-y-auto p-2" >
131- { runs . length === 0 ? (
132- < div className = "p-2" >
133- < EmptyState
134- tone = "neutral"
135- variant = "card"
136- headline = "No retained runs"
137- body = { `Kubernetes does not currently have ${ runKindPluralForSchedule ( kind ) } owned by this schedule.` }
138- />
139- </ div >
140- ) : (
141- < div className = "space-y-1" >
142- { runs . map ( ( run ) => (
143- < RunRailButton
144- key = { `${ run . kind } /${ run . namespace } /${ run . name } ` }
145- run = { run }
146- selected = { selectedRun ?. name === run . name }
147- onClick = { ( ) => {
148- userSelectedRunRef . current = true
149- setSelectedRunName ( run . name )
150- } }
129+ < div className = "min-h-0 flex-1 overflow-y-auto p-2" >
130+ { runs . length === 0 ? (
131+ < div className = "p-2" >
132+ < EmptyState
133+ tone = "neutral"
134+ variant = "card"
135+ headline = "No retained runs"
136+ body = { `Kubernetes does not currently have ${ runKindPluralForSchedule ( kind ) } owned by this schedule.` }
151137 />
152- ) ) }
153- </ div >
154- ) }
155- </ div >
156- </ aside >
138+ </ div >
139+ ) : (
140+ < div className = "space-y-1" >
141+ { runs . map ( ( run ) => (
142+ < RunRailButton
143+ key = { `${ run . kind } /${ run . namespace } /${ run . name } ` }
144+ run = { run }
145+ selected = { selectedRun ?. name === run . name }
146+ onClick = { ( ) => {
147+ userSelectedRunRef . current = true
148+ setSelectedRunName ( run . name )
149+ } }
150+ />
151+ ) ) }
152+ </ div >
153+ ) }
154+ </ div >
155+ </ aside >
156+ ) }
157157
158158 < main className = "min-w-0 flex-1 overflow-auto" >
159159 < div className = "space-y-4 p-4" >
@@ -198,9 +198,9 @@ export function BatchExecutionFullscreen({ kind, apiKind, namespace, name, resou
198198 < span className = { clsx ( 'badge' , phaseBadgeClass ( selectedRun . phase ) ) } > { selectedRun . phase } </ span >
199199 </ div >
200200 < div className = "grid gap-0 lg:grid-cols-2" >
201- < RunDetailList run = { selectedRun } resource = { selectedResource } workflowExecution = { workflowExecution } />
201+ < RunDetailList run = { selectedRun } resource = { selectedResource } workflowExecution = { workflowExecution } scheduledParent = { scheduled } />
202202 < div className = "border-t border-theme-border p-4 lg:border-l lg:border-t-0" >
203- < RunMetrics run = { selectedRun } resource = { selectedResource } workflowExecution = { workflowExecution } retainedRuns = { runs } />
203+ < RunMetrics run = { selectedRun } resource = { selectedResource } workflowExecution = { workflowExecution } retainedRuns = { runs } scheduledParent = { scheduled } />
204204 </ div >
205205 </ div >
206206 </ section >
@@ -460,11 +460,13 @@ function SourceFacts({ source }: { source: ReturnType<typeof sourceFacts> }) {
460460 )
461461}
462462
463- function RunDetailList ( { run, resource, workflowExecution } : { run : WorkloadRun ; resource : any ; workflowExecution : WorkflowExecutionModel | null } ) {
463+ function RunDetailList ( { run, resource, workflowExecution, scheduledParent } : { run : WorkloadRun ; resource : any ; workflowExecution : WorkflowExecutionModel | null ; scheduledParent : boolean } ) {
464464 const rows : Array < [ string , string ] > = [
465465 [ 'Started' , run . startedAt ? formatAge ( run . startedAt ) : '-' ] ,
466466 [ 'Finished' , run . finishedAt ? formatAge ( run . finishedAt ) : run . active ? 'Running' : '-' ] ,
467- [ 'Trigger' , run . trigger === 'manual' ? 'Manual' : run . scheduledAt ? 'Cron schedule' : '-' ] ,
467+ ...( scheduledParent || run . trigger || run . scheduledAt ? [
468+ [ 'Trigger' , run . trigger === 'manual' ? 'Manual' : run . scheduledAt ? 'Cron schedule' : '-' ] ,
469+ ] as Array < [ string , string ] > : [ ] ) ,
468470 ...( run . scheduledAt ? [
469471 [ 'Cron scheduled' , formatAge ( run . scheduledAt ) ] ,
470472 [ 'Start delay' , formatScheduleDelay ( run ) || '-' ] ,
@@ -487,17 +489,21 @@ function RunDetailList({ run, resource, workflowExecution }: { run: WorkloadRun;
487489 )
488490}
489491
490- function RunMetrics ( { run, resource, workflowExecution, retainedRuns } : { run : WorkloadRun ; resource : any ; workflowExecution : WorkflowExecutionModel | null ; retainedRuns : WorkloadRun [ ] } ) {
492+ function RunMetrics ( { run, resource, workflowExecution, retainedRuns, scheduledParent } : { run : WorkloadRun ; resource : any ; workflowExecution : WorkflowExecutionModel | null ; retainedRuns : WorkloadRun [ ] ; scheduledParent : boolean } ) {
491493 const failedRuns = retainedRuns . filter ( ( r ) => r . phase === 'Failed' || r . phase === 'Error' ) . length
492494 const activeRuns = retainedRuns . filter ( ( r ) => r . active ) . length
493495 const resourceDuration = workflowExecution ?. resourcesDuration ? formatResourceDuration ( workflowExecution . resourcesDuration ) : ''
494496 const jobSpec = resource ?. spec ?? { }
495497 const rows = [
496- [ 'Retained runs' , retainedRuns . length ? String ( retainedRuns . length ) : '-' ] ,
497- [ 'Active retained' , activeRuns ? String ( activeRuns ) : '0' ] ,
498- [ 'Failed retained' , failedRuns ? String ( failedRuns ) : '0' ] ,
498+ ...( scheduledParent ? [
499+ [ 'Retained runs' , retainedRuns . length ? String ( retainedRuns . length ) : '-' ] ,
500+ [ 'Active retained' , activeRuns ? String ( activeRuns ) : '0' ] ,
501+ [ 'Failed retained' , failedRuns ? String ( failedRuns ) : '0' ] ,
502+ ] as Array < [ string , string ] > : [ ] ) ,
499503 [ 'Current duration' , formatRunDuration ( run ) || '-' ] ,
500- [ 'Start delay' , run . scheduledAt ? formatScheduleDelay ( run ) || '-' : '-' ] ,
504+ ...( run . scheduledAt ? [
505+ [ 'Start delay' , formatScheduleDelay ( run ) || '-' ] ,
506+ ] as Array < [ string , string ] > : [ ] ) ,
501507 [ 'Completions' , jobSpec . completions != null ? String ( jobSpec . completions ) : run . desired ? String ( run . desired ) : '-' ] ,
502508 [ 'Resource duration' , resourceDuration || '-' ] ,
503509 ]
@@ -512,9 +518,11 @@ function RunMetrics({ run, resource, workflowExecution, retainedRuns }: { run: W
512518 </ div >
513519 ) ) }
514520 </ div >
515- < p className = "mt-3 text-xs leading-5 text-theme-text-tertiary" >
516- Retained counts reflect objects still present in Kubernetes, not all-time history.
517- </ p >
521+ { scheduledParent && (
522+ < p className = "mt-3 text-xs leading-5 text-theme-text-tertiary" >
523+ Retained counts reflect objects still present in Kubernetes, not all-time history.
524+ </ p >
525+ ) }
518526 </ div >
519527 )
520528}
0 commit comments