Adds celery status view
This commit is contained in:
parent
fcf796abe1
commit
0f55b76a93
6 changed files with 119 additions and 0 deletions
59
bookwyrm/templates/settings/celery.html
Normal file
59
bookwyrm/templates/settings/celery.html
Normal file
|
@ -0,0 +1,59 @@
|
|||
{% extends 'settings/layout.html' %}
|
||||
{% load humanize %}
|
||||
{% load i18n %}
|
||||
{% load celery_tags %}
|
||||
|
||||
{% block title %}{% trans "Celery Status" %}{% endblock %}
|
||||
|
||||
{% block header %}{% trans "Celery Status" %}{% endblock %}
|
||||
|
||||
{% block panel %}
|
||||
|
||||
{% if stats %}
|
||||
<section class="block content">
|
||||
<h2>{% trans "Workers" %}</h2>
|
||||
|
||||
{% for worker_name, worker in stats.items %}
|
||||
<div class="box">
|
||||
<h3>{{ worker_name }}</h3>
|
||||
{% trans "Uptime:" %} {{ worker.uptime|uptime }}
|
||||
</div>
|
||||
{% endfor %}
|
||||
</section>
|
||||
|
||||
|
||||
<section class="block content">
|
||||
<h2>{% trans "Active Tasks" %}</h2>
|
||||
{% for worker in active_tasks.values %}
|
||||
<div class="table-container">
|
||||
<table class="table is-striped is-fullwidth">
|
||||
<tr>
|
||||
<th>{% trans "ID" %}</th>
|
||||
<th>{% trans "Task name" %}</th>
|
||||
<th>{% trans "Start time" %}</th>
|
||||
<th>{% trans "Priority" %}</th>
|
||||
</tr>
|
||||
{% for task in worker %}
|
||||
<tr>
|
||||
<td>{{ task.id }}</td>
|
||||
<td>{{ task.name|shortname }}</td>
|
||||
<td>{{ task.time_start|datestamp }} (UTC)</td>
|
||||
<td>{{ task.delivery_info.routing_key }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</section>
|
||||
|
||||
{% else %}
|
||||
|
||||
<div class="notification is-danger is-flex is-align-items-start">
|
||||
<span class="icon icon-warning is-size-4 pr-3" aria-hidden="true"></span>
|
||||
<span>
|
||||
{% trans "Could not connect to Celery" %}
|
||||
</span>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% endblock %}
|
|
@ -74,6 +74,15 @@
|
|||
</li>
|
||||
</ul>
|
||||
{% endif %}
|
||||
{% if perms.edit_instance_settings %}
|
||||
<h2 class="menu-label">{% trans "System" %}</h2>
|
||||
<ul class="menu-list">
|
||||
<li>
|
||||
{% url 'settings-celery' as url %}
|
||||
<a href="{{ url }}"{% if url in request.path %} class="is-active" aria-selected="true"{% endif %}>{% trans "Celery status" %}</a>
|
||||
</li>
|
||||
</ul>
|
||||
{% endif %}
|
||||
{% if perms.bookwyrm.edit_instance_settings %}
|
||||
<h2 class="menu-label">{% trans "Instance Settings" %}</h2>
|
||||
<ul class="menu-list">
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue