mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Merge pull request #2067 from SchrodingersGat/warning-improvements
Improve 'health status' warnings
This commit is contained in:
commit
2e1277839e
@ -36,9 +36,14 @@ def health_status(request):
|
|||||||
'email_configured': InvenTree.status.is_email_configured(),
|
'email_configured': InvenTree.status.is_email_configured(),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# The following keys are required to denote system health
|
||||||
|
health_keys = [
|
||||||
|
'django_q_running',
|
||||||
|
]
|
||||||
|
|
||||||
all_healthy = True
|
all_healthy = True
|
||||||
|
|
||||||
for k in status.keys():
|
for k in health_keys:
|
||||||
if status[k] is not True:
|
if status[k] is not True:
|
||||||
all_healthy = False
|
all_healthy = False
|
||||||
|
|
||||||
|
@ -71,11 +71,7 @@
|
|||||||
<a class='dropdown-toggle' data-toggle='dropdown' href="#">
|
<a class='dropdown-toggle' data-toggle='dropdown' href="#">
|
||||||
{% if user.is_staff %}
|
{% if user.is_staff %}
|
||||||
{% if not system_healthy %}
|
{% if not system_healthy %}
|
||||||
{% if not django_q_running %}
|
|
||||||
<span class='fas fa-exclamation-triangle icon-red'></span>
|
<span class='fas fa-exclamation-triangle icon-red'></span>
|
||||||
{% else %}
|
|
||||||
<span class='fas fa-exclamation-triangle icon-orange'></span>
|
|
||||||
{% endif %}
|
|
||||||
{% elif not up_to_date %}
|
{% elif not up_to_date %}
|
||||||
<span class='fas fa-info-circle icon-green'></span>
|
<span class='fas fa-info-circle icon-green'></span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
@ -96,11 +92,7 @@
|
|||||||
{% if system_healthy or not user.is_staff %}
|
{% if system_healthy or not user.is_staff %}
|
||||||
<span class='fas fa-server'></span>
|
<span class='fas fa-server'></span>
|
||||||
{% else %}
|
{% else %}
|
||||||
{% if not django_q_running %}
|
<span class='fas fa-server icon-red'></span>
|
||||||
<span class='fas fa-server icon-red'></span>
|
|
||||||
{% else %}
|
|
||||||
<span class='fas fa-server icon-orange'></span>
|
|
||||||
{% endif %}
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</span> {% trans "System Information" %}
|
</span> {% trans "System Information" %}
|
||||||
</a></li>
|
</a></li>
|
||||||
|
Loading…
Reference in New Issue
Block a user