mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-21 11:37:21 -06:00
Closes #5592: Add IP addresses count to VRF view
This commit is contained in:
parent
759190d8ba
commit
16a3d1339a
@ -4,6 +4,7 @@
|
|||||||
|
|
||||||
### Enhancements
|
### 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
|
* [#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
|
* [#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):
|
def get_extra_context(self, request, instance):
|
||||||
prefix_count = Prefix.objects.restrict(request.user, 'view').filter(vrf=instance).count()
|
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(
|
import_targets_table = tables.RouteTargetTable(
|
||||||
instance.import_targets.prefetch_related('tenant'),
|
instance.import_targets.prefetch_related('tenant'),
|
||||||
@ -42,6 +43,7 @@ class VRFView(generic.ObjectView):
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
'prefix_count': prefix_count,
|
'prefix_count': prefix_count,
|
||||||
|
'ipaddress_count': ipaddress_count,
|
||||||
'import_targets_table': import_targets_table,
|
'import_targets_table': import_targets_table,
|
||||||
'export_targets_table': export_targets_table,
|
'export_targets_table': export_targets_table,
|
||||||
}
|
}
|
||||||
|
@ -95,6 +95,12 @@
|
|||||||
<td>
|
<td>
|
||||||
<a href="{% url 'ipam:prefix_list' %}?vrf_id={{ object.pk }}">{{ prefix_count }}</a>
|
<a href="{% url 'ipam:prefix_list' %}?vrf_id={{ object.pk }}">{{ prefix_count }}</a>
|
||||||
</td>
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>IP Addresses</td>
|
||||||
|
<td>
|
||||||
|
<a href="{% url 'ipam:ipaddress_list' %}?vrf_id={{ object.pk }}">{{ ipaddress_count }}</a>
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user