mirror of
https://github.com/morpheus65535/bazarr.git
synced 2025-02-24 23:07:36 +08:00
WIP
This commit is contained in:
parent
fcbb2300a3
commit
44f090fd92
6 changed files with 75 additions and 3 deletions
|
@ -103,6 +103,15 @@ class SystemLogs(Resource):
|
|||
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):
|
||||
def get(self):
|
||||
system_status = {}
|
||||
|
@ -1123,6 +1132,7 @@ api.add_resource(Languages, '/languages')
|
|||
|
||||
api.add_resource(SystemTasks, '/systemtasks')
|
||||
api.add_resource(SystemLogs, '/systemlogs')
|
||||
api.add_resource(SystemProviders, '/systemproviders')
|
||||
api.add_resource(SystemStatus, '/systemstatus')
|
||||
api.add_resource(SystemReleases, '/systemreleases')
|
||||
|
||||
|
|
|
@ -1028,6 +1028,12 @@ def systemlogs():
|
|||
return render_template('systemlogs.html')
|
||||
|
||||
|
||||
@app.route('/systemproviders')
|
||||
@login_required
|
||||
def systemproviders():
|
||||
return render_template('systemproviders.html')
|
||||
|
||||
|
||||
@app.route('/systemstatus')
|
||||
@login_required
|
||||
def systemstatus():
|
||||
|
|
|
@ -190,7 +190,7 @@
|
|||
<ul aria-expanded="false" class="collapse">
|
||||
<li><a href="{{ url_for('systemtasks') }}"> Tasks</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('systemreleases') }}"> Releases</a></li>
|
||||
</ul>
|
||||
|
|
|
@ -56,8 +56,8 @@
|
|||
<tr>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th>Message:</th>
|
||||
<th>Time:</th>
|
||||
<th>Message</th>
|
||||
<th>Time</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
|
55
views/systemproviders.html
Normal file
55
views/systemproviders.html
Normal file
|
@ -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,
|
||||
searching: false,
|
||||
ordering: false,
|
||||
info: false,
|
||||
processing: true,
|
||||
serverSide: false,
|
||||
ajax: {
|
||||
|
|
Loading…
Reference in a new issue