mirror of
https://gitlab.com/allianceauth/allianceauth.git
synced 2025-07-16 16:00:17 +02:00
Improve celery bar by using decimalized width values (2 decimal places) to reduce likelyhood of an empty portion of the bar.
This commit is contained in:
parent
da93940e13
commit
8cdc5af453
@ -1,11 +1,12 @@
|
|||||||
{% load humanize %}
|
{% load humanize %}
|
||||||
|
{% load admin_status %}
|
||||||
|
|
||||||
<div
|
<div
|
||||||
class="progress-bar progress-bar-{{ level }} task-status-progress-bar"
|
class="progress-bar progress-bar-{{ level }} task-status-progress-bar"
|
||||||
role="progressbar"
|
role="progressbar"
|
||||||
aria-valuenow="{% widthratio tasks_count tasks_total 100 %}"
|
aria-valuenow="{% decimal_widthratio tasks_count tasks_total 100 %}"
|
||||||
aria-valuemin="0"
|
aria-valuemin="0"
|
||||||
aria-valuemax="100"
|
aria-valuemax="100"
|
||||||
style="width: {% widthratio tasks_count tasks_total 100 %}%;">
|
style="width: {% decimal_widthratio tasks_count tasks_total 100 %}%;">
|
||||||
{% widthratio tasks_count tasks_total 100 %}%
|
{% widthratio tasks_count tasks_total 100 %}%
|
||||||
</div>
|
</div>
|
||||||
|
@ -36,6 +36,11 @@ GITLAB_AUTH_ANNOUNCEMENT_ISSUES_URL = (
|
|||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
|
@register.simple_tag()
|
||||||
|
def decimal_widthratio(this_value, max_value, max_width) -> str:
|
||||||
|
return str(round(this_value/max_value * max_width, 2))
|
||||||
|
|
||||||
|
|
||||||
@register.inclusion_tag('allianceauth/admin-status/overview.html')
|
@register.inclusion_tag('allianceauth/admin-status/overview.html')
|
||||||
def status_overview() -> dict:
|
def status_overview() -> dict:
|
||||||
response = {
|
response = {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user