Merge branch 'improve_celery_info_on_dashboard' into 'master'

Improve celery infos on Dashboard

See merge request allianceauth/allianceauth!1384
This commit is contained in:
Ariel Rin
2022-02-26 05:15:30 +00:00
17 changed files with 623 additions and 52 deletions

View File

@@ -0,0 +1,12 @@
{% load humanize %}
<div
class="progress-bar progress-bar-{{ level }} task-status-progress-bar"
role="progressbar"
aria-valuenow="{% widthratio tasks_count tasks_total 100 %}"
aria-valuemin="0"
aria-valuemax="100"
style="width: {% widthratio tasks_count tasks_total 100 %}%;"
title="{{ tasks_count|intcomma }} {{ label }}">
{% widthratio tasks_count tasks_total 100 %}%
</div>

View File

@@ -1,4 +1,6 @@
{% load i18n %}
{% load humanize %}
<div class="col-sm-12">
<div class="row vertical-flexbox-row2">
<div class="col-sm-6">
@@ -75,29 +77,20 @@
<div class="panel panel-primary" style="height:50%;">
<div class="panel-heading text-center"><h3 class="panel-title">{% translate "Task Queue" %}</h3></div>
<div class="panel-body flex-center-horizontal">
<p>
{% blocktranslate with total=tasks_total|intcomma latest=earliest_task|timesince|default_if_none:"?" %}
Status of {{ total }} processed tasks • last {{ latest }}</p>
{% endblocktranslate %}
<div class="progress" style="height: 21px;">
<div class="progress-bar
{% if task_queue_length > 500 %}
progress-bar-danger
{% elif task_queue_length > 100 %}
progress-bar-warning
{% else %}
progress-bar-success
{% endif %}
" role="progressbar" aria-valuenow="{% widthratio task_queue_length 500 100 %}"
aria-valuemin="0" aria-valuemax="100"
style="width: {% widthratio task_queue_length 500 100 %}%;">
</div>
{% include "allianceauth/admin-status/celery_bar_partial.html" with label="suceeded" level="success" tasks_count=tasks_succeeded %}
{% include "allianceauth/admin-status/celery_bar_partial.html" with label="retried" level="info" tasks_count=tasks_retried %}
{% include "allianceauth/admin-status/celery_bar_partial.html" with label="failed" level="danger" tasks_count=tasks_failed %}
</div>
{% if task_queue_length < 0 %}
{% translate "Error retrieving task queue length" %}
{% else %}
{% blocktrans trimmed count tasks=task_queue_length %}
{{ tasks }} task
{% plural %}
{{ tasks }} tasks
{% endblocktrans %}
{% endif %}
<p>
{% blocktranslate with queue_length=task_queue_length|default_if_none:"?"|intcomma %}
{{ queue_length }} queued tasks
{% endblocktranslate %}
</p>
</div>
</div>
</div>