From 98640da0f462c943c5d05001cc02644c493f2f68 Mon Sep 17 00:00:00 2001
From: El Ju <50764748+elju@users.noreply.github.com>
Date: Tue, 18 Feb 2020 10:36:13 +0100
Subject: [PATCH] Prefixes Utilization Graph Direct Link To Adresses
The Utilization Bar in the Prefix Table points direct to the IP Addresses of that Prefix
---
netbox/ipam/tables.py | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/netbox/ipam/tables.py b/netbox/ipam/tables.py
index ad119a907..81da1d0da 100644
--- a/netbox/ipam/tables.py
+++ b/netbox/ipam/tables.py
@@ -34,11 +34,17 @@ RIR_ACTIONS = """
{% endif %}
"""
-UTILIZATION_GRAPH = """
+AGGREGATE_UTILIZATION_GRAPH = """
{% load helpers %}
{% if record.pk %}{% utilization_graph record.get_utilization %}{% else %}—{% endif %}
"""
+PREFIX_UTILIZATION_GRAPH = """
+{% load helpers %}
+{% if record.pk %}{% utilization_graph record.get_utilization %}{% else %}—{% endif %}
+"""
+
+
ROLE_PREFIX_COUNT = """
{{ value }}
"""
@@ -268,7 +274,7 @@ class AggregateTable(BaseTable):
class AggregateDetailTable(AggregateTable):
child_count = tables.Column(verbose_name='Prefixes')
- utilization = tables.TemplateColumn(UTILIZATION_GRAPH, orderable=False, verbose_name='Utilization')
+ utilization = tables.TemplateColumn(AGGREGATE_UTILIZATION_GRAPH, orderable=False, verbose_name='Utilization')
class Meta(AggregateTable.Meta):
fields = ('pk', 'prefix', 'rir', 'child_count', 'utilization', 'date_added', 'description')
@@ -326,7 +332,7 @@ class PrefixTable(BaseTable):
class PrefixDetailTable(PrefixTable):
- utilization = tables.TemplateColumn(UTILIZATION_GRAPH, orderable=False)
+ utilization = tables.TemplateColumn(PREFIX_UTILIZATION_GRAPH, orderable=False)
tenant = tables.TemplateColumn(template_code=COL_TENANT)
class Meta(PrefixTable.Meta):