1
0
Fork 0
mirror of https://github.com/morpheus65535/bazarr synced 2024-12-24 16:52:06 +00:00
bazarr/views/systemtasks.html

83 lines
2.4 KiB
HTML
Raw Normal View History

2020-02-20 11:41:05 +00:00
{% extends '_main.html' %}
2020-02-22 14:03:58 +00:00
{% block title %}Tasks - Bazarr{% endblock %}
2020-02-20 11:41:05 +00:00
{% block bcleft %}
{% endblock bcleft %}
{% block bcright %}
{% endblock bcright %}
{% block body %}
<div class="container-fluid">
<table id="tasks" class="table table-striped" style="width:100%">
<thead>
<tr>
<th>Name</th>
<th>Execution Frequency</th>
<th>Next Execution</th>
<th></th>
</tr>
</thead>
</table>
</div>
{% endblock body %}
{% block tail %}
<script>
$(document).ready(function () {
var table = $('#tasks').DataTable( {
language: {
zeroRecords: 'No Task Scheduled.',
processing: "Loading Tasks..."
},
paging: false,
lengthChange: false,
pageLength: {{ settings.general.page_size }},
searching: false,
ordering: false,
processing: true,
serverSide: false,
2020-02-22 14:03:58 +00:00
ajax: {
url: "{{ url_for('api.systemtasks') }}",
type: 'GET'
},
2020-02-20 11:41:05 +00:00
columns: [
{
data: 'name'
},
{ data: 'interval'
},
{ data: 'next_run_in'
},
{ data: null,
render: function(data) {
2020-02-22 14:03:58 +00:00
if (data.job_running) {
return '<i class="execute fas fa-sync fa-spin" data-taskid="'+data.job_id+'"></i>';
} else {
return '<i class="execute fas fa-sync" data-taskid="'+data.job_id+'"></i>';
}
2020-02-20 11:41:05 +00:00
}
}
]
});
2020-02-22 14:03:58 +00:00
$('#tasks').on('click', '.execute', function(e){
e.preventDefault();
const values = {
'taskid': $(this).data("taskid")
};
$.ajax({
url: "{{ url_for('api.systemtasks') }}",
method: "POST",
data: JSON.stringify(values),
contentType: "application/json"
});
});
2020-02-20 11:41:05 +00:00
})
</script>
{% endblock tail %}