ED_LRR/ed_lrr_gui/web/templates/status.html

88 lines
3.4 KiB
HTML

{% extends "base.html" %}
{% block app_content %}
{% if current_user.has_role('admin') %}
{% set jobs = Job.query.all() %}
{% else %}
{% set jobs = current_user.jobs %}
{% endif %}
<h1>System Status</h1>
<div class="row">
<h2>Overview</h2>
</div>
<div class="row">
<table class="table table-striped table-bordered" style="width: 1px;">
<tr>
<th>Status</th>
<th>Count</th>
</tr>
{% for group in (jobs|groupby('status')) %}
<tr>
<td>
<a href="?state={{group.grouper[1]}}">
<span class="badge badge-{{ group.grouper[0] }}">{{ group.grouper[1] }}</span>
</a>
</td>
<td>
{{group.list|count}}
</td>
<tr>
{% endfor %}
<tr>
<td>
<a href="?">
Total
</a>
</td>
<td>
{{jobs|count}}
</td>
</tr>
</table>
</div>
<div class="row">
<h2>Jobs</h2>
</div>
<div class="row">
<!-- Next: {{Job.next().id}} -->
<table class="table table-striped table-bordered" style="width: 100%;">
<thead>
<tr>
<th scope="col">ID</th>
<th scope="col">Systems</th>
<th scope="col">Status</th>
<th scope="col">User</th>
<th scope="col">Priority</th>
<th scope="col">Progess</th>
<th scope="col">ETC</th>
<th scope="col">Created</th>
</tr>
</thead>
{% for job in (jobs|sort(attribute='sort_key')) %}
{% if (state==None) or job.status[1]==state %}
<tr>
<td style="width: 1px; white-space: nowrap;"><a href="{{url_for('status',job_id=job.id)}}">{{job.id}}</a></td>
<td style="width: 1px; white-space: nowrap;">{{job.args[0]|join(', ')}}</td>
<td style="width: 1px; white-space: nowrap;"><span class="badge badge-{{job.status[0]}}">{{ job.status[1] }}</span></td>
<td style="width: 1px; white-space: nowrap;">{{job.user.name}}</td>
<td style="width: 1px; white-space: nowrap;">{{job.priority}}</td>
{% if job.state.progress %}
<td>
<div class="progress" style="width: 100%;">
<div class="progress-bar progress-bar-striped progress-bar-animated" style="width: {{job.state.progress.prc_done}}%;" role="progressbar" aria-valuenow="{{job.state.progress.prc_done|round(2)}}" aria-valuemin="0" aria-valuemax="100">
{{job.state.progress.prc_done|round(2)}}&nbsp;%
</div>
</div>
</td>
{% else %}
<td>Unknown</td>
{% endif %}
<td style="width: 1px; white-space: nowrap;">{{job.t_rem}}</td>
<td style="width: 1px; white-space: nowrap;">{{job.age}} ago</td>
</tr>
{% endif %}
{% endfor %}
</table>
</div>
{% endblock %}