{% extends 'generic/object.html' %}
{% load render_table from django_tables2 %}
{% comment %}
__author__ = "Andrea Dainese"
__contact__ = "andrea@adainese.it"
__copyright__ = "Copyright 2022, Andrea Dainese"
__license__ = "GPLv3"
{% endcomment %}
{% block controls %}
{% endblock controls %}
{% block tabs %}
{% endblock tabs %}
{% block content %}
    <div class="row mb-3">
        <div class="col col-md-6">
            <div class="card">
                <h5 class="card-header">MAC address table entry</h5>
                <div class="card-body">
                    <table class="table table-hover attr-table">
                        <tr>
                            <th scope="row">Device</th>
                            <td>
                                <a href="{% url 'dcim:device' object.interface.device.pk %}">{{ object.interface.device.name }}</a>
                            </td>
                        </tr>
                        <tr>
                            <th scope="row">Device role</th>
                            <td>
                                <a href="{% url 'dcim:devicerole' object.interface.device.device_role.pk %}">{{ object.interface.device.device_role.name }}</a>
                            </td>
                        </tr>
                        <tr>
                            <th scope="row">Interface</th>
                            <td>
                                <a href="{% url 'dcim:interface' object.interface.pk %}">{{ object.interface.name }}</a>
                            </td>
                        </tr>
                        <tr>
                            <th scope="row">IP Address</th>
                            <td>{{ object.ip_address }}</td>
                        </tr>
                        <tr>
                            <th scope="row">MAC Address</th>
                            <td>
                                {{ object.mac_address }}
                                {% if object.vendor %}({{ object.vendor }}){% endif %}
                            </td>
                        </tr>
                    </table>
                </div>
            </div>
            {% include 'inc/panels/custom_fields.html' %}
        </div>
        <div class="col col-md-6">
            {% include 'inc/panels/tags.html' %}
            {% include 'inc/panels/comments.html' %}
        </div>
    </div>
    <div class="row mb-3">
        <div class="col col-md-12">
            <div class="card">
                <h5 class="card-header">Relevant ARP address table entries</h5>
                <div class="card-body table-responsive">{% render_table arp_table %}</div>
            </div>
        </div>
    </div>
    <div class="row">
        <div class="col col-md-12">
            <div class="card">
                <h5 class="card-header">Relevant MAC address table entries</h5>
                <div class="card-body table-responsive">{% render_table macaddress_table %}</div>
            </div>
        </div>
    </div>
{% endblock content %}
