Skip to content
This repository has been archived by the owner on Jun 6, 2024. It is now read-only.

Commit

Permalink
[Web Portal] fix job detail page's "retry link" (#2478)
Browse files Browse the repository at this point in the history
  • Loading branch information
sunqinzheng authored Apr 2, 2019
1 parent 5bad115 commit 86f0fd5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import Card from './card';
import MonacoPanel from './monaco-panel';
import StatusBadge from './status-badge';
import Timer from './timer';
import {getJobMetricsUrl, cloneJob} from '../conn';
import {getJobMetricsUrl, cloneJob, openJobAttemptsPage} from '../conn';
import {printDateTime, getHumanizedJobStateString, getDurationString} from '../util';

const StoppableStatus = [
Expand Down Expand Up @@ -150,9 +150,13 @@ export default class Summary extends React.Component {
</div>
<div className={t.ml5}>
<div className={c(t.gray, FontClassNames.medium)}>Retries</div>
<div className={c(t.mt2, FontClassNames.mediumPlus)}>
<Link
className={c(t.mt2, FontClassNames.mediumPlus)}
onClick={() => openJobAttemptsPage(jobInfo.jobStatus.retries)}
disabled={isNil(jobInfo.jobStatus.retries)}
>
{jobInfo.jobStatus.retries}
</div>
</Link>
</div>
</div>
{/* summary-row-3 */}
Expand Down
9 changes: 9 additions & 0 deletions src/webportal/src/app/job/job-view/fabric/job-detail/conn.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,3 +181,12 @@ export async function getContainerLog(logUrl) {
throw new Error(`Log not available`);
}
}

export function openJobAttemptsPage(retryCount) {
const search = namespace ? namespace + '~' + jobName : jobName;
const jobSessionTemplate = JSON.stringify({'iCreate': 1, 'iStart': 0, 'iEnd': retryCount + 1, 'iLength': 20,
'aaSorting': [[0, 'desc', 1]], 'oSearch': {'bCaseInsensitive': true, 'sSearch': search, 'bRegex': false, 'bSmart': true},
'abVisCols': []});
sessionStorage.setItem('apps', jobSessionTemplate);
window.open(config.yarnWebPortalUri);
}

0 comments on commit 86f0fd5

Please sign in to comment.