diff --git a/netbox_acls/models/access_list_rules.py b/netbox_acls/models/access_list_rules.py index 2dff662..f37aca8 100644 --- a/netbox_acls/models/access_list_rules.py +++ b/netbox_acls/models/access_list_rules.py @@ -52,6 +52,8 @@ class ACLRule(NetBoxModel): verbose_name="Source Prefix", ) + clone_fields = ("access_list", "action", "source_prefix") + def __str__(self): return f"{self.access_list}: Rule {self.index}" diff --git a/netbox_acls/models/access_lists.py b/netbox_acls/models/access_lists.py index 729e024..1feb635 100644 --- a/netbox_acls/models/access_lists.py +++ b/netbox_acls/models/access_lists.py @@ -59,6 +59,11 @@ class AccessList(NetBoxModel): blank=True, ) + clone_fields = ( + "type", + "default_action", + ) + class Meta: unique_together = ["assigned_object_type", "assigned_object_id", "name"] ordering = ["assigned_object_type", "assigned_object_id", "name"] @@ -113,6 +118,8 @@ class ACLInterfaceAssignment(NetBoxModel): blank=True, ) + clone_fields = ("access_list", "direction") + class Meta: unique_together = [ "assigned_object_type", diff --git a/netbox_acls/templates/netbox_acls/accesslist.html b/netbox_acls/templates/netbox_acls/accesslist.html index 6870f30..5821402 100644 --- a/netbox_acls/templates/netbox_acls/accesslist.html +++ b/netbox_acls/templates/netbox_acls/accesslist.html @@ -1,90 +1,63 @@ {% extends 'generic/object.html' %} {% load render_table from django_tables2 %} -{% block breadcrumbs %} -
| Type | -{{ object.get_type_display }} | -|
|---|---|---|
| Default Action | -{% badge object.get_default_action_display bg_color=object.get_default_action_color %} | -|
| Rules | - {% if object.type == 'standard' %} -{{ object.aclstandardrules.count|placeholder }} | - {% elif object.type == 'extended' %} -{{ object.aclextendedrules.count|placeholder }} | - {% endif %} -
| Assigned Host | -{{ object.assigned_object|linkify }} | -
| Type | +{{ object.get_type_display }} | +|
|---|---|---|
| Default Action | +{% badge object.get_default_action_display bg_color=object.get_default_action_color %} | +|
| Rules | + {% if object.type == 'standard' %} +{{ object.aclstandardrules.count|placeholder }} | + {% elif object.type == 'extended' %} +{{ object.aclextendedrules.count|placeholder }} | + {% endif %} +
| Assigned Host | +{{ object.assigned_object|linkify }} | +