mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
Sort device IPs by address rather than by interface
This commit is contained in:
@ -601,7 +601,7 @@ def device(request, pk):
|
|||||||
secrets = device.secrets.all()
|
secrets = device.secrets.all()
|
||||||
|
|
||||||
# Find all IP addresses assigned to this device
|
# Find all IP addresses assigned to this device
|
||||||
ip_addresses = IPAddress.objects.filter(interface__device=device).select_related('interface').order_by('interface')
|
ip_addresses = IPAddress.objects.filter(interface__device=device).select_related('interface').order_by('address')
|
||||||
|
|
||||||
# Find any related devices for convenient linking in the UI
|
# Find any related devices for convenient linking in the UI
|
||||||
related_devices = []
|
related_devices = []
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td>{{ ip.interface }}</td>
|
|
||||||
<td>
|
<td>
|
||||||
<a href="{% url 'ipam:ipaddress' pk=ip.pk %}">{{ ip }}</a>
|
<a href="{% url 'ipam:ipaddress' pk=ip.pk %}">{{ ip }}</a>
|
||||||
</td>
|
</td>
|
||||||
|
<td>{{ ip.interface }}</td>
|
||||||
<td>
|
<td>
|
||||||
{% if device.primary_ip == ip %}
|
{% if device.primary_ip == ip %}
|
||||||
<span class="label label-success">Primary</span>
|
<span class="label label-success">Primary</span>
|
||||||
|
Reference in New Issue
Block a user