Added feature to send emails in a background-task
This commit is contained in:
@@ -67,6 +67,9 @@
|
||||
</li>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% if g.user.role_admin() %}
|
||||
<li><a id="top_tasks" href="{{url_for('get_tasks_status')}}"><span class="glyphicon glyphicon-tasks"></span><span class="hidden-sm"> {{_('Tasks')}}</span></a></li>
|
||||
{% endif %}
|
||||
{% if g.user.role_admin() %}
|
||||
<li><a id="top_admin" href="{{url_for('admin')}}"><span class="glyphicon glyphicon-dashboard"></span><span class="hidden-sm"> {{_('Admin')}}</span></a></li>
|
||||
{% endif %}
|
||||
@@ -222,6 +225,7 @@
|
||||
</div>
|
||||
{% block modal %}{% endblock %}
|
||||
|
||||
|
||||
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
|
||||
<!--script src="https://code.jquery.com/jquery.js"></script-->
|
||||
<script src="{{ url_for('static', filename='js/libs/jquery.min.js') }}"></script>
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
{% extends "layout.html" %}
|
||||
{% block header %}
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-table/1.8.1/bootstrap-table.css">
|
||||
{% endblock %}
|
||||
{% block body %}
|
||||
<div class="discover">
|
||||
<h2>{{_('Tasks list')}}</h2>
|
||||
<table class="table table-no-bordered" id="table" data-url="{{'/ajax/emailstat'}}">
|
||||
<thead>
|
||||
<tr>
|
||||
{% if g.user.role_admin() %}
|
||||
<th data-field="user">{{_('User')}}</th>
|
||||
{% endif %}
|
||||
<th data-field="type">{{_('Task')}}</th>
|
||||
<th data-field="status">{{_('Status')}}</th>
|
||||
<th data-field="progress">{{_('Progress')}}</th>
|
||||
<th data-field="runtime">{{_('Runtime')}}</th>
|
||||
<th data-field="starttime">{{_('Starttime')}}</th>
|
||||
</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 %}
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-table/1.8.1/bootstrap-table.js"></script>
|
||||
<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);
|
||||
</script>
|
||||
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user