Skip to content

Commit

Permalink
Add pseudo restart button
Browse files Browse the repository at this point in the history
  • Loading branch information
pierotofy committed Jul 27, 2020
1 parent cfc176d commit 9026ecb
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion app/static/app/js/components/TaskListItem.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -285,9 +285,21 @@ class TaskListItem extends React.Component {
rfMap[rfParam].onClick = this.genRestartAction(rfParam);
}

return task.can_rerun_from
let items = task.can_rerun_from
.map(rf => rfMap[rf])
.filter(rf => rf !== undefined);

if (items.length > 0 && [statusCodes.CANCELED, statusCodes.FAILED].indexOf(task.status) !== -1){
// Add resume "pseudo button" to help users understand
// how to resume a task that failed for memory/disk issues.
items.unshift({
label: "Resume Processing",
icon: "fa fa-bolt",
onClick: this.genRestartAction(task.can_rerun_from[task.can_rerun_from.length - 1])
});
}

return items;
}

genRestartAction(rerunFrom = null){
Expand Down

0 comments on commit 9026ecb

Please sign in to comment.