| 6 | } |
| 7 | |
| 8 | function formatToTreeView(flow, flowHost) { |
| 9 | const {job, children} = flow; |
| 10 | if (!job) { |
| 11 | return {}; |
| 12 | } |
| 13 | const text = `${job.name} <a href="${basePath}/${encodeURIComponent( |
| 14 | flowHost |
| 15 | )}/${encodeURIComponent(job.queueName)}/${ |
| 16 | job.id |
| 17 | }"><span class="label label-default">${job.id}</span></a>`; |
| 18 | |
| 19 | if (children && children.length > 0) { |
| 20 | return { |
| 21 | text, |
| 22 | nodes: children.map((child) => formatToTreeView(child, flowHost)), |
| 23 | }; |
| 24 | } else { |
| 25 | return { |
| 26 | text, |
| 27 | }; |
| 28 | } |
| 29 | } |
| 30 | |
| 31 | // Set up individual "retry job" handler |
| 32 | $('.js-retry-job').on('click', function (e) { |