mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-08 00:28:16 -06:00
Prefixes Utilization Graph Direct Link To Adresses
The Utilization Bar in the Prefix Table points direct to the IP Addresses of that Prefix
This commit is contained in:
parent
b907a649e9
commit
98640da0f4
@ -34,11 +34,17 @@ RIR_ACTIONS = """
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
"""
|
"""
|
||||||
|
|
||||||
UTILIZATION_GRAPH = """
|
AGGREGATE_UTILIZATION_GRAPH = """
|
||||||
{% load helpers %}
|
{% load helpers %}
|
||||||
{% if record.pk %}{% utilization_graph record.get_utilization %}{% else %}—{% endif %}
|
{% if record.pk %}{% utilization_graph record.get_utilization %}{% else %}—{% endif %}
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
PREFIX_UTILIZATION_GRAPH = """
|
||||||
|
{% load helpers %}
|
||||||
|
{% if record.pk %}<a href="{% url 'ipam:prefix_ipaddresses' pk=record.pk %}">{% utilization_graph record.get_utilization %}</a>{% else %}—{% endif %}
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
ROLE_PREFIX_COUNT = """
|
ROLE_PREFIX_COUNT = """
|
||||||
<a href="{% url 'ipam:prefix_list' %}?role={{ record.slug }}">{{ value }}</a>
|
<a href="{% url 'ipam:prefix_list' %}?role={{ record.slug }}">{{ value }}</a>
|
||||||
"""
|
"""
|
||||||
@ -268,7 +274,7 @@ class AggregateTable(BaseTable):
|
|||||||
|
|
||||||
class AggregateDetailTable(AggregateTable):
|
class AggregateDetailTable(AggregateTable):
|
||||||
child_count = tables.Column(verbose_name='Prefixes')
|
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):
|
class Meta(AggregateTable.Meta):
|
||||||
fields = ('pk', 'prefix', 'rir', 'child_count', 'utilization', 'date_added', 'description')
|
fields = ('pk', 'prefix', 'rir', 'child_count', 'utilization', 'date_added', 'description')
|
||||||
@ -326,7 +332,7 @@ class PrefixTable(BaseTable):
|
|||||||
|
|
||||||
|
|
||||||
class PrefixDetailTable(PrefixTable):
|
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)
|
tenant = tables.TemplateColumn(template_code=COL_TENANT)
|
||||||
|
|
||||||
class Meta(PrefixTable.Meta):
|
class Meta(PrefixTable.Meta):
|
||||||
|
Loading…
Reference in New Issue
Block a user