<commit_before><tr class="interface{% if not iface.enabled %} danger{% elif iface.connected_endpoint %} {% if iface.connection_status %}success{% else %}info{% endif %}{% elif iface.circuit_termination %} success{% elif iface.is_virtual %} warning{% endif %}" id="iface_{{ iface.name }}">

    {# Checkbox #}
    {% if perms.dcim.change_interface or perms.dcim.delete_interface %}
        <td class="pk">
            <input name="pk" type="checkbox" value="{{ iface.pk }}" />
        </td>
    {% endif %}

    {# Icon and name #}
    <td>
        <span title="{{ iface.get_form_factor_display }}">
            <i class="fa fa-fw fa-{% if iface.mgmt_only %}wrench{% elif iface.is_lag %}align-justify{% elif iface.is_virtual %}circle{% elif iface.is_wireless %}wifi{% else %}exchange{% endif %}"></i>
            <a href="{{ iface.get_absolute_url }}">{{ iface }}</a>
        </span>
    </td>

    {# LAG #}
    <td>
        {% if iface.lag %}
            <a href="#iface_{{ iface.lag }}" class="label label-default">{{ iface.lag }}</a>
        {% endif %}
    </td>

    {# Description #}
    <td>{{ iface.description|default:"&mdash;" }}</td>

    {# 802.1Q mode #}
    <td>{{ iface.get_mode_display|default:"&mdash;" }}</td>

    {# Cable #}
    <td>
        {% if iface.cable %}
            <a href="{{ iface.cable.get_absolute_url }}">{{ iface.cable }}</a>
            <a href="{% url 'dcim:interface_trace' pk=iface.pk %}" class="btn btn-primary btn-xs" title="Trace">
                <i class="fa fa-share-alt" aria-hidden="true"></i>
            </a>
        {% else %}
            &mdash;
        {% endif %}
    </td>

    {# Connection or type #}
    {% if iface.is_lag %}
        <td colspan="2" class="text-muted">
            LAG interface<br />
            <small class="text-muted">{{ iface.member_interfaces.all|join:", "|default:"No members" }}</small>
        </td>
    {% elif iface.is_virtual %}
        <td colspan="2" class="text-muted">Virtual interface</td>
    {% elif iface.is_wireless %}
        <td colspan="2" class="text-muted">Wireless interface</td>
    {% elif iface.connected_endpoint.name %}
        {# Connected to an Interface #}
        <td>
            <a href="{% url 'dcim:device' pk=iface.connected_endpoint.device.pk %}">{{ iface.connected_endpoint.device }}</a>
        </td>
        <td>
            <a href="{% url 'dcim:interface' pk=iface.connected_endpoint.pk %}"><span title="{{ iface.connected_endpoint.get_form_factor_display }}">{{ iface.connected_endpoint }}</span></a>
        </td>
    {% elif iface.connected_endpoint.term_side %}
        {# Connected to a CircuitTermination #}
        {% with iface.connected_endpoint.get_peer_termination as peer_termination %}
            <td colspan="2">
                <i class="fa fa-fw fa-globe" title="Circuit"></i>
                {% if peer_termination %}
                    {% if peer_termination.interface %}
                        <a href="{% url 'dcim:device' pk=peer_termination.interface.device.pk %}">{{ peer_termination.interface.device }}</a>
                        (<a href="{% url 'dcim:site' slug=peer_termination.site.slug %}">{{ peer_termination.site }}</a>)
                    {% else %}
                        <a href="{% url 'dcim:site' slug=peer_termination.site.slug %}">{{ peer_termination.site }}</a>
                    {% endif %}
                    via
                {% endif %}
                <a href="{% url 'circuits:circuit' pk=iface.connected_endpoint.circuit_id %}">{{ iface.connected_endpoint.circuit }}</a>
            </td>
        {% endwith %}
    {% else %}
        <td colspan="2">
            <span class="text-muted">Not connected</span>
        </td>
    {% endif %}

    {# Buttons #}
    <td class="text-right text-nowrap">
        {% if show_graphs %}
            {% if iface.connected_endpoint %}
                <button type="button" class="btn btn-primary btn-xs" data-toggle="modal" data-target="#graphs_modal" data-obj="{{ device.name }} - {{ iface.name }}" data-url="{% url 'dcim-api:interface-graphs' pk=iface.pk %}" title="Show graphs">
                    <i class="glyphicon glyphicon-signal" aria-hidden="true"></i>
                </button>
            {% endif %}
        {% endif %}
        {% if perms.ipam.add_ipaddress %}
            <a href="{% url 'ipam:ipaddress_add' %}?interface={{ iface.pk }}&return_url={{ device.get_absolute_url }}" class="btn btn-xs btn-success" title="Add IP address"><commit_msg>Tweaked display of connected circuits<commit_after><tr class="interface{% if not iface.enabled %} danger{% elif iface.connected_endpoint %} {% if iface.connection_status %}success{% else %}info{% endif %}{% elif iface.circuit_termination %} success{% elif iface.is_virtual %} warning{% endif %}" id="iface_{{ iface.name }}">

    {# Checkbox #}
    {% if perms.dcim.change_interface or perms.dcim.delete_interface %}
        <td class="pk">
            <input name="pk" type="checkbox" value="{{ iface.pk }}" />
        </td>
    {% endif %}

    {# Icon and name #}
    <td class="text-nowrap">
        <span title="{{ iface.get_form_factor_display }}">
            <i class="fa fa-fw fa-{% if iface.mgmt_only %}wrench{% elif iface.is_lag %}align-justify{% elif iface.is_virtual %}circle{% elif iface.is_wireless %}wifi{% else %}exchange{% endif %}"></i>
            <a href="{{ iface.get_absolute_url }}">{{ iface }}</a>
        </span>
    </td>

    {# LAG #}
    <td>
        {% if iface.lag %}
            <a href="#iface_{{ iface.lag }}" class="label label-default">{{ iface.lag }}</a>
        {% endif %}
    </td>

    {# Description #}
    <td>{{ iface.description|default:"&mdash;" }}</td>

    {# 802.1Q mode #}
    <td>{{ iface.get_mode_display|default:"&mdash;" }}</td>

    {# Cable #}
    <td class="text-nowrap">
        {% if iface.cable %}
            <a href="{{ iface.cable.get_absolute_url }}">{{ iface.cable }}</a>
            <a href="{% url 'dcim:interface_trace' pk=iface.pk %}" class="btn btn-primary btn-xs" title="Trace">
                <i class="fa fa-share-alt" aria-hidden="true"></i>
            </a>
        {% else %}
            &mdash;
        {% endif %}
    </td>

    {# Connection or type #}
    {% if iface.is_lag %}
        <td colspan="2" class="text-muted">
            LAG interface<br />
            <small class="text-muted">{{ iface.member_interfaces.all|join:", "|default:"No members" }}</small>
        </td>
    {% elif iface.is_virtual %}
        <td colspan="2" class="text-muted">Virtual interface</td>
    {% elif iface.is_wireless %}
        <td colspan="2" class="text-muted">Wireless interface</td>
    {% elif iface.connected_endpoint.name %}
        {# Connected to an Interface #}
        <td>
            <a href="{% url 'dcim:device' pk=iface.connected_endpoint.device.pk %}">{{ iface.connected_endpoint.device }}</a>
        </td>
        <td>
            <a href="{% url 'dcim:interface' pk=iface.connected_endpoint.pk %}"><span title="{{ iface.connected_endpoint.get_form_factor_display }}">{{ iface.connected_endpoint }}</span></a>
        </td>
    {% elif iface.connected_endpoint.term_side %}
        {# Connected to a CircuitTermination #}
        {% with iface.connected_endpoint.get_peer_termination as peer_termination %}
            {% if peer_termination %}
                {% if peer_termination.connected_endpoint %}
                    <td>
                        <a href="{% url 'dcim:device' pk=peer_termination.connected_endpoint.device.pk %}">{{ peer_termination.connected_endpoint.device }}</a><br/>
                        <small>via <i class="fa fa-fw fa-globe" title="Circuit"></i> <a href="{% url 'circuits:circuit' pk=iface.connected_endpoint.circuit_id %}">{{ iface.connected_endpoint.circuit }}</a></small>
                    </td>
                    <td>
                        {{ peer_termination.connected_endpoint }}
                    </td>
                {% else %}
                    <td colspan="2">
                        <a href="{% url 'dcim:site' slug=peer_termination.site.slug %}">{{ peer_termination.site }}</a>
                        via <i class="fa fa-fw fa-globe" title="Circuit"></i> <a href="{% url 'circuits:circuit' pk=iface.connected_endpoint.circuit_id %}">{{ iface.connected_endpoint.circuit }}</a>
                    </td>
                {% endif %}
            {% else %}
                <td colspan="2">
                    <i class="fa fa-fw fa-globe" title="Circuit"></i>
                    <a href="{% url 'circuits:circuit' pk=iface.connected_endpoint.circuit_id %}">{{ iface.connected_endpoint.circuit }}</a>
                </td>
            {% endif %}
        {% endwith %}
    {% else %}
        <td colspan="2">
            <span class="text-muted">Not connected</span>
        </td>
    {% endif %}

    {# Buttons #}
    <td class="text-right text-nowrap">
        {% if show_graphs %}
            {% if iface.connected_endpoint %}
                <button type="button" class="btn btn-primary btn-xs" data-toggle="modal" data-target="#graphs_modal" data-obj="{{ device.name }} - {{ iface.name }}" data-url="{% url 'dcim-api:interface-graphs' pk=iface.pk %}" title="Show graphs">
                    <i class="glyphicon glyphicon-signal" aria-hidden="true"></i>
                </button>
            {% endif %}
        {% endif %}
        {% if perms.ipam.add_ipaddress %}
            <a href="{% url 'ipam:ipaddress_add' %}?interface={{ iface.pk }}&return_url={{ device.get_absolute_url }}" class="btn btn-xs btn-success" title="Add IP address">
{'fraction_non_alphanumeric': 0.18096332671612161, 'fraction_numerical': 0.001985163514784244, 'mean_word_length': 2.29955187866253, 'pattern_counts': {'":': 0, '<': 156, '<?xml version=': 0, '>': 156, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2221033', 'n_tokens_mistral': 3280, 'n_tokens_neox': 2944, 'n_words': 604}