Skip to content

Commit 8daf0ed

Browse files
fix: use podName for worker pod name
1 parent 07415f0 commit 8daf0ed

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

src/components/app/details/cIDetails/CIDetails.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,8 @@ export const Details = ({
363363
)
364364
}
365365

366+
console.log('triggerDetails', triggerDetails)
367+
366368
if (!areTagDetailsRequired && !triggerDetailsLoading && !triggerDetails) return <Reload />
367369
if (areTagDetailsRequired && !(tagDetailsLoading || triggerDetailsLoading) && !triggerDetails) return <Reload />
368370
if (triggerDetails.id !== +buildId) return null
@@ -386,7 +388,7 @@ export const Details = ({
386388
artifact={triggerDetails.artifact}
387389
environmentName={triggerDetails.environmentName}
388390
isJobView={isJobView}
389-
workerPodName={triggerDetails.name}
391+
workerPodName={triggerDetails.podName}
390392
/>
391393
<ul className="tab-list dc__border-bottom pl-20 pr-20">
392394
<li className="tab-list__tab">

src/components/app/details/cicdHistory/TriggerDetails.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ const WorkerStatus = React.memo(
133133
// check if finishedOn time is timed out or not
134134
const isTimedOut = moment(finishedOn).isBefore(moment().subtract(TIMEOUT_VALUE, 'hours'))
135135
// finishedOn is 0001-01-01T00:00:00Z when the worker is still running
136-
const showLink = finishedOn === ZERO_TIME_STRING || !isTimedOut
136+
const showLink = workerPodName.length>0 && (finishedOn === ZERO_TIME_STRING || !isTimedOut)
137137

138138
return (
139139
<>
@@ -143,8 +143,8 @@ const WorkerStatus = React.memo(
143143
{stage === 'DEPLOY' ? (
144144
<div className="mr-10">Message</div>
145145
) : showLink ? (
146-
<NavLink to={`${WORKER_POD_BASE_URL}/${workerPodName}/logs`} className="anchor">
147-
<div className="mr-10">Worker</div>
146+
<NavLink to={`${WORKER_POD_BASE_URL}/${workerPodName}/logs`} target='_blank' className="anchor">
147+
<div className="mr-10">View worker pod</div>
148148
</NavLink>
149149
) : (
150150
<div className="mr-10">Worker</div>

src/components/app/details/cicdHistory/types.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ export interface History {
1313
name: string
1414
status: string
1515
podStatus: string
16+
podName: string
1617
message: string
1718
startedOn: string
1819
finishedOn: string

0 commit comments

Comments
 (0)