2017-08-18 14:37:19 -04:00
|
|
|
<tr class="interface{% if not iface.enabled %} danger{% endif %}">
|
2017-08-29 14:24:58 -04:00
|
|
|
{% if selectable and perms.dcim.change_interface or perms.dcim.delete_interface %}
|
2017-08-18 14:37:19 -04:00
|
|
|
<td class="pk">
|
|
|
|
<input name="pk" type="checkbox" value="{{ iface.pk }}" />
|
|
|
|
</td>
|
|
|
|
{% endif %}
|
|
|
|
<td>
|
|
|
|
<i class="fa fa-fw fa-square"></i> <span>{{ iface.name }}</span>
|
|
|
|
{% if iface.description %}
|
|
|
|
<i class="fa fa-fw fa-comment-o" title="{{ iface.description }}"></i>
|
|
|
|
{% endif %}
|
|
|
|
</td>
|
|
|
|
<td>{{ iface.mtu|default:"" }}</td>
|
|
|
|
<td>{{ iface.mac_address|default:"" }}</td>
|
|
|
|
<td class="text-right">
|
2017-08-29 15:26:35 -04:00
|
|
|
{% if perms.ipam.add_ipaddress %}
|
|
|
|
<a href="{% url 'ipam:ipaddress_add' %}?interface={{ iface.pk }}&return_url={{ vm.get_absolute_url }}" class="btn btn-xs btn-success" title="Add IP address">
|
|
|
|
<i class="glyphicon glyphicon-plus" aria-hidden="true"></i>
|
|
|
|
</a>
|
|
|
|
{% endif %}
|
2017-08-29 14:24:58 -04:00
|
|
|
{% if perms.dcim.change_interface %}
|
|
|
|
<a href="{% url 'virtualization:interface_edit' pk=iface.pk %}" class="btn btn-info btn-xs" title="Edit interface">
|
2017-08-18 14:37:19 -04:00
|
|
|
<i class="glyphicon glyphicon-pencil" aria-hidden="true"></i>
|
|
|
|
</a>
|
|
|
|
{% endif %}
|
2017-08-29 14:24:58 -04:00
|
|
|
{% if perms.dcim.delete_interface %}
|
|
|
|
<a href="{% url 'virtualization:interface_delete' pk=iface.pk %}" class="btn btn-danger btn-xs" title="Delete interface">
|
2017-08-18 14:37:19 -04:00
|
|
|
<i class="glyphicon glyphicon-trash" aria-hidden="true"></i>
|
|
|
|
</a>
|
|
|
|
{% endif %}
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
{% for ip in iface.ip_addresses.all %}
|
|
|
|
<tr class="ipaddress">
|
|
|
|
{% if selectable and perms.dcim.change_interface or perms.dcim.delete_interface %}
|
|
|
|
<td></td>
|
|
|
|
{% endif %}
|
2017-08-29 15:26:35 -04:00
|
|
|
<td>
|
2017-08-18 14:37:19 -04:00
|
|
|
<a href="{% url 'ipam:ipaddress' pk=ip.pk %}">{{ ip }}</a>
|
|
|
|
{% if ip.description %}
|
|
|
|
<i class="fa fa-fw fa-comment-o" title="{{ ip.description }}"></i>
|
|
|
|
{% endif %}
|
2017-08-31 12:50:35 -04:00
|
|
|
{% if vm.primary_ip4 == ip or vm.primary_ip6 == ip %}
|
2017-08-18 14:37:19 -04:00
|
|
|
<span class="label label-success">Primary</span>
|
|
|
|
{% endif %}
|
|
|
|
</td>
|
|
|
|
<td class="text-right">
|
|
|
|
{% if ip.vrf %}
|
|
|
|
<a href="{% url 'ipam:vrf' pk=ip.vrf.pk %}">{{ ip.vrf }}</a>
|
|
|
|
{% else %}
|
|
|
|
<span class="text-muted">Global</span>
|
|
|
|
{% endif %}
|
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
<span class="label label-{{ ip.get_status_class }}">{{ ip.get_status_display }}</span>
|
|
|
|
</td>
|
|
|
|
<td class="text-right">
|
|
|
|
{% if perms.ipam.change_ipaddress %}
|
2017-08-31 12:50:35 -04:00
|
|
|
<a href="{% url 'ipam:ipaddress_edit' pk=ip.pk %}?return_url={{ vm.get_absolute_url }}" class="btn btn-info btn-xs">
|
2017-08-18 14:37:19 -04:00
|
|
|
<i class="glyphicon glyphicon-pencil" aria-hidden="true" title="Edit IP address"></i>
|
|
|
|
</a>
|
|
|
|
{% endif %}
|
|
|
|
{% if perms.ipam.delete_ipaddress %}
|
2017-08-31 12:50:35 -04:00
|
|
|
<a href="{% url 'ipam:ipaddress_delete' pk=ip.pk %}?return_url={{ vm.get_absolute_url }}" class="btn btn-danger btn-xs">
|
2017-08-18 14:37:19 -04:00
|
|
|
<i class="glyphicon glyphicon-trash" aria-hidden="true" title="Delete IP address"></i>
|
|
|
|
</a>
|
|
|
|
{% endif %}
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
{% endfor %}
|