2018-07-30 20:12:41 +02:00
|
|
|
{% extends "layout.html" %}
|
|
|
|
{% block header %}
|
2018-08-18 17:35:23 +02:00
|
|
|
<link href="{{ url_for('static', filename='css/libs/bootstrap-table.min.css') }}" rel="stylesheet">
|
2018-07-30 20:12:41 +02:00
|
|
|
{% endblock %}
|
|
|
|
{% block body %}
|
|
|
|
<div class="discover">
|
|
|
|
<h2>{{_('Tasks list')}}</h2>
|
2018-08-12 09:29:57 +02:00
|
|
|
<table class="table table-no-bordered" id="table" data-url="{{'/ajax/emailstat'}}" data-sort-name="starttime" data-sort-order="asc">
|
2018-07-30 20:12:41 +02:00
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
{% if g.user.role_admin() %}
|
2018-08-12 09:29:57 +02:00
|
|
|
<th data-halign="right" data-align="right" data-field="user" data-sortable="true">{{_('User')}}</th>
|
2018-07-30 20:12:41 +02:00
|
|
|
{% endif %}
|
2018-08-12 09:29:57 +02:00
|
|
|
<th data-halign="right" data-align="right" data-field="type" data-sortable="true">{{_('Task')}}</th>
|
|
|
|
<th data-halign="right" data-align="right" data-field="status" data-sortable="true">{{_('Status')}}</th>
|
|
|
|
<th data-halign="right" data-align="right" data-field="progress" data-sortable="true" data-sorter="elementSorter">{{_('Progress')}}</th>
|
|
|
|
<th data-halign="right" data-align="right" data-field="runtime" data-sortable="true" data-sort-name="rt">{{_('Runtime')}}</th>
|
|
|
|
<th data-halign="right" data-align="right" data-field="starttime" data-sortable="true" data-sort-name="id">{{_('Starttime')}}</th>
|
|
|
|
<th data-field="id" data-visible="false"></th>
|
|
|
|
<th data-field="rt" data-visible="false"></th>
|
2018-07-30 20:12:41 +02:00
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
</table>
|
|
|
|
<!--div class="btn btn-default" id="tasks_delete">{{_('Delete finished tasks')}}</div>
|
|
|
|
<div class="btn btn-default" id="tasks_hide">{{_('Hide all tasks')}}</div-->
|
|
|
|
</div>
|
|
|
|
{% endblock %}
|
|
|
|
{% block js %}
|
2018-08-18 17:35:23 +02:00
|
|
|
<script src="{{ url_for('static', filename='js/libs/bootstrap-table/bootstrap-table.min.js') }}"></script>
|
2018-07-30 20:12:41 +02:00
|
|
|
<script>
|
|
|
|
$('#table').bootstrapTable({
|
|
|
|
formatNoMatches: function () {
|
|
|
|
return '';
|
|
|
|
},
|
|
|
|
striped: true
|
|
|
|
});
|
|
|
|
setInterval(function() {
|
|
|
|
$.ajax({
|
|
|
|
method:"get",
|
|
|
|
url: "{{'/ajax/emailstat'}}",
|
|
|
|
async: true,
|
|
|
|
timeout: 900,
|
|
|
|
success:function(data){
|
|
|
|
$('#table').bootstrapTable("load", data);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}, 1000);
|
2018-08-12 09:29:57 +02:00
|
|
|
function elementSorter(a, b) {
|
|
|
|
a = +a.slice(0, -2);
|
|
|
|
b = +b.slice(0, -2);
|
|
|
|
if (a > b) return 1;
|
|
|
|
if (a < b) return -1;
|
|
|
|
return 0;
|
|
|
|
}
|
2018-07-30 20:12:41 +02:00
|
|
|
</script>
|
|
|
|
|
|
|
|
{% endblock %}
|