| 1 | {% extends 'layouts/base.html' %} |
| 2 | |
| 3 | {% set active_menu = 'jobqueue' %} |
| 4 | {% set page_title = 'Job: ' + job_title %} |
| 5 | |
| 6 | {% block body_header %} |
| 7 | <h1 class="title mb-4">{{job_title}}</h1> |
| 8 | {% endblock %} |
| 9 | |
| 10 | {% block js_pre %} |
| 11 | <script src="{{ url_for('static', filename='js/term2html.js') }}"></script> |
| 12 | {% endblock %} |
| 13 | |
| 14 | {% block body %} |
| 15 | <div class="columns is-multiline is-mobile"> |
| 16 | <div class="column is-12"> |
| 17 | |
| 18 | <b>ID:</b> {{job.uuid}}<br/> |
| 19 | <br/> |
| 20 | <b>Created:</b> {{humanized_timediff(job.time_created)}}<br/> |
| 21 | <b>Assigned:</b> {{humanized_timediff(job.time_assigned)}}<br/> |
| 22 | {% if job.time_finished %}<b>Finished:</b> {{humanized_timediff(job.time_finished)}}<br/>{% endif %} |
| 23 | {% if worker %} |
| 24 | <b>Worker:</b> <a href="{{ url_for('jobs.workers') }}">{{worker.name}}</a><br/> |
| 25 | {% endif %} |
| 26 | |
| 27 | <b class="mt-2 mb-2">Status:</b> |
| 28 | {% if job.status == JobStatus.WAITING %} |
| 29 | <span style="font-size: 20px; line-height: 1.5em;"> |
| 30 | <i class="fa fa-hourglass-start" aria-hidden="true"></i> |
| 31 | </span> Waiting |
| 32 | {% elif job.status == JobStatus.DEPWAIT %} |
| 33 | <span style="font-size: 20px; line-height: 1.5em;"> |
| 34 | <i class="fa fa-puzzle-piece" aria-hidden="true"></i> |
| 35 | </span> Waiting for dependency |
| 36 | {% elif job.status == JobStatus.SCHEDULED %} |
| 37 | <span style="font-size: 20px; line-height: 1.5em;"> |
| 38 | <i class="fa fa-circle-notch fa-spin" aria-hidden="true"></i> |
| 39 | </span> Scheduled |
| 40 | {% elif job.status == JobStatus.RUNNING %} |
| 41 | <span style="font-size: 20px; line-height: 1.5em;"> |
| 42 | <i class="fa fa-cog fa-spin" aria-hidden="true"></i> |
| 43 | </span> Running |
| 44 | {% elif job.status == JobStatus.DONE %} |
| 45 | <span style="font-size: 20px; line-height: 1.5em;"> |
| 46 | <i class="fa fa-check" aria-hidden="true"></i> |
| 47 | </span> Done |
| 48 | {% elif job.status == JobStatus.STARVING %} |
| 49 | <span style="font-size: 20px; line-height: 1.5em;"> |
| 50 | <i class="fa fa-clock-o" aria-hidden="true"></i> |
| 51 | </span> Starving |
| 52 | {% elif job.status == JobStatus.TERMINATED %} |
| 53 | <span style="font-size: 20px; line-height: 1.5em;"> |
| 54 | <i class="fa fa-skull" aria-hidden="true"></i> |
| 55 | </span> Terminated |
| 56 | {% endif %} |
| 57 | |
| 58 | {% if job.result != JobResult.UNKNOWN %} |
| 59 | <h4 class="subtitle is-4" style="margin-bottom: 0.5rem;margin-top: 1.5rem;">Result</h4> |
| 60 | <p> |
| 61 | {% if job.result == JobResult.SUCCESS_PENDING %} |
| 62 | <span style="font-size: 20px; line-height: 1.5em;"> |
| 63 | <font class="fa fa-check-circle" aria-hidden="true" color="green"></font> |
| 64 | <i class="fa fa-clock" aria-hidden="true"></i> |
| 65 | </span> Successful (pending) |
| 66 | {% elif job.result == JobResult.FAILURE_PENDING %} |
| 67 | <span style="font-size: 20px; line-height: 1.5em;"> |
| 68 | <font class="fa fa-times-circle" aria-hidden="true" color="red"></font> |
| 69 | <i class="fa fa-clock" aria-hidden="true"></i> |
| 70 | </span> Failed (pending) |
| 71 | {% elif job.result == JobResult.SUCCESS %} |
| 72 | <span style="font-size: 20px; line-height: 1.5em;"> |
| 73 | <font class="fa fa-check-circle" aria-hidden="true" color="green"></font> |
| 74 | </span> Success |
| 75 | {% elif job.result == JobResult.FAILURE %} |
| 76 | <span style="font-size: 20px; line-height: 1.5em;"> |
| 77 | <font class="fa fa-times-circle" aria-hidden="true" color="red"></font> |
| 78 | </span> Failed |
| 79 | {% elif job.result == JobResult.FAILURE_DEPENDENCY %} |
| 80 | <span style="font-size: 20px; line-height: 1.5em;"> |
| 81 | <font class="fa fa-diagram-project" aria-hidden="true" color="purple"></font> |
| 82 | </span> Dependency issue |
| 83 | {% endif %} |
| 84 | </p> |
| 85 | {% endif %} |
| 86 | |
| 87 | |
| 88 | {% block job_details %}{% endblock %} |
| 89 | |
| 90 | {% if log_url %} |
| 91 | <br/> |
| 92 | <p> |
| 93 | <a class="button is-primary" href="{{ url_for('jobs.view_log', uuid=job.uuid)}}"><i class="fa-solid fa-eye"></i> View Full Log</a> |
| 94 | <a class="button is-link is-light" href="{{log_url}}"><i class="fa-solid fa-download"></i> Download Log</a> |
| 95 | {% if firehose_url %} |
| 96 | <a class="button is-info is-light" href="{{firehose_url}}"><i class="fa-solid fa-code-commit"></i> Download Firehose XML</a> |
| 97 | {% endif %} |
| 98 | </p> |
| 99 | {% else %} |
| 100 | <h4 class="subtitle is-4" style="margin-bottom: 0.5rem;margin-top: 1.5rem;">Log Excerpt</h4> |
| 101 | <div class="box"> |
| 102 | <pre style="padding: 0; background-color: initial;" id="logDisplay"></pre> |
| 103 | </div> |
| 104 | |
| 105 | <script> |
| 106 | const logDisplay = document.getElementById('logDisplay'); |
| 107 | logDisplay.innerHTML = term2html({{job.latest_log_excerpt|tojson if job.latest_log_excerpt else "'...'"}}); |
| 108 | </script> |
| 109 | {% endif %} |
| 110 | |
| 111 | </div> |
| 112 | </div> |
| 113 | {% endblock %} |