|
@@ -256,6 +256,21 @@ class RoleTable(BaseTable):
|
|
|
# Prefixes
|
|
# Prefixes
|
|
|
#
|
|
#
|
|
|
|
|
|
|
|
|
|
+class PrefixUtilizationColumn(UtilizationColumn):
|
|
|
|
|
+ """
|
|
|
|
|
+ Extend UtilizationColumn to allow disabling the warning & danger thresholds for prefixes
|
|
|
|
|
+ marked as fully utilized.
|
|
|
|
|
+ """
|
|
|
|
|
+ template_code = """
|
|
|
|
|
+ {% load helpers %}
|
|
|
|
|
+ {% if record.pk and record.mark_utilized %}
|
|
|
|
|
+ {% utilization_graph value warning_threshold=0 danger_threshold=0 %}
|
|
|
|
|
+ {% elif record.pk %}
|
|
|
|
|
+ {% utilization_graph value %}
|
|
|
|
|
+ {% endif %}
|
|
|
|
|
+ """
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
class PrefixTable(BaseTable):
|
|
class PrefixTable(BaseTable):
|
|
|
pk = ToggleColumn()
|
|
pk = ToggleColumn()
|
|
|
prefix = tables.TemplateColumn(
|
|
prefix = tables.TemplateColumn(
|
|
@@ -300,7 +315,7 @@ class PrefixTable(BaseTable):
|
|
|
|
|
|
|
|
|
|
|
|
|
class PrefixDetailTable(PrefixTable):
|
|
class PrefixDetailTable(PrefixTable):
|
|
|
- utilization = UtilizationColumn(
|
|
|
|
|
|
|
+ utilization = PrefixUtilizationColumn(
|
|
|
accessor='get_utilization',
|
|
accessor='get_utilization',
|
|
|
orderable=False
|
|
orderable=False
|
|
|
)
|
|
)
|