mirror of
https://github.com/inventree/InvenTree.git
synced 2025-06-19 05:25:42 +00:00
Adds framework for "server health" display
- Adds global context object "system_healthy" (boolean) - Framework for running system health checks - Updated system info forms - Displays warning next to user menu if system health errors exist (cherry picked from commit ce6d626ab39147fc389de90815ca8baae2385d82)
This commit is contained in:
@ -16,11 +16,6 @@
|
||||
<div>
|
||||
<table class='table table-striped table-condensed'>
|
||||
<col width='25'>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>{% trans "Instance Name" %}</td>
|
||||
<td>{% inventree_instance_name %}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><span class='fas fa-hashtag'></span></td>
|
||||
<td>{% trans "InvenTree Version" %}</td><td><a href="https://github.com/inventree/InvenTree/releases">{% inventree_version %}</a></td>
|
||||
|
@ -52,7 +52,11 @@
|
||||
</button>
|
||||
</li>
|
||||
<li class='dropdown'>
|
||||
<a class='dropdown-toggle' data-toggle='dropdown' href="#"><span class="fas fa-user"></span> <b>{{ user.get_username }}</b></a>
|
||||
<a class='dropdown-toggle' data-toggle='dropdown' href="#">
|
||||
{% if not system_healthy %}
|
||||
<span title='{% trans "InvenTree server issues detected" %}' class='fas fa-exclamation-triangle icon-red'></span>
|
||||
{% endif %}
|
||||
<span class="fas fa-user"></span> <b>{{ user.get_username }}</b></a>
|
||||
<ul class='dropdown-menu'>
|
||||
{% if user.is_authenticated %}
|
||||
{% if user.is_staff %}
|
||||
@ -65,8 +69,15 @@
|
||||
<li><a href="{% url 'login' %}"><span class="fas fa-sign-in-alt"></span> {% trans "Login" %}</a></li>
|
||||
{% endif %}
|
||||
<hr>
|
||||
<li id='launch-stats'><a href='#'>
|
||||
{% if system_healthy %}
|
||||
<span class='fas fa-server'>
|
||||
{% else %}
|
||||
<span class='fas fa-exclamation-triangle icon-red'>
|
||||
{% endif %}
|
||||
</span> {% trans "System Information" %}
|
||||
</a></li>
|
||||
<li id='launch-about'><a href='#'><span class="fas fa-info-circle"></span> {% trans "About InvenTree" %}</a></li>
|
||||
<li id='launch-stats'><a href='#'><span class='fas fa-chart-pie'></span> {% trans "Statistics" %}</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
@ -4,6 +4,33 @@
|
||||
|
||||
<table class='table table-striped table-condensed'>
|
||||
<col width='25'>
|
||||
|
||||
<tr>
|
||||
<td colspan="3"><b>{% trans "Server" %}</b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><span class='fas fa-server'></span></td>
|
||||
<td>{% trans "Instance Name" %}</td>
|
||||
<td>{% inventree_instance_name %}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><span class='fas fa-exclamation-triangle'></span></td>
|
||||
<td>{% trans "Server status" %}</td>
|
||||
<td>
|
||||
{% if system_healthy %}
|
||||
<span class='label label-green'>{% trans "Healthy" %}</span>
|
||||
{% else %}
|
||||
<span class='label label-red'>{% trans "Issues detected" %}</span>
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
{% if not system_healthy %}
|
||||
{% for issue in system_issues %}
|
||||
<!-- TODO - Enumerate system issues here! -->
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
||||
<tr>
|
||||
<td colspan='3'><b>{% trans "Parts" %}</b></td>
|
||||
</tr>
|
||||
|
Reference in New Issue
Block a user