pull/884/head
Louis Vézina 5 years ago
parent fcbb2300a3
commit 44f090fd92

@ -103,6 +103,15 @@ class SystemLogs(Resource):
return jsonify(data=logs) return jsonify(data=logs)
class SystemProviders(Resource):
def get(self):
throttled_providers = list_throttled_providers()
for i in range(len(throttled_providers)):
throttled_providers[i][1] = throttled_providers[i][1] if throttled_providers[i][1] is not None else "Good"
throttled_providers[i][2] = throttled_providers[i][2] if throttled_providers[i][2] != "now" else "-"
return jsonify(data=throttled_providers)
class SystemStatus(Resource): class SystemStatus(Resource):
def get(self): def get(self):
system_status = {} system_status = {}
@ -1123,6 +1132,7 @@ api.add_resource(Languages, '/languages')
api.add_resource(SystemTasks, '/systemtasks') api.add_resource(SystemTasks, '/systemtasks')
api.add_resource(SystemLogs, '/systemlogs') api.add_resource(SystemLogs, '/systemlogs')
api.add_resource(SystemProviders, '/systemproviders')
api.add_resource(SystemStatus, '/systemstatus') api.add_resource(SystemStatus, '/systemstatus')
api.add_resource(SystemReleases, '/systemreleases') api.add_resource(SystemReleases, '/systemreleases')

@ -1028,6 +1028,12 @@ def systemlogs():
return render_template('systemlogs.html') return render_template('systemlogs.html')
@app.route('/systemproviders')
@login_required
def systemproviders():
return render_template('systemproviders.html')
@app.route('/systemstatus') @app.route('/systemstatus')
@login_required @login_required
def systemstatus(): def systemstatus():

@ -190,7 +190,7 @@
<ul aria-expanded="false" class="collapse"> <ul aria-expanded="false" class="collapse">
<li><a href="{{ url_for('systemtasks') }}"> Tasks</a></li> <li><a href="{{ url_for('systemtasks') }}"> Tasks</a></li>
<li><a href="{{ url_for('systemlogs') }}"> Logs</a></li> <li><a href="{{ url_for('systemlogs') }}"> Logs</a></li>
<li><a href="/"> Providers</a></li> <li><a href="{{ url_for('systemproviders') }}"> Providers</a></li>
<li><a href="{{ url_for('systemstatus') }}"> Status</a></li> <li><a href="{{ url_for('systemstatus') }}"> Status</a></li>
<li><a href="{{ url_for('systemreleases') }}"> Releases</a></li> <li><a href="{{ url_for('systemreleases') }}"> Releases</a></li>
</ul> </ul>

@ -56,8 +56,8 @@
<tr> <tr>
<th></th> <th></th>
<th></th> <th></th>
<th>Message:</th> <th>Message</th>
<th>Time:</th> <th>Time</th>
<th></th> <th></th>
</tr> </tr>
</thead> </thead>

@ -0,0 +1,55 @@
{% extends '_main.html' %}
{% block title %}Logs - Bazarr{% endblock %}
{% block head %}
{% endblock head %}
{% block bcleft %}
{% endblock bcleft %}
{% block bcright %}
{% endblock bcright %}
{% block body %}
<div class="container-fluid">
<table id="providers" class="table table-striped" style="width:100%">
<thead>
<tr>
<th>Name</th>
<th>Status</th>
<th>Next Retry</th>
</tr>
</thead>
</table>
</div>
{% endblock body %}
{% block tail %}
<script>
$(document).ready(function () {
var table = $('#providers').DataTable( {
language: {
zeroRecords: 'No providers enabled.',
processing: "Loading Providers..."
},
paging: false,
lengthChange: false,
searching: false,
ordering: false,
info: false,
processing: true,
serverSide: false,
ajax: "{{ url_for('api.systemproviders') }}",
columns: [
{ data: 0 },
{ data: 1 },
{ data: 2 }
]
});
})
</script>
{% endblock tail %}

@ -54,6 +54,7 @@
lengthChange: false, lengthChange: false,
searching: false, searching: false,
ordering: false, ordering: false,
info: false,
processing: true, processing: true,
serverSide: false, serverSide: false,
ajax: { ajax: {

Loading…
Cancel
Save