mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-16 12:12:53 -06:00
Fixes #2202: Ditched half-baked concept of tenancy inheritance via VRF
This commit is contained in:
parent
d665d4d62a
commit
6e037e91d3
@ -65,10 +65,11 @@
|
||||
<td>Tenant</td>
|
||||
<td>
|
||||
{% if ipaddress.tenant %}
|
||||
{% if ipaddress.tenant.group %}
|
||||
<a href="{{ ipaddress.tenant.group.get_absolute_url }}">{{ ipaddress.tenant.group }}</a>
|
||||
<i class="fa fa-angle-right"></i>
|
||||
{% endif %}
|
||||
<a href="{{ ipaddress.tenant.get_absolute_url }}">{{ ipaddress.tenant }}</a>
|
||||
{% elif ipaddress.vrf.tenant %}
|
||||
<a href="{{ ipaddress.vrf.tenant.get_absolute_url }}">{{ ipaddress.vrf.tenant }}</a>
|
||||
<label class="label label-info">Inherited</label>
|
||||
{% else %}
|
||||
<span class="text-muted">None</span>
|
||||
{% endif %}
|
||||
|
@ -35,13 +35,6 @@
|
||||
<i class="fa fa-angle-right"></i>
|
||||
{% endif %}
|
||||
<a href="{{ prefix.tenant.get_absolute_url }}">{{ prefix.tenant }}</a>
|
||||
{% elif prefix.vrf.tenant %}
|
||||
{% if prefix.vrf.tenant.group %}
|
||||
<a href="{{ prefix.vrf.tenant.group.get_absolute_url }}">{{ prefix.vrf.tenant.group }}</a>
|
||||
<i class="fa fa-angle-right"></i>
|
||||
{% endif %}
|
||||
<a href="{{ prefix.vrf.tenant.get_absolute_url }}">{{ prefix.vrf.tenant }}</a>
|
||||
<label class="label label-info">Inherited</label>
|
||||
{% else %}
|
||||
<span class="text-muted">None</span>
|
||||
{% endif %}
|
||||
|
@ -78,14 +78,8 @@ class TenantView(View):
|
||||
'rackreservation_count': RackReservation.objects.filter(tenant=tenant).count(),
|
||||
'device_count': Device.objects.filter(tenant=tenant).count(),
|
||||
'vrf_count': VRF.objects.filter(tenant=tenant).count(),
|
||||
'prefix_count': Prefix.objects.filter(
|
||||
Q(tenant=tenant) |
|
||||
Q(tenant__isnull=True, vrf__tenant=tenant)
|
||||
).count(),
|
||||
'ipaddress_count': IPAddress.objects.filter(
|
||||
Q(tenant=tenant) |
|
||||
Q(tenant__isnull=True, vrf__tenant=tenant)
|
||||
).count(),
|
||||
'prefix_count': Prefix.objects.filter(tenant=tenant).count(),
|
||||
'ipaddress_count': IPAddress.objects.filter(tenant=tenant).count(),
|
||||
'vlan_count': VLAN.objects.filter(tenant=tenant).count(),
|
||||
'circuit_count': Circuit.objects.filter(tenant=tenant).count(),
|
||||
'virtualmachine_count': VirtualMachine.objects.filter(tenant=tenant).count(),
|
||||
|
Loading…
Reference in New Issue
Block a user