|
6 | 6 | from django.contrib.contenttypes.models import ContentType
|
7 | 7 | from django.core.exceptions import ValidationError
|
8 | 8 | from django.utils.safestring import mark_safe
|
| 9 | +from django.utils.translation import gettext_lazy as _ |
9 | 10 | from ipam.models import (
|
10 | 11 | Prefix,
|
11 | 12 | IPRange,
|
|
23 | 24 | VirtualMachine,
|
24 | 25 | VMInterface,
|
25 | 26 | )
|
26 |
| - |
| 27 | +from utilities.forms.rendering import FieldSet, TabbedGroups |
27 | 28 | from ..choices import ACLTypeChoices
|
28 | 29 | from ..models import (
|
29 | 30 | AccessList,
|
@@ -484,9 +485,31 @@ class ACLStandardRuleForm(NetBoxModelForm):
|
484 | 485 | )
|
485 | 486 |
|
486 | 487 | fieldsets = (
|
487 |
| - FieldSet("access_list", "description", "tags", name=_('Access List Details')), |
488 |
| - FieldSet("index", "action", "remark", "source_prefix", name=_('Rule Definition')) |
| 488 | + FieldSet( |
| 489 | + "access_list", |
| 490 | + "description", |
| 491 | + "tags", |
| 492 | + name=_('Access List Details') |
| 493 | + ), |
| 494 | + FieldSet( |
| 495 | + "index", |
| 496 | + "action", |
| 497 | + "remark", |
| 498 | + name=_('Rule Definition') |
| 499 | + ), |
| 500 | + FieldSet( |
| 501 | + TabbedGroups( |
| 502 | + FieldSet('source_prefix', name=_('Prefix')), |
| 503 | + FieldSet('source_iprange', name=_('IP Range')), |
| 504 | + FieldSet('source_ipaddress', name=_('IP Address')), |
| 505 | + FieldSet('source_aggregate', name=_('Aggregate')), |
| 506 | + FieldSet('source_service', name=_('Service')), |
| 507 | + ) |
| 508 | + ) |
489 | 509 | )
|
| 510 | + |
| 511 | + |
| 512 | + |
490 | 513 | class Meta:
|
491 | 514 | model = ACLStandardRule
|
492 | 515 | fields = (
|
|
0 commit comments