Skip to content

Commit

Permalink
hide log history if job does not exist
Browse files Browse the repository at this point in the history
  • Loading branch information
Pespiri committed Oct 20, 2023
1 parent c5ad913 commit 26631d1
Showing 1 changed file with 57 additions and 53 deletions.
110 changes: 57 additions & 53 deletions src/components/page-scheduled-job/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -202,63 +202,67 @@ export const PageScheduledJob: FunctionComponent<PageScheduledJobProps> = ({

<AsyncResource asyncState={scheduledJobState}>
{job && (
<Replica
logState={pollLogsState}
replica={replica}
downloadOverride={downloadOverride}
title={
<>
<Typography>
Name{' '}
<strong>{smallScheduledJobName(scheduledJobName)}</strong>
</Typography>
{job.jobId && (
<>
<Replica
logState={pollLogsState}
replica={replica}
downloadOverride={downloadOverride}
title={
<>
<Typography>
Job ID <strong>{job.jobId}</strong>
Name{' '}
<strong>{smallScheduledJobName(scheduledJobName)}</strong>
</Typography>
)}
<Typography>
Job <strong>{jobComponentName}</strong>
</Typography>
</>
}
duration={<ScheduleJobDuration job={job} />}
status={<ProgressStatusBadge status={job.status} />}
state={
<ScheduledJobState {...{ ...job, replicaList: sortedReplicas }} />
}
resources={
<>
<ReplicaResources resources={job.resources} />
<Typography>
Backoff Limit <strong>{job.backoffLimit}</strong>
</Typography>
<Typography>
Time Limit{' '}
<strong>
{!isNullOrUndefined(job.timeLimitSeconds) ? (
<Duration start={0} end={job.timeLimitSeconds * 1000} />
) : (
'Not set'
)}
</strong>
</Typography>
</>
}
/>
{job.jobId && (
<Typography>
Job ID <strong>{job.jobId}</strong>
</Typography>
)}
<Typography>
Job <strong>{jobComponentName}</strong>
</Typography>
</>
}
duration={<ScheduleJobDuration job={job} />}
status={<ProgressStatusBadge status={job.status} />}
state={
<ScheduledJobState
{...{ ...job, replicaList: sortedReplicas }}
/>
}
resources={
<>
<ReplicaResources resources={job.resources} />
<Typography>
Backoff Limit <strong>{job.backoffLimit}</strong>
</Typography>
<Typography>
Time Limit{' '}
<strong>
{!isNullOrUndefined(job.timeLimitSeconds) ? (
<Duration start={0} end={job.timeLimitSeconds * 1000} />
) : (
'Not set'
)}
</strong>
</Typography>
</>
}
/>

{(job.failedCount > 0 || pollJobLogFailed) && (
<JobReplicaLogAccordion
title="Job Logs History"
appName={appName}
envName={envName}
jobComponentName={jobComponentName}
jobName={scheduledJobName}
timeSpan={{ start: job.started, end: job.ended }}
/>
)}
</>
)}
</AsyncResource>

{(job?.failedCount > 0 || pollJobLogFailed) && (
<JobReplicaLogAccordion
title="Job Logs History"
appName={appName}
envName={envName}
jobComponentName={jobComponentName}
jobName={scheduledJobName}
{...(job && { timeSpan: { start: job.started, end: job.ended } })}
/>
)}
</main>
);
};
Expand Down

0 comments on commit 26631d1

Please sign in to comment.