{% extends '_base_list.html' %}
{% load i18n %}
{% load common_tags %}

{% block table_head %}
    <th class="text-center">{% trans 'ID' %}</th>
    <th class="text-center">{% trans 'Username' %}</th>
    <th class="text-center">{% trans 'IP' %}</th>
    <th class="text-center">{% trans 'System user' %}</th>
    <th class="text-center">{% trans 'Command' %}</th>
    <th class="text-center">{% trans 'Success' %}</th>
    <th class="text-center">{% trans 'Finished' %}</th>
    <th class="text-center">{% trans 'Date start' %}</th>
    <th class="text-center">{% trans 'Time' %}</th>
{% endblock %}

{% block table_body %}
     {% for proxy_log in proxy_log_list %}
         <tr class="gradeX">
             <td class="text-center">
                 <a href="{% url 'audits:proxy-log-detail' pk=proxy_log.id %}">{{ proxy_log.id }}</a>
             </td>
             <td class="text-center">{{ proxy_log.username }}</td>
             <td class="text-center">{{ proxy_log.ip }}</td>
             <td class="text-center">{{ proxy_log.system_user.name }}</td>
             <td class="text-center">{{ proxy_log.command.count }}</td>
             <td class="text-center">
             {% if proxy_log.was_failed %}
                 <i class="fa fa-times text-danger"></i>
             {% else %}
                 <i class="fa fa-check text-navy"></i>
             {% endif %}
             </td>
             <td class="text-center">
             {% if proxy_log.is_finished %}
                 <i class="fa fa-times text-danger"></i>
             {% else %}
                 <i class="fa fa-check text-navy"></i>
             {% endif %}
             </td>
             <td class="text-center">{{ proxy_log.date_start }}</td>
             <td class="text-center">{{ proxy_log.date_finished }}</td>
         </tr>
     {% endfor %}
{% endblock %}

{% block custom_foot_js %}
    <script>
        $(document).ready(function() {
            $('table').DataTable({
                "searching": false,
                "paging": false,
                "order": []
            })
        })
    </script>
{% endblock %}

