1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Merge branch 'develop' into develop-2.9

This commit is contained in:
Jeremy Stretch
2020-07-21 12:57:02 -04:00
20 changed files with 214 additions and 96 deletions

View File

@ -16,6 +16,14 @@ VIRTUALMACHINE_PRIMARY_IP = """
{{ record.primary_ip4.address.ip|default:"" }}
"""
DEVICE_COUNT = """
<a href="{% url 'dcim:device_list' %}?cluster_id={{ record.pk }}">{{ value|default:0 }}</a>
"""
VM_COUNT = """
<a href="{% url 'virtualization:virtualmachine_list' %}?cluster_id={{ record.pk }}">{{ value|default:0 }}</a>
"""
#
# Cluster types
@ -66,14 +74,12 @@ class ClusterTable(BaseTable):
site = tables.Column(
linkify=True
)
device_count = tables.Column(
accessor=Accessor('devices__unrestricted__count'),
orderable=False,
device_count = tables.TemplateColumn(
template_code=DEVICE_COUNT,
verbose_name='Devices'
)
vm_count = tables.Column(
accessor=Accessor('virtual_machines__unrestricted__count'),
orderable=False,
vm_count = tables.TemplateColumn(
template_code=VM_COUNT,
verbose_name='VMs'
)
tags = TagColumn(