Files
photoassistant/templates/joblog.html

79 lines
3.5 KiB
HTML

{% extends "base.html" %}
{% block main_content %}
<div class="container-fluid">
<h3>Show Job Details</h3>
<dl class="row">
<dt class="col-2">Name:</dt>
<dd class="col-4">{{job.name}}</dt>
{% if job.wait_for != None %}
<dt class="col-2">Job #:</dt>
<dd class="col-4">{{job.id}} [Waiting on: <a href="{{url_for('joblog', id=job.wait_for)}}">Job (id={{job.wait_for}})</a>]</dd>
{% else %}
<dt class="col-2">Job #:</dt>
<dd class="col-4">{{job.id}}</dt>
{% endif %}
{% if estimate != None %}
(estimated time remaining: {{estimate}})
{% endif %}
</dd>
<dt class="col-2">Current state:</dt>
{% if job.state == "Failed" %}
<dd class="col-4 bg-danger text-white">{{job.state}}</dd>
{% elif job.state == "Withdrawn" %}
<dd class="col-4 bg-secondary text-white">{{job.state}}</dd>
{% else %}
<dd class="col-4">{{job.state}}</dd>
{% endif %}
<dt class="col-2">Start Time:</dt>
<dd class="col-4">{{job.start_time|vicdate}}</dt>
<dt class="col-2">Run Time:</dt>
<dd class="col-4">{{duration}}
<dt class="col-2">Last Update:</dt>
<dd class="col-4">{{job.last_update|vicdate}}</dd>
<dt class="col-2">Files in pass:</label>
{% if job.num_files and job.num_files > 0 %}
<dd class="col-4">
{% set prog=(job.current_file_num/job.num_files*100)|round|int %}
<div title="{{job.current_file_num}} of {{job.num_files}} - {{prog}}%" class="progress my-auto h-100">
<div class="progress-bar bg-info" role="progressbar" style="width: {{prog}}%;" aria-valuenow="{{prog}}" aria-valuemin="0" aria-valuemax="100">{{job.current_file_num}} of {{job.num_files}} - {{prog}}%</div>
</div>
</dd>
<dt class="col-2">Current File:</dt>
<dd class="col-4">{{job.current_file}}</dd>
{% elif job.num_files == 0 and job.current_file_num > 0 %}
<dd class="col-10">{{job.current_file_num}} of Unknown Total</dd>
{% else %}
<dd class="col-10">N/A</dd>
{% endif %}
</dl>
<table id="jobort_tbl" class="table table-striped table-sm sm-txt" data-toolbar="#toolbar" data-search="true">
<thead><tr class="table-primary"><th>When
<svg width="16" height="16" fill="currentColor"><use xlink:href="{{url_for('internal', filename='icons.svg')}}#sort-num-{{order}}"/></svg>
</th><th>Details</th></tr></thead>
<tbody>
{% for log in logs %}
<tr><td>{{log.log_date|vicdate}}</td><td>{{log.log|safe}}</td></tr>
{% if display_more and loop.index == NEWEST_LOG_LIMIT %}
<tr>
<td class="align-middle">Remaining logs hidden</td>
<td>
<button type="button" class="btn btn-outline-info my-0 py-1 sm-txt" onClick="document.body.innerHTML+='<form id=_fm method=POST action={{url_for('joblog', id=job.id)}}></form>';document.getElementById('_fm').submit();">Show all logs</button>
</td>
</tr>
{% endif %}
{% endfor %}
</tbody>
</table>
</div class="containter">
{% endblock main_content %}
{% block script_content %}
<script>
{% if refresh and job.pa_job_state != "Completed" %}
setTimeout(function(){ window.location.reload(1); }, 3000 )
{% endif %}
</script>
{% endblock script_content %}