{% load static %}
{% load inventree_extras %}
{% load i18n %}

<table class='table table-striped table-condensed'>
    <col width='25'>

    <tr>
        <td colspan="3"><strong>{% trans "Server" %}</strong></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-database'></span></td>
        <td>{% trans "Database" %}</td>
        <td>{% inventree_db_engine %}</td>
    </tr>
    {% inventree_in_debug_mode as debug_mode %}
    {% if debug_mode %}
    <tr>
        <td><span class='fas fa-laptop-code'></span></td>
        <td>{% trans "Debug Mode" %}</td>
        <td>{% trans "Server is running in debug mode" %}</td>
    </tr>
    {% endif %}
    {% inventree_docker_mode as docker_mode %}
    {% if docker_mode %}
    <tr>
        <td><span class='fab fa-docker'></span></td>
        <td>{% trans "Docker Mode" %}</td>
        <td>{% trans "Server is deployed using docker" %}</td>
    </tr>
    {% endif %}
    <tr>
        <td><span class='fas fa-plug'></span></td>
        <td>{% trans "Plugin Support" %}</td>
        <td>
            {% plugins_enabled as p_en %}
            {% if p_en %}
            <span class='badge rounded-pill bg-success'>{% trans "Plugin support enabled" %}</span>
            {% else %}
            <span class='badge rounded-pill bg-warning'>{% trans "Plugin support disabled" %}</span>
            {% endif %}
        </td>
    </tr>
    {% if user.is_staff %}
    <tr>
        <td><span class='fas fa-server'></span></td>
        <td>{% trans "Server status" %}</td>
        <td>
            {% if system_healthy %}
            <span class='badge rounded-pill bg-success'>{% trans "Healthy" %}</span>
            {% else %}
            <span class='badge rounded-pill bg-warning'>{% trans "Issues detected" %}</span>
            {% endif %}
        </td>
    </tr>
    {% if not django_q_running %}
    <tr>
        <td><span class='fas fa-tasks'></span></td>
        <td>{% trans "Background Worker" %}</td>
        <td>
            <a href='{% inventree_docs_url %}/settings/tasks'>
                <span class='badge rounded-pill bg-danger'>{% trans "Background worker not running" %}</span>
            </a>
        </td>
    </tr>
    {% endif %}
    {% if not email_configured %}
    <tr>
        <td><span class='fas fa-envelope'></span></td>
        <td>{% trans "Email Settings" %}</td>
        <td>
            <a href='{% inventree_docs_url %}/settings/email'>
                <span class='badge rounded-pill bg-warning'>{% trans "Email settings not configured" %}</span>
            </a>
        </td>
    </tr>
    {% endif %}
    {% endif %}

    {% if not system_healthy %}
    {% for issue in system_issues %}
    <!-- TODO - Enumerate system issues here! -->
    {% endfor %}
    {% endif %}
</table>
