|
@@ -12,7 +12,8 @@ from netbox.forms import NetBoxModelFilterSetForm
|
|
|
from tenancy.forms import ContactModelFilterForm, TenancyFilterForm
|
|
from tenancy.forms import ContactModelFilterForm, TenancyFilterForm
|
|
|
from utilities.forms import BOOLEAN_WITH_BLANK_CHOICES, FilterForm, add_blank_choice
|
|
from utilities.forms import BOOLEAN_WITH_BLANK_CHOICES, FilterForm, add_blank_choice
|
|
|
from utilities.forms.fields import ColorField, DynamicModelMultipleChoiceField, TagFilterField
|
|
from utilities.forms.fields import ColorField, DynamicModelMultipleChoiceField, TagFilterField
|
|
|
-from utilities.forms.widgets import APISelectMultiple, NumberWithOptions
|
|
|
|
|
|
|
+from utilities.forms.rendering import FieldSet
|
|
|
|
|
+from utilities.forms.widgets import NumberWithOptions
|
|
|
from vpn.models import L2VPN
|
|
from vpn.models import L2VPN
|
|
|
from wireless.choices import *
|
|
from wireless.choices import *
|
|
|
|
|
|
|
@@ -132,8 +133,8 @@ class DeviceComponentFilterForm(NetBoxModelFilterSetForm):
|
|
|
class RegionFilterForm(ContactModelFilterForm, NetBoxModelFilterSetForm):
|
|
class RegionFilterForm(ContactModelFilterForm, NetBoxModelFilterSetForm):
|
|
|
model = Region
|
|
model = Region
|
|
|
fieldsets = (
|
|
fieldsets = (
|
|
|
- (None, ('q', 'filter_id', 'tag', 'parent_id')),
|
|
|
|
|
- (_('Contacts'), ('contact', 'contact_role', 'contact_group'))
|
|
|
|
|
|
|
+ FieldSet('q', 'filter_id', 'tag', 'parent_id'),
|
|
|
|
|
+ FieldSet('contact', 'contact_role', 'contact_group', name=_('Contacts'))
|
|
|
)
|
|
)
|
|
|
parent_id = DynamicModelMultipleChoiceField(
|
|
parent_id = DynamicModelMultipleChoiceField(
|
|
|
queryset=Region.objects.all(),
|
|
queryset=Region.objects.all(),
|
|
@@ -146,8 +147,8 @@ class RegionFilterForm(ContactModelFilterForm, NetBoxModelFilterSetForm):
|
|
|
class SiteGroupFilterForm(ContactModelFilterForm, NetBoxModelFilterSetForm):
|
|
class SiteGroupFilterForm(ContactModelFilterForm, NetBoxModelFilterSetForm):
|
|
|
model = SiteGroup
|
|
model = SiteGroup
|
|
|
fieldsets = (
|
|
fieldsets = (
|
|
|
- (None, ('q', 'filter_id', 'tag', 'parent_id')),
|
|
|
|
|
- (_('Contacts'), ('contact', 'contact_role', 'contact_group'))
|
|
|
|
|
|
|
+ FieldSet('q', 'filter_id', 'tag', 'parent_id'),
|
|
|
|
|
+ FieldSet('contact', 'contact_role', 'contact_group', name=_('Contacts'))
|
|
|
)
|
|
)
|
|
|
parent_id = DynamicModelMultipleChoiceField(
|
|
parent_id = DynamicModelMultipleChoiceField(
|
|
|
queryset=SiteGroup.objects.all(),
|
|
queryset=SiteGroup.objects.all(),
|
|
@@ -160,10 +161,10 @@ class SiteGroupFilterForm(ContactModelFilterForm, NetBoxModelFilterSetForm):
|
|
|
class SiteFilterForm(TenancyFilterForm, ContactModelFilterForm, NetBoxModelFilterSetForm):
|
|
class SiteFilterForm(TenancyFilterForm, ContactModelFilterForm, NetBoxModelFilterSetForm):
|
|
|
model = Site
|
|
model = Site
|
|
|
fieldsets = (
|
|
fieldsets = (
|
|
|
- (None, ('q', 'filter_id', 'tag')),
|
|
|
|
|
- (_('Attributes'), ('status', 'region_id', 'group_id', 'asn_id')),
|
|
|
|
|
- (_('Tenant'), ('tenant_group_id', 'tenant_id')),
|
|
|
|
|
- (_('Contacts'), ('contact', 'contact_role', 'contact_group')),
|
|
|
|
|
|
|
+ FieldSet('q', 'filter_id', 'tag'),
|
|
|
|
|
+ FieldSet('status', 'region_id', 'group_id', 'asn_id', name=_('Attributes')),
|
|
|
|
|
+ FieldSet('tenant_group_id', 'tenant_id', name=_('Tenant')),
|
|
|
|
|
+ FieldSet('contact', 'contact_role', 'contact_group', name=_('Contacts')),
|
|
|
)
|
|
)
|
|
|
selector_fields = ('filter_id', 'q', 'region_id', 'group_id')
|
|
selector_fields = ('filter_id', 'q', 'region_id', 'group_id')
|
|
|
status = forms.MultipleChoiceField(
|
|
status = forms.MultipleChoiceField(
|
|
@@ -192,10 +193,10 @@ class SiteFilterForm(TenancyFilterForm, ContactModelFilterForm, NetBoxModelFilte
|
|
|
class LocationFilterForm(TenancyFilterForm, ContactModelFilterForm, NetBoxModelFilterSetForm):
|
|
class LocationFilterForm(TenancyFilterForm, ContactModelFilterForm, NetBoxModelFilterSetForm):
|
|
|
model = Location
|
|
model = Location
|
|
|
fieldsets = (
|
|
fieldsets = (
|
|
|
- (None, ('q', 'filter_id', 'tag')),
|
|
|
|
|
- (_('Attributes'), ('region_id', 'site_group_id', 'site_id', 'parent_id', 'status')),
|
|
|
|
|
- (_('Tenant'), ('tenant_group_id', 'tenant_id')),
|
|
|
|
|
- (_('Contacts'), ('contact', 'contact_role', 'contact_group')),
|
|
|
|
|
|
|
+ FieldSet('q', 'filter_id', 'tag'),
|
|
|
|
|
+ FieldSet('region_id', 'site_group_id', 'site_id', 'parent_id', 'status', name=_('Attributes')),
|
|
|
|
|
+ FieldSet('tenant_group_id', 'tenant_id', name=_('Tenant')),
|
|
|
|
|
+ FieldSet('contact', 'contact_role', 'contact_group', name=_('Contacts')),
|
|
|
)
|
|
)
|
|
|
region_id = DynamicModelMultipleChoiceField(
|
|
region_id = DynamicModelMultipleChoiceField(
|
|
|
queryset=Region.objects.all(),
|
|
queryset=Region.objects.all(),
|
|
@@ -241,13 +242,13 @@ class RackRoleFilterForm(NetBoxModelFilterSetForm):
|
|
|
class RackFilterForm(TenancyFilterForm, ContactModelFilterForm, NetBoxModelFilterSetForm):
|
|
class RackFilterForm(TenancyFilterForm, ContactModelFilterForm, NetBoxModelFilterSetForm):
|
|
|
model = Rack
|
|
model = Rack
|
|
|
fieldsets = (
|
|
fieldsets = (
|
|
|
- (None, ('q', 'filter_id', 'tag')),
|
|
|
|
|
- (_('Location'), ('region_id', 'site_group_id', 'site_id', 'location_id')),
|
|
|
|
|
- (_('Function'), ('status', 'role_id')),
|
|
|
|
|
- (_('Hardware'), ('type', 'width', 'serial', 'asset_tag')),
|
|
|
|
|
- (_('Tenant'), ('tenant_group_id', 'tenant_id')),
|
|
|
|
|
- (_('Contacts'), ('contact', 'contact_role', 'contact_group')),
|
|
|
|
|
- (_('Weight'), ('weight', 'max_weight', 'weight_unit')),
|
|
|
|
|
|
|
+ FieldSet('q', 'filter_id', 'tag'),
|
|
|
|
|
+ FieldSet('region_id', 'site_group_id', 'site_id', 'location_id', name=_('Location')),
|
|
|
|
|
+ FieldSet('status', 'role_id', name=_('Function')),
|
|
|
|
|
+ FieldSet('type', 'width', 'serial', 'asset_tag', name=_('Hardware')),
|
|
|
|
|
+ FieldSet('tenant_group_id', 'tenant_id', name=_('Tenant')),
|
|
|
|
|
+ FieldSet('contact', 'contact_role', 'contact_group', name=_('Contacts')),
|
|
|
|
|
+ FieldSet('weight', 'max_weight', 'weight_unit', name=_('Weight')),
|
|
|
)
|
|
)
|
|
|
selector_fields = ('filter_id', 'q', 'region_id', 'site_group_id', 'site_id', 'location_id')
|
|
selector_fields = ('filter_id', 'q', 'region_id', 'site_group_id', 'site_id', 'location_id')
|
|
|
region_id = DynamicModelMultipleChoiceField(
|
|
region_id = DynamicModelMultipleChoiceField(
|
|
@@ -326,13 +327,13 @@ class RackFilterForm(TenancyFilterForm, ContactModelFilterForm, NetBoxModelFilte
|
|
|
|
|
|
|
|
class RackElevationFilterForm(RackFilterForm):
|
|
class RackElevationFilterForm(RackFilterForm):
|
|
|
fieldsets = (
|
|
fieldsets = (
|
|
|
- (None, ('q', 'filter_id', 'tag')),
|
|
|
|
|
- (_('Location'), ('region_id', 'site_group_id', 'site_id', 'location_id', 'id')),
|
|
|
|
|
- (_('Function'), ('status', 'role_id')),
|
|
|
|
|
- (_('Hardware'), ('type', 'width', 'serial', 'asset_tag')),
|
|
|
|
|
- (_('Tenant'), ('tenant_group_id', 'tenant_id')),
|
|
|
|
|
- (_('Contacts'), ('contact', 'contact_role', 'contact_group')),
|
|
|
|
|
- (_('Weight'), ('weight', 'max_weight', 'weight_unit')),
|
|
|
|
|
|
|
+ FieldSet('q', 'filter_id', 'tag'),
|
|
|
|
|
+ FieldSet('region_id', 'site_group_id', 'site_id', 'location_id', 'id', name=_('Location')),
|
|
|
|
|
+ FieldSet('status', 'role_id', name=_('Function')),
|
|
|
|
|
+ FieldSet('type', 'width', 'serial', 'asset_tag', name=_('Hardware')),
|
|
|
|
|
+ FieldSet('tenant_group_id', 'tenant_id', name=_('Tenant')),
|
|
|
|
|
+ FieldSet('contact', 'contact_role', 'contact_group', name=_('Contacts')),
|
|
|
|
|
+ FieldSet('weight', 'max_weight', 'weight_unit', name=_('Weight')),
|
|
|
)
|
|
)
|
|
|
id = DynamicModelMultipleChoiceField(
|
|
id = DynamicModelMultipleChoiceField(
|
|
|
queryset=Rack.objects.all(),
|
|
queryset=Rack.objects.all(),
|
|
@@ -348,10 +349,10 @@ class RackElevationFilterForm(RackFilterForm):
|
|
|
class RackReservationFilterForm(TenancyFilterForm, NetBoxModelFilterSetForm):
|
|
class RackReservationFilterForm(TenancyFilterForm, NetBoxModelFilterSetForm):
|
|
|
model = RackReservation
|
|
model = RackReservation
|
|
|
fieldsets = (
|
|
fieldsets = (
|
|
|
- (None, ('q', 'filter_id', 'tag')),
|
|
|
|
|
- (_('User'), ('user_id',)),
|
|
|
|
|
- (_('Rack'), ('region_id', 'site_group_id', 'site_id', 'location_id', 'rack_id')),
|
|
|
|
|
- (_('Tenant'), ('tenant_group_id', 'tenant_id')),
|
|
|
|
|
|
|
+ FieldSet('q', 'filter_id', 'tag'),
|
|
|
|
|
+ FieldSet('user_id', name=_('User')),
|
|
|
|
|
+ FieldSet('region_id', 'site_group_id', 'site_id', 'location_id', 'rack_id', name=_('Rack')),
|
|
|
|
|
+ FieldSet('tenant_group_id', 'tenant_id', name=_('Tenant')),
|
|
|
)
|
|
)
|
|
|
region_id = DynamicModelMultipleChoiceField(
|
|
region_id = DynamicModelMultipleChoiceField(
|
|
|
queryset=Region.objects.all(),
|
|
queryset=Region.objects.all(),
|
|
@@ -401,8 +402,8 @@ class RackReservationFilterForm(TenancyFilterForm, NetBoxModelFilterSetForm):
|
|
|
class ManufacturerFilterForm(ContactModelFilterForm, NetBoxModelFilterSetForm):
|
|
class ManufacturerFilterForm(ContactModelFilterForm, NetBoxModelFilterSetForm):
|
|
|
model = Manufacturer
|
|
model = Manufacturer
|
|
|
fieldsets = (
|
|
fieldsets = (
|
|
|
- (None, ('q', 'filter_id', 'tag')),
|
|
|
|
|
- (_('Contacts'), ('contact', 'contact_role', 'contact_group'))
|
|
|
|
|
|
|
+ FieldSet('q', 'filter_id', 'tag'),
|
|
|
|
|
+ FieldSet('contact', 'contact_role', 'contact_group', name=_('Contacts'))
|
|
|
)
|
|
)
|
|
|
tag = TagFilterField(model)
|
|
tag = TagFilterField(model)
|
|
|
|
|
|
|
@@ -410,14 +411,16 @@ class ManufacturerFilterForm(ContactModelFilterForm, NetBoxModelFilterSetForm):
|
|
|
class DeviceTypeFilterForm(NetBoxModelFilterSetForm):
|
|
class DeviceTypeFilterForm(NetBoxModelFilterSetForm):
|
|
|
model = DeviceType
|
|
model = DeviceType
|
|
|
fieldsets = (
|
|
fieldsets = (
|
|
|
- (None, ('q', 'filter_id', 'tag')),
|
|
|
|
|
- (_('Hardware'), ('manufacturer_id', 'default_platform_id', 'part_number', 'subdevice_role', 'airflow')),
|
|
|
|
|
- (_('Images'), ('has_front_image', 'has_rear_image')),
|
|
|
|
|
- (_('Components'), (
|
|
|
|
|
|
|
+ FieldSet('q', 'filter_id', 'tag'),
|
|
|
|
|
+ FieldSet(
|
|
|
|
|
+ 'manufacturer_id', 'default_platform_id', 'part_number', 'subdevice_role', 'airflow', name=_('Hardware')
|
|
|
|
|
+ ),
|
|
|
|
|
+ FieldSet('has_front_image', 'has_rear_image', name=_('Images')),
|
|
|
|
|
+ FieldSet(
|
|
|
'console_ports', 'console_server_ports', 'power_ports', 'power_outlets', 'interfaces',
|
|
'console_ports', 'console_server_ports', 'power_ports', 'power_outlets', 'interfaces',
|
|
|
- 'pass_through_ports', 'device_bays', 'module_bays', 'inventory_items',
|
|
|
|
|
- )),
|
|
|
|
|
- (_('Weight'), ('weight', 'weight_unit')),
|
|
|
|
|
|
|
+ 'pass_through_ports', 'device_bays', 'module_bays', 'inventory_items', name=_('Components')
|
|
|
|
|
+ ),
|
|
|
|
|
+ FieldSet('weight', 'weight_unit', name=_('Weight')),
|
|
|
)
|
|
)
|
|
|
selector_fields = ('filter_id', 'q', 'manufacturer_id')
|
|
selector_fields = ('filter_id', 'q', 'manufacturer_id')
|
|
|
manufacturer_id = DynamicModelMultipleChoiceField(
|
|
manufacturer_id = DynamicModelMultipleChoiceField(
|
|
@@ -536,13 +539,13 @@ class DeviceTypeFilterForm(NetBoxModelFilterSetForm):
|
|
|
class ModuleTypeFilterForm(NetBoxModelFilterSetForm):
|
|
class ModuleTypeFilterForm(NetBoxModelFilterSetForm):
|
|
|
model = ModuleType
|
|
model = ModuleType
|
|
|
fieldsets = (
|
|
fieldsets = (
|
|
|
- (None, ('q', 'filter_id', 'tag')),
|
|
|
|
|
- (_('Hardware'), ('manufacturer_id', 'part_number')),
|
|
|
|
|
- (_('Components'), (
|
|
|
|
|
|
|
+ FieldSet('q', 'filter_id', 'tag'),
|
|
|
|
|
+ FieldSet('manufacturer_id', 'part_number', name=_('Hardware')),
|
|
|
|
|
+ FieldSet(
|
|
|
'console_ports', 'console_server_ports', 'power_ports', 'power_outlets', 'interfaces',
|
|
'console_ports', 'console_server_ports', 'power_ports', 'power_outlets', 'interfaces',
|
|
|
- 'pass_through_ports',
|
|
|
|
|
- )),
|
|
|
|
|
- (_('Weight'), ('weight', 'weight_unit')),
|
|
|
|
|
|
|
+ 'pass_through_ports', name=_('Components')
|
|
|
|
|
+ ),
|
|
|
|
|
+ FieldSet('weight', 'weight_unit', name=_('Weight')),
|
|
|
)
|
|
)
|
|
|
selector_fields = ('filter_id', 'q', 'manufacturer_id')
|
|
selector_fields = ('filter_id', 'q', 'manufacturer_id')
|
|
|
manufacturer_id = DynamicModelMultipleChoiceField(
|
|
manufacturer_id = DynamicModelMultipleChoiceField(
|
|
@@ -642,18 +645,20 @@ class DeviceFilterForm(
|
|
|
):
|
|
):
|
|
|
model = Device
|
|
model = Device
|
|
|
fieldsets = (
|
|
fieldsets = (
|
|
|
- (None, ('q', 'filter_id', 'tag')),
|
|
|
|
|
- (_('Location'), ('region_id', 'site_group_id', 'site_id', 'location_id', 'rack_id')),
|
|
|
|
|
- (_('Operation'), ('status', 'role_id', 'airflow', 'serial', 'asset_tag', 'mac_address')),
|
|
|
|
|
- (_('Hardware'), ('manufacturer_id', 'device_type_id', 'platform_id')),
|
|
|
|
|
- (_('Tenant'), ('tenant_group_id', 'tenant_id')),
|
|
|
|
|
- (_('Contacts'), ('contact', 'contact_role', 'contact_group')),
|
|
|
|
|
- (_('Components'), (
|
|
|
|
|
|
|
+ FieldSet('q', 'filter_id', 'tag'),
|
|
|
|
|
+ FieldSet('region_id', 'site_group_id', 'site_id', 'location_id', 'rack_id', name=_('Location')),
|
|
|
|
|
+ FieldSet('status', 'role_id', 'airflow', 'serial', 'asset_tag', 'mac_address', name=_('Operation')),
|
|
|
|
|
+ FieldSet('manufacturer_id', 'device_type_id', 'platform_id', name=_('Hardware')),
|
|
|
|
|
+ FieldSet('tenant_group_id', 'tenant_id', name=_('Tenant')),
|
|
|
|
|
+ FieldSet('contact', 'contact_role', 'contact_group', name=_('Contacts')),
|
|
|
|
|
+ FieldSet(
|
|
|
'console_ports', 'console_server_ports', 'power_ports', 'power_outlets', 'interfaces', 'pass_through_ports',
|
|
'console_ports', 'console_server_ports', 'power_ports', 'power_outlets', 'interfaces', 'pass_through_ports',
|
|
|
- )),
|
|
|
|
|
- (_('Miscellaneous'), (
|
|
|
|
|
|
|
+ name=_('Components')
|
|
|
|
|
+ ),
|
|
|
|
|
+ FieldSet(
|
|
|
'has_primary_ip', 'has_oob_ip', 'virtual_chassis_member', 'config_template_id', 'local_context_data',
|
|
'has_primary_ip', 'has_oob_ip', 'virtual_chassis_member', 'config_template_id', 'local_context_data',
|
|
|
- ))
|
|
|
|
|
|
|
+ name=_('Miscellaneous')
|
|
|
|
|
+ )
|
|
|
)
|
|
)
|
|
|
selector_fields = ('filter_id', 'q', 'region_id', 'site_group_id', 'site_id', 'location_id', 'rack_id')
|
|
selector_fields = ('filter_id', 'q', 'region_id', 'site_group_id', 'site_id', 'location_id', 'rack_id')
|
|
|
region_id = DynamicModelMultipleChoiceField(
|
|
region_id = DynamicModelMultipleChoiceField(
|
|
@@ -817,9 +822,9 @@ class VirtualDeviceContextFilterForm(
|
|
|
):
|
|
):
|
|
|
model = VirtualDeviceContext
|
|
model = VirtualDeviceContext
|
|
|
fieldsets = (
|
|
fieldsets = (
|
|
|
- (None, ('q', 'filter_id', 'tag')),
|
|
|
|
|
- (_('Attributes'), ('device', 'status', 'has_primary_ip')),
|
|
|
|
|
- (_('Tenant'), ('tenant_group_id', 'tenant_id')),
|
|
|
|
|
|
|
+ FieldSet('q', 'filter_id', 'tag'),
|
|
|
|
|
+ FieldSet('device', 'status', 'has_primary_ip', name=_('Attributes')),
|
|
|
|
|
+ FieldSet('tenant_group_id', 'tenant_id', name=_('Tenant')),
|
|
|
)
|
|
)
|
|
|
device = DynamicModelMultipleChoiceField(
|
|
device = DynamicModelMultipleChoiceField(
|
|
|
queryset=Device.objects.all(),
|
|
queryset=Device.objects.all(),
|
|
@@ -844,8 +849,8 @@ class VirtualDeviceContextFilterForm(
|
|
|
class ModuleFilterForm(LocalConfigContextFilterForm, TenancyFilterForm, NetBoxModelFilterSetForm):
|
|
class ModuleFilterForm(LocalConfigContextFilterForm, TenancyFilterForm, NetBoxModelFilterSetForm):
|
|
|
model = Module
|
|
model = Module
|
|
|
fieldsets = (
|
|
fieldsets = (
|
|
|
- (None, ('q', 'filter_id', 'tag')),
|
|
|
|
|
- (_('Hardware'), ('manufacturer_id', 'module_type_id', 'status', 'serial', 'asset_tag')),
|
|
|
|
|
|
|
+ FieldSet('q', 'filter_id', 'tag'),
|
|
|
|
|
+ FieldSet('manufacturer_id', 'module_type_id', 'status', 'serial', 'asset_tag', name=_('Hardware')),
|
|
|
)
|
|
)
|
|
|
manufacturer_id = DynamicModelMultipleChoiceField(
|
|
manufacturer_id = DynamicModelMultipleChoiceField(
|
|
|
queryset=Manufacturer.objects.all(),
|
|
queryset=Manufacturer.objects.all(),
|
|
@@ -879,9 +884,9 @@ class ModuleFilterForm(LocalConfigContextFilterForm, TenancyFilterForm, NetBoxMo
|
|
|
class VirtualChassisFilterForm(TenancyFilterForm, NetBoxModelFilterSetForm):
|
|
class VirtualChassisFilterForm(TenancyFilterForm, NetBoxModelFilterSetForm):
|
|
|
model = VirtualChassis
|
|
model = VirtualChassis
|
|
|
fieldsets = (
|
|
fieldsets = (
|
|
|
- (None, ('q', 'filter_id', 'tag')),
|
|
|
|
|
- (_('Location'), ('region_id', 'site_group_id', 'site_id')),
|
|
|
|
|
- (_('Tenant'), ('tenant_group_id', 'tenant_id')),
|
|
|
|
|
|
|
+ FieldSet('q', 'filter_id', 'tag'),
|
|
|
|
|
+ FieldSet('region_id', 'site_group_id', 'site_id', name=_('Location')),
|
|
|
|
|
+ FieldSet('tenant_group_id', 'tenant_id', name=_('Tenant')),
|
|
|
)
|
|
)
|
|
|
region_id = DynamicModelMultipleChoiceField(
|
|
region_id = DynamicModelMultipleChoiceField(
|
|
|
queryset=Region.objects.all(),
|
|
queryset=Region.objects.all(),
|
|
@@ -908,10 +913,10 @@ class VirtualChassisFilterForm(TenancyFilterForm, NetBoxModelFilterSetForm):
|
|
|
class CableFilterForm(TenancyFilterForm, NetBoxModelFilterSetForm):
|
|
class CableFilterForm(TenancyFilterForm, NetBoxModelFilterSetForm):
|
|
|
model = Cable
|
|
model = Cable
|
|
|
fieldsets = (
|
|
fieldsets = (
|
|
|
- (None, ('q', 'filter_id', 'tag')),
|
|
|
|
|
- (_('Location'), ('site_id', 'location_id', 'rack_id', 'device_id')),
|
|
|
|
|
- (_('Attributes'), ('type', 'status', 'color', 'length', 'length_unit', 'unterminated')),
|
|
|
|
|
- (_('Tenant'), ('tenant_group_id', 'tenant_id')),
|
|
|
|
|
|
|
+ FieldSet('q', 'filter_id', 'tag'),
|
|
|
|
|
+ FieldSet('site_id', 'location_id', 'rack_id', 'device_id', name=_('Location')),
|
|
|
|
|
+ FieldSet('type', 'status', 'color', 'length', 'length_unit', 'unterminated', name=_('Attributes')),
|
|
|
|
|
+ FieldSet('tenant_group_id', 'tenant_id', name=_('Tenant')),
|
|
|
)
|
|
)
|
|
|
region_id = DynamicModelMultipleChoiceField(
|
|
region_id = DynamicModelMultipleChoiceField(
|
|
|
queryset=Region.objects.all(),
|
|
queryset=Region.objects.all(),
|
|
@@ -992,9 +997,9 @@ class CableFilterForm(TenancyFilterForm, NetBoxModelFilterSetForm):
|
|
|
class PowerPanelFilterForm(ContactModelFilterForm, NetBoxModelFilterSetForm):
|
|
class PowerPanelFilterForm(ContactModelFilterForm, NetBoxModelFilterSetForm):
|
|
|
model = PowerPanel
|
|
model = PowerPanel
|
|
|
fieldsets = (
|
|
fieldsets = (
|
|
|
- (None, ('q', 'filter_id', 'tag')),
|
|
|
|
|
- (_('Location'), ('region_id', 'site_group_id', 'site_id', 'location_id')),
|
|
|
|
|
- (_('Contacts'), ('contact', 'contact_role', 'contact_group')),
|
|
|
|
|
|
|
+ FieldSet('q', 'filter_id', 'tag'),
|
|
|
|
|
+ FieldSet('region_id', 'site_group_id', 'site_id', 'location_id', name=_('Location')),
|
|
|
|
|
+ FieldSet('contact', 'contact_role', 'contact_group', name=_('Contacts')),
|
|
|
)
|
|
)
|
|
|
selector_fields = ('filter_id', 'q', 'site_id', 'location_id')
|
|
selector_fields = ('filter_id', 'q', 'site_id', 'location_id')
|
|
|
region_id = DynamicModelMultipleChoiceField(
|
|
region_id = DynamicModelMultipleChoiceField(
|
|
@@ -1031,10 +1036,10 @@ class PowerPanelFilterForm(ContactModelFilterForm, NetBoxModelFilterSetForm):
|
|
|
class PowerFeedFilterForm(TenancyFilterForm, NetBoxModelFilterSetForm):
|
|
class PowerFeedFilterForm(TenancyFilterForm, NetBoxModelFilterSetForm):
|
|
|
model = PowerFeed
|
|
model = PowerFeed
|
|
|
fieldsets = (
|
|
fieldsets = (
|
|
|
- (None, ('q', 'filter_id', 'tag')),
|
|
|
|
|
- (_('Location'), ('region_id', 'site_group_id', 'site_id', 'power_panel_id', 'rack_id')),
|
|
|
|
|
- (_('Tenant'), ('tenant_group_id', 'tenant_id')),
|
|
|
|
|
- (_('Attributes'), ('status', 'type', 'supply', 'phase', 'voltage', 'amperage', 'max_utilization')),
|
|
|
|
|
|
|
+ FieldSet('q', 'filter_id', 'tag'),
|
|
|
|
|
+ FieldSet('region_id', 'site_group_id', 'site_id', 'power_panel_id', 'rack_id', name=_('Location')),
|
|
|
|
|
+ FieldSet('tenant_group_id', 'tenant_id', name=_('Tenant')),
|
|
|
|
|
+ FieldSet('status', 'type', 'supply', 'phase', 'voltage', 'amperage', 'max_utilization', name=_('Attributes')),
|
|
|
)
|
|
)
|
|
|
region_id = DynamicModelMultipleChoiceField(
|
|
region_id = DynamicModelMultipleChoiceField(
|
|
|
queryset=Region.objects.all(),
|
|
queryset=Region.objects.all(),
|
|
@@ -1141,11 +1146,11 @@ class PathEndpointFilterForm(CabledFilterForm):
|
|
|
class ConsolePortFilterForm(PathEndpointFilterForm, DeviceComponentFilterForm):
|
|
class ConsolePortFilterForm(PathEndpointFilterForm, DeviceComponentFilterForm):
|
|
|
model = ConsolePort
|
|
model = ConsolePort
|
|
|
fieldsets = (
|
|
fieldsets = (
|
|
|
- (None, ('q', 'filter_id', 'tag')),
|
|
|
|
|
- (_('Attributes'), ('name', 'label', 'type', 'speed')),
|
|
|
|
|
- (_('Location'), ('region_id', 'site_group_id', 'site_id', 'location_id', 'rack_id')),
|
|
|
|
|
- (_('Device'), ('device_type_id', 'device_role_id', 'device_id', 'virtual_chassis_id')),
|
|
|
|
|
- (_('Connection'), ('cabled', 'connected', 'occupied')),
|
|
|
|
|
|
|
+ FieldSet('q', 'filter_id', 'tag'),
|
|
|
|
|
+ FieldSet('name', 'label', 'type', 'speed', name=_('Attributes')),
|
|
|
|
|
+ FieldSet('region_id', 'site_group_id', 'site_id', 'location_id', 'rack_id', name=_('Location')),
|
|
|
|
|
+ FieldSet('device_type_id', 'device_role_id', 'device_id', 'virtual_chassis_id', name=_('Device')),
|
|
|
|
|
+ FieldSet('cabled', 'connected', 'occupied', name=_('Connection')),
|
|
|
)
|
|
)
|
|
|
type = forms.MultipleChoiceField(
|
|
type = forms.MultipleChoiceField(
|
|
|
label=_('Type'),
|
|
label=_('Type'),
|
|
@@ -1163,11 +1168,11 @@ class ConsolePortFilterForm(PathEndpointFilterForm, DeviceComponentFilterForm):
|
|
|
class ConsoleServerPortFilterForm(PathEndpointFilterForm, DeviceComponentFilterForm):
|
|
class ConsoleServerPortFilterForm(PathEndpointFilterForm, DeviceComponentFilterForm):
|
|
|
model = ConsoleServerPort
|
|
model = ConsoleServerPort
|
|
|
fieldsets = (
|
|
fieldsets = (
|
|
|
- (None, ('q', 'filter_id', 'tag')),
|
|
|
|
|
- (_('Attributes'), ('name', 'label', 'type', 'speed')),
|
|
|
|
|
- (_('Location'), ('region_id', 'site_group_id', 'site_id', 'location_id', 'rack_id')),
|
|
|
|
|
- (_('Device'), ('device_type_id', 'device_role_id', 'device_id', 'virtual_chassis_id')),
|
|
|
|
|
- (_('Connection'), ('cabled', 'connected', 'occupied')),
|
|
|
|
|
|
|
+ FieldSet('q', 'filter_id', 'tag'),
|
|
|
|
|
+ FieldSet('name', 'label', 'type', 'speed', name=_('Attributes')),
|
|
|
|
|
+ FieldSet('region_id', 'site_group_id', 'site_id', 'location_id', 'rack_id', name=_('Location')),
|
|
|
|
|
+ FieldSet('device_type_id', 'device_role_id', 'device_id', 'virtual_chassis_id', name=_('Device')),
|
|
|
|
|
+ FieldSet('cabled', 'connected', 'occupied', name=_('Connection')),
|
|
|
)
|
|
)
|
|
|
type = forms.MultipleChoiceField(
|
|
type = forms.MultipleChoiceField(
|
|
|
label=_('Type'),
|
|
label=_('Type'),
|
|
@@ -1185,11 +1190,11 @@ class ConsoleServerPortFilterForm(PathEndpointFilterForm, DeviceComponentFilterF
|
|
|
class PowerPortFilterForm(PathEndpointFilterForm, DeviceComponentFilterForm):
|
|
class PowerPortFilterForm(PathEndpointFilterForm, DeviceComponentFilterForm):
|
|
|
model = PowerPort
|
|
model = PowerPort
|
|
|
fieldsets = (
|
|
fieldsets = (
|
|
|
- (None, ('q', 'filter_id', 'tag')),
|
|
|
|
|
- (_('Attributes'), ('name', 'label', 'type')),
|
|
|
|
|
- (_('Location'), ('region_id', 'site_group_id', 'site_id', 'location_id', 'rack_id')),
|
|
|
|
|
- (_('Device'), ('device_type_id', 'device_role_id', 'device_id', 'virtual_chassis_id')),
|
|
|
|
|
- (_('Connection'), ('cabled', 'connected', 'occupied')),
|
|
|
|
|
|
|
+ FieldSet('q', 'filter_id', 'tag'),
|
|
|
|
|
+ FieldSet('name', 'label', 'type', name=_('Attributes')),
|
|
|
|
|
+ FieldSet('region_id', 'site_group_id', 'site_id', 'location_id', 'rack_id', name=_('Location')),
|
|
|
|
|
+ FieldSet('device_type_id', 'device_role_id', 'device_id', 'virtual_chassis_id', name=_('Device')),
|
|
|
|
|
+ FieldSet('cabled', 'connected', 'occupied', name=_('Connection')),
|
|
|
)
|
|
)
|
|
|
type = forms.MultipleChoiceField(
|
|
type = forms.MultipleChoiceField(
|
|
|
label=_('Type'),
|
|
label=_('Type'),
|
|
@@ -1202,11 +1207,11 @@ class PowerPortFilterForm(PathEndpointFilterForm, DeviceComponentFilterForm):
|
|
|
class PowerOutletFilterForm(PathEndpointFilterForm, DeviceComponentFilterForm):
|
|
class PowerOutletFilterForm(PathEndpointFilterForm, DeviceComponentFilterForm):
|
|
|
model = PowerOutlet
|
|
model = PowerOutlet
|
|
|
fieldsets = (
|
|
fieldsets = (
|
|
|
- (None, ('q', 'filter_id', 'tag')),
|
|
|
|
|
- (_('Attributes'), ('name', 'label', 'type')),
|
|
|
|
|
- (_('Location'), ('region_id', 'site_group_id', 'site_id', 'location_id', 'rack_id')),
|
|
|
|
|
- (_('Device'), ('device_type_id', 'device_role_id', 'device_id', 'virtual_chassis_id')),
|
|
|
|
|
- (_('Connection'), ('cabled', 'connected', 'occupied')),
|
|
|
|
|
|
|
+ FieldSet('q', 'filter_id', 'tag'),
|
|
|
|
|
+ FieldSet('name', 'label', 'type', name=_('Attributes')),
|
|
|
|
|
+ FieldSet('region_id', 'site_group_id', 'site_id', 'location_id', 'rack_id', name=_('Location')),
|
|
|
|
|
+ FieldSet('device_type_id', 'device_role_id', 'device_id', 'virtual_chassis_id', name=_('Device')),
|
|
|
|
|
+ FieldSet('cabled', 'connected', 'occupied', name=_('Connection')),
|
|
|
)
|
|
)
|
|
|
type = forms.MultipleChoiceField(
|
|
type = forms.MultipleChoiceField(
|
|
|
label=_('Type'),
|
|
label=_('Type'),
|
|
@@ -1219,14 +1224,14 @@ class PowerOutletFilterForm(PathEndpointFilterForm, DeviceComponentFilterForm):
|
|
|
class InterfaceFilterForm(PathEndpointFilterForm, DeviceComponentFilterForm):
|
|
class InterfaceFilterForm(PathEndpointFilterForm, DeviceComponentFilterForm):
|
|
|
model = Interface
|
|
model = Interface
|
|
|
fieldsets = (
|
|
fieldsets = (
|
|
|
- (None, ('q', 'filter_id', 'tag')),
|
|
|
|
|
- (_('Attributes'), ('name', 'label', 'kind', 'type', 'speed', 'duplex', 'enabled', 'mgmt_only')),
|
|
|
|
|
- (_('Addressing'), ('vrf_id', 'l2vpn_id', 'mac_address', 'wwn')),
|
|
|
|
|
- (_('PoE'), ('poe_mode', 'poe_type')),
|
|
|
|
|
- (_('Wireless'), ('rf_role', 'rf_channel', 'rf_channel_width', 'tx_power')),
|
|
|
|
|
- (_('Location'), ('region_id', 'site_group_id', 'site_id', 'location_id', 'rack_id')),
|
|
|
|
|
- (_('Device'), ('device_type_id', 'device_role_id', 'device_id', 'virtual_chassis_id', 'vdc_id')),
|
|
|
|
|
- (_('Connection'), ('cabled', 'connected', 'occupied')),
|
|
|
|
|
|
|
+ FieldSet('q', 'filter_id', 'tag'),
|
|
|
|
|
+ FieldSet('name', 'label', 'kind', 'type', 'speed', 'duplex', 'enabled', 'mgmt_only', name=_('Attributes')),
|
|
|
|
|
+ FieldSet('vrf_id', 'l2vpn_id', 'mac_address', 'wwn', name=_('Addressing')),
|
|
|
|
|
+ FieldSet('poe_mode', 'poe_type', name=_('PoE')),
|
|
|
|
|
+ FieldSet('rf_role', 'rf_channel', 'rf_channel_width', 'tx_power', name=_('Wireless')),
|
|
|
|
|
+ FieldSet('region_id', 'site_group_id', 'site_id', 'location_id', 'rack_id', name=_('Location')),
|
|
|
|
|
+ FieldSet('device_type_id', 'device_role_id', 'device_id', 'virtual_chassis_id', 'vdc_id', name=_('Device')),
|
|
|
|
|
+ FieldSet('cabled', 'connected', 'occupied', name=_('Connection')),
|
|
|
)
|
|
)
|
|
|
selector_fields = ('filter_id', 'q', 'device_id')
|
|
selector_fields = ('filter_id', 'q', 'device_id')
|
|
|
vdc_id = DynamicModelMultipleChoiceField(
|
|
vdc_id = DynamicModelMultipleChoiceField(
|
|
@@ -1330,11 +1335,11 @@ class InterfaceFilterForm(PathEndpointFilterForm, DeviceComponentFilterForm):
|
|
|
|
|
|
|
|
class FrontPortFilterForm(CabledFilterForm, DeviceComponentFilterForm):
|
|
class FrontPortFilterForm(CabledFilterForm, DeviceComponentFilterForm):
|
|
|
fieldsets = (
|
|
fieldsets = (
|
|
|
- (None, ('q', 'filter_id', 'tag')),
|
|
|
|
|
- (_('Attributes'), ('name', 'label', 'type', 'color')),
|
|
|
|
|
- (_('Location'), ('region_id', 'site_group_id', 'site_id', 'location_id', 'rack_id')),
|
|
|
|
|
- (_('Device'), ('device_type_id', 'device_role_id', 'device_id', 'virtual_chassis_id')),
|
|
|
|
|
- (_('Cable'), ('cabled', 'occupied')),
|
|
|
|
|
|
|
+ FieldSet('q', 'filter_id', 'tag'),
|
|
|
|
|
+ FieldSet('name', 'label', 'type', 'color', name=_('Attributes')),
|
|
|
|
|
+ FieldSet('region_id', 'site_group_id', 'site_id', 'location_id', 'rack_id', name=_('Location')),
|
|
|
|
|
+ FieldSet('device_type_id', 'device_role_id', 'device_id', 'virtual_chassis_id', name=_('Device')),
|
|
|
|
|
+ FieldSet('cabled', 'occupied', name=_('Cable')),
|
|
|
)
|
|
)
|
|
|
model = FrontPort
|
|
model = FrontPort
|
|
|
type = forms.MultipleChoiceField(
|
|
type = forms.MultipleChoiceField(
|
|
@@ -1352,11 +1357,11 @@ class FrontPortFilterForm(CabledFilterForm, DeviceComponentFilterForm):
|
|
|
class RearPortFilterForm(CabledFilterForm, DeviceComponentFilterForm):
|
|
class RearPortFilterForm(CabledFilterForm, DeviceComponentFilterForm):
|
|
|
model = RearPort
|
|
model = RearPort
|
|
|
fieldsets = (
|
|
fieldsets = (
|
|
|
- (None, ('q', 'filter_id', 'tag')),
|
|
|
|
|
- (_('Attributes'), ('name', 'label', 'type', 'color')),
|
|
|
|
|
- (_('Location'), ('region_id', 'site_group_id', 'site_id', 'location_id', 'rack_id')),
|
|
|
|
|
- (_('Device'), ('device_type_id', 'device_role_id', 'device_id', 'virtual_chassis_id')),
|
|
|
|
|
- (_('Cable'), ('cabled', 'occupied')),
|
|
|
|
|
|
|
+ FieldSet('q', 'filter_id', 'tag'),
|
|
|
|
|
+ FieldSet('name', 'label', 'type', 'color', name=_('Attributes')),
|
|
|
|
|
+ FieldSet('region_id', 'site_group_id', 'site_id', 'location_id', 'rack_id', name=_('Location')),
|
|
|
|
|
+ FieldSet('device_type_id', 'device_role_id', 'device_id', 'virtual_chassis_id', name=_('Device')),
|
|
|
|
|
+ FieldSet('cabled', 'occupied', name=_('Cable')),
|
|
|
)
|
|
)
|
|
|
type = forms.MultipleChoiceField(
|
|
type = forms.MultipleChoiceField(
|
|
|
label=_('Type'),
|
|
label=_('Type'),
|
|
@@ -1373,10 +1378,10 @@ class RearPortFilterForm(CabledFilterForm, DeviceComponentFilterForm):
|
|
|
class ModuleBayFilterForm(DeviceComponentFilterForm):
|
|
class ModuleBayFilterForm(DeviceComponentFilterForm):
|
|
|
model = ModuleBay
|
|
model = ModuleBay
|
|
|
fieldsets = (
|
|
fieldsets = (
|
|
|
- (None, ('q', 'filter_id', 'tag')),
|
|
|
|
|
- (_('Attributes'), ('name', 'label', 'position')),
|
|
|
|
|
- (_('Location'), ('region_id', 'site_group_id', 'site_id', 'location_id', 'rack_id')),
|
|
|
|
|
- (_('Device'), ('device_type_id', 'device_role_id', 'device_id', 'virtual_chassis_id')),
|
|
|
|
|
|
|
+ FieldSet('q', 'filter_id', 'tag'),
|
|
|
|
|
+ FieldSet('name', 'label', 'position', name=_('Attributes')),
|
|
|
|
|
+ FieldSet('region_id', 'site_group_id', 'site_id', 'location_id', 'rack_id', name=_('Location')),
|
|
|
|
|
+ FieldSet('device_type_id', 'device_role_id', 'device_id', 'virtual_chassis_id', name=_('Device')),
|
|
|
)
|
|
)
|
|
|
tag = TagFilterField(model)
|
|
tag = TagFilterField(model)
|
|
|
position = forms.CharField(
|
|
position = forms.CharField(
|
|
@@ -1388,10 +1393,10 @@ class ModuleBayFilterForm(DeviceComponentFilterForm):
|
|
|
class DeviceBayFilterForm(DeviceComponentFilterForm):
|
|
class DeviceBayFilterForm(DeviceComponentFilterForm):
|
|
|
model = DeviceBay
|
|
model = DeviceBay
|
|
|
fieldsets = (
|
|
fieldsets = (
|
|
|
- (None, ('q', 'filter_id', 'tag')),
|
|
|
|
|
- (_('Attributes'), ('name', 'label')),
|
|
|
|
|
- (_('Location'), ('region_id', 'site_group_id', 'site_id', 'location_id', 'rack_id')),
|
|
|
|
|
- (_('Device'), ('device_type_id', 'device_role_id', 'device_id', 'virtual_chassis_id')),
|
|
|
|
|
|
|
+ FieldSet('q', 'filter_id', 'tag'),
|
|
|
|
|
+ FieldSet('name', 'label', name=_('Attributes')),
|
|
|
|
|
+ FieldSet('region_id', 'site_group_id', 'site_id', 'location_id', 'rack_id', name=_('Location')),
|
|
|
|
|
+ FieldSet('device_type_id', 'device_role_id', 'device_id', 'virtual_chassis_id', name=_('Device')),
|
|
|
)
|
|
)
|
|
|
tag = TagFilterField(model)
|
|
tag = TagFilterField(model)
|
|
|
|
|
|
|
@@ -1399,10 +1404,13 @@ class DeviceBayFilterForm(DeviceComponentFilterForm):
|
|
|
class InventoryItemFilterForm(DeviceComponentFilterForm):
|
|
class InventoryItemFilterForm(DeviceComponentFilterForm):
|
|
|
model = InventoryItem
|
|
model = InventoryItem
|
|
|
fieldsets = (
|
|
fieldsets = (
|
|
|
- (None, ('q', 'filter_id', 'tag')),
|
|
|
|
|
- (_('Attributes'), ('name', 'label', 'role_id', 'manufacturer_id', 'serial', 'asset_tag', 'discovered')),
|
|
|
|
|
- (_('Location'), ('region_id', 'site_group_id', 'site_id', 'location_id', 'rack_id')),
|
|
|
|
|
- (_('Device'), ('device_type_id', 'device_role_id', 'device_id', 'virtual_chassis_id')),
|
|
|
|
|
|
|
+ FieldSet('q', 'filter_id', 'tag'),
|
|
|
|
|
+ FieldSet(
|
|
|
|
|
+ 'name', 'label', 'role_id', 'manufacturer_id', 'serial', 'asset_tag', 'discovered',
|
|
|
|
|
+ name=_('Attributes')
|
|
|
|
|
+ ),
|
|
|
|
|
+ FieldSet('region_id', 'site_group_id', 'site_id', 'location_id', 'rack_id', name=_('Location')),
|
|
|
|
|
+ FieldSet('device_type_id', 'device_role_id', 'device_id', 'virtual_chassis_id', name=_('Device')),
|
|
|
)
|
|
)
|
|
|
role_id = DynamicModelMultipleChoiceField(
|
|
role_id = DynamicModelMultipleChoiceField(
|
|
|
queryset=InventoryItemRole.objects.all(),
|
|
queryset=InventoryItemRole.objects.all(),
|