1
0
Fork 0

Show queues and runtime instead of start time

This commit is contained in:
Mouse Reeve 2022-09-15 10:42:27 -07:00
parent 3739bdbf81
commit d76eae358f
3 changed files with 92 additions and 16 deletions

View file

@ -9,19 +9,41 @@
{% block panel %}
{% if stats %}
{% if queues %}
<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 }}
<h2>{% trans "Queues" %}</h2>
<div class="columns has-text-centered">
<div class="column is-4">
<div class="notification">
<p class="header">{% trans "Low priority" %}</p>
<p class="title is-5">{{ queues.low_priority|intcomma }}</p>
</div>
</div>
<div class="column is-4">
<div class="notification">
<p class="header">{% trans "Medium priority" %}</p>
<p class="title is-5">{{ queues.medium_priority|intcomma }}</p>
</div>
</div>
<div class="column is-4">
<div class="notification">
<p class="header">{% trans "High priority" %}</p>
<p class="title is-5">{{ queues.high_priority|intcomma }}</p>
</div>
</div>
</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 Redis broker" %}
</span>
</div>
{% endif %}
{% if stats %}
<section class="block content">
<h2>{% trans "Active Tasks" %}</h2>
{% for worker in active_tasks.values %}
@ -30,14 +52,14 @@
<tr>
<th>{% trans "ID" %}</th>
<th>{% trans "Task name" %}</th>
<th>{% trans "Start time" %}</th>
<th>{% trans "Run 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.time_start|runtime }}</td>
<td>{{ task.delivery_info.routing_key }}</td>
</tr>
{% endfor %}
@ -46,6 +68,17 @@
{% endfor %}
</section>
<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>
{% else %}
<div class="notification is-danger is-flex is-align-items-start">
@ -56,4 +89,14 @@
</div>
{% endif %}
{% if errors %}
<div class="block content">
<h2>{% trans "Errors" %}</h2>
{% for error in errors %}
<pre>{{ error }}</pre>
{% endfor %}
</div>
{% endif %}
{% endblock %}