general clean up of lazy dt/dd tag use, also added estimate remainging in the dd for run time, rather than elsewhere

This commit is contained in:
2022-07-17 15:57:22 +10:00
parent d08d10a3ae
commit 3193b86f9f

View File

@@ -5,8 +5,8 @@
<script src="{{url_for( 'internal', filename='upstream/DataTables-1.11.3/js/jquery.dataTables.min.js' )}}"></script>
<style>
table.dataTable tbody td {
padding: 4px 4px;
border-bottom-width: 0px;
padding: 4px 4px;
border-bottom-width: 0px;
}
</style>
@@ -14,86 +14,85 @@ table.dataTable tbody td {
<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>
<dd class="col-4">{{job.name}}</dd>
{% 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}}</dd>
{% endif %}
<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>
{% 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="joblog_tbl" class="table table-striped table-sm sm-txt" data-toolbar="#toolbar" data-search="true">
<thead><tr class="table-info"><th>#</th><th>When</th><th>Details</th></tr></thead>
<tbody>
{% for log in logs %}
<tr><td>{{loop.index}}</td><td>{{log.log_date|vicdate}}</td><td>{{log.log|safe}}</td></tr>
{% if display_more and loop.index == OLDEST_LOG_LIMIT %}
<tr>
<td>{{loop.index}}.1</td>
<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>
{% if estimate != None %}
(remaining: {{estimate}})
{% endif %}
<dt class="col-2">Last Update:</dt>
<dd class="col-4">{{job.last_update|vicdate}}</dd>
<dt class="col-2">Files in pass:</dt>
{% 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="joblog_tbl" class="table table-striped table-sm sm-txt" data-toolbar="#toolbar" data-search="true">
<thead><tr class="table-info"><th>#</th><th>When</th><th>Details</th></tr></thead>
<tbody>
{% for log in logs %}
<tr><td>{{loop.index}}</td><td>{{log.log_date|vicdate}}</td><td>{{log.log|safe}}</td></tr>
{% if display_more and loop.index == OLDEST_LOG_LIMIT %}
<tr>
<td>{{loop.index}}.1</td>
<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>
$(document).ready(function() {
$('#joblog_tbl').DataTable(
{
'paging': false, 'info': false,
'order': [[1, "{{order}}"]],
'columnDefs': [
{ 'orderData':[0], 'targets': [1] },
{
'targets': [0],
'visible': false,
'searchable': false
},
]
} );
{% if refresh and job.pa_job_state != "Completed" %}
setTimeout(function(){ window.location.reload(1); }, 3000 )
{% endif %}
} );
</script>
<script>
$(document).ready(function() {
$('#joblog_tbl').DataTable(
{
'paging': false, 'info': false,
'order': [[1, "{{order}}"]],
'columnDefs': [
{ 'orderData':[0], 'targets': [1] },
{
'targets': [0],
'visible': false,
'searchable': false
},
]
} );
{% if refresh and job.pa_job_state != "Completed" %}
setTimeout(function(){ window.location.reload(1); }, 10000 )
{% endif %}
} );
</script>
{% endblock script_content %}