pull/884/head
Louis Vézina 5 years ago
parent 57cdd2fce9
commit aeda5a768f

@ -39,12 +39,12 @@ class Scheduler:
def task_listener_add(event):
if event.job_id not in self.__running_tasks:
self.__running_tasks.append(event.job_id)
event_stream.write(type='task', action='insert')
event_stream.write(type='task')
def task_listener_remove(event):
if event.job_id in self.__running_tasks:
self.__running_tasks.remove(event.job_id)
event_stream.write(type='task', action='delete')
event_stream.write(type='task')
self.aps_scheduler.add_listener(task_listener_add, EVENT_JOB_SUBMITTED)
self.aps_scheduler.add_listener(task_listener_remove, EVENT_JOB_EXECUTED | EVENT_JOB_ERROR)

@ -28,6 +28,13 @@
{% block tail %}
<script>
$(document).ready(function () {
events.on('event', function (event) {
var event_json = JSON.parse(event);
if (event_json.type === 'task') {
table.ajax.reload();
}
});
var table = $('#tasks').DataTable( {
language: {
zeroRecords: 'No Task Scheduled.',

Loading…
Cancel
Save