{% extends "base.html" %}

{% block html_title %}Client list{% endblock %}

{% block page_title %}Client list{% endblock %}

{% block content %}
        {% if object_list %}
            <table border="1">
                <tr>
                    <td>
                        <b>Hostname</b>
                    </td>
                    <td>
                        <b>Address</b>
                    </td>
                    <td>
                        <b>Available</b>
                    </td>
                    <td>
                        <b>Has xsanio_client installed</b>
                    </td>
                </tr>
                {% for object in object_list %}
                    <tr>
                        <td>
                            <a href="{% url client_detail_view object.id %}">{{ object.host_name }}</a>
                        </td>
                        <td>
                            {{ object.ip_address }}
                        </td>
                        <td>
                            {% if object.is_unreachable %}
                                <p>No</p>
                            {% else %}
                                <p style="color:green">Yes</p>
                            {% endif %}
                        </td>
                        <td>
                            {% if object.has_client_installed %}
                                <p style="color:green">Yes</p>
                            {% else %}
                                {% if object.is_unreachable %}
                                    <p>No</p>
                                {% else %}
                                    <p style="color:red">No</p>
                                {% endif %}
                            {% endif %}
                        </td>
                    </tr>
                {% endfor %}
            </table>
        {% else %}
            <p>No clients discovered. Make sure that you run this application on MDC and have xsanio_backend launched in the background.</p>
        {% endif %}
        <p><a href="{% url home_view %}">Home</a></p>
{% endblock %}
