mirror of
				https://github.com/netbox-community/netbox.git
				synced 2024-05-10 07:54:54 +00:00 
			
		
		
		
	Closes #5592: Add IP addresses count to VRF view
This commit is contained in:
		@@ -4,6 +4,7 @@
 | 
			
		||||
 | 
			
		||||
### Enhancements
 | 
			
		||||
 | 
			
		||||
* [#5592](https://github.com/netbox-community/netbox/issues/5592) - Add IP addresses count to VRF view
 | 
			
		||||
* [#5630](https://github.com/netbox-community/netbox/issues/5630) - Add QSFP+ (64GFC) FibreChannel Interface option
 | 
			
		||||
* [#5884](https://github.com/netbox-community/netbox/issues/5884) - Enable custom links for device components
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -30,6 +30,7 @@ class VRFView(generic.ObjectView):
 | 
			
		||||
 | 
			
		||||
    def get_extra_context(self, request, instance):
 | 
			
		||||
        prefix_count = Prefix.objects.restrict(request.user, 'view').filter(vrf=instance).count()
 | 
			
		||||
        ipaddress_count = IPAddress.objects.restrict(request.user, 'view').filter(vrf=instance).count()
 | 
			
		||||
 | 
			
		||||
        import_targets_table = tables.RouteTargetTable(
 | 
			
		||||
            instance.import_targets.prefetch_related('tenant'),
 | 
			
		||||
@@ -42,6 +43,7 @@ class VRFView(generic.ObjectView):
 | 
			
		||||
 | 
			
		||||
        return {
 | 
			
		||||
            'prefix_count': prefix_count,
 | 
			
		||||
            'ipaddress_count': ipaddress_count,
 | 
			
		||||
            'import_targets_table': import_targets_table,
 | 
			
		||||
            'export_targets_table': export_targets_table,
 | 
			
		||||
        }
 | 
			
		||||
 
 | 
			
		||||
@@ -95,6 +95,12 @@
 | 
			
		||||
                    <td>
 | 
			
		||||
                        <a href="{% url 'ipam:prefix_list' %}?vrf_id={{ object.pk }}">{{ prefix_count }}</a>
 | 
			
		||||
                    </td>
 | 
			
		||||
                </tr>
 | 
			
		||||
                <tr>
 | 
			
		||||
                    <td>IP Addresses</td>
 | 
			
		||||
                    <td>
 | 
			
		||||
                        <a href="{% url 'ipam:ipaddress_list' %}?vrf_id={{ object.pk }}">{{ ipaddress_count }}</a>
 | 
			
		||||
                    </td>
 | 
			
		||||
                </tr>
 | 
			
		||||
		    </table>
 | 
			
		||||
        </div>
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user