|
@@ -1,6 +1,6 @@
|
|
|
from django import forms
|
|
from django import forms
|
|
|
from django.contrib.auth import get_user_model
|
|
from django.contrib.auth import get_user_model
|
|
|
-from django.utils.translation import gettext as _
|
|
|
|
|
|
|
+from django.utils.translation import gettext_lazy as _
|
|
|
|
|
|
|
|
from dcim.choices import *
|
|
from dcim.choices import *
|
|
|
from dcim.constants import *
|
|
from dcim.constants import *
|
|
@@ -56,9 +56,11 @@ __all__ = (
|
|
|
|
|
|
|
|
class DeviceComponentFilterForm(NetBoxModelFilterSetForm):
|
|
class DeviceComponentFilterForm(NetBoxModelFilterSetForm):
|
|
|
name = forms.CharField(
|
|
name = forms.CharField(
|
|
|
|
|
+ label=_('Name'),
|
|
|
required=False
|
|
required=False
|
|
|
)
|
|
)
|
|
|
label = forms.CharField(
|
|
label = forms.CharField(
|
|
|
|
|
+ label=_('Label'),
|
|
|
required=False
|
|
required=False
|
|
|
)
|
|
)
|
|
|
region_id = DynamicModelMultipleChoiceField(
|
|
region_id = DynamicModelMultipleChoiceField(
|
|
@@ -130,7 +132,7 @@ class RegionFilterForm(ContactModelFilterForm, NetBoxModelFilterSetForm):
|
|
|
model = Region
|
|
model = Region
|
|
|
fieldsets = (
|
|
fieldsets = (
|
|
|
(None, ('q', 'filter_id', 'tag', 'parent_id')),
|
|
(None, ('q', 'filter_id', 'tag', 'parent_id')),
|
|
|
- ('Contacts', ('contact', 'contact_role', 'contact_group'))
|
|
|
|
|
|
|
+ (_('Contacts'), ('contact', 'contact_role', 'contact_group'))
|
|
|
)
|
|
)
|
|
|
parent_id = DynamicModelMultipleChoiceField(
|
|
parent_id = DynamicModelMultipleChoiceField(
|
|
|
queryset=Region.objects.all(),
|
|
queryset=Region.objects.all(),
|
|
@@ -144,7 +146,7 @@ class SiteGroupFilterForm(ContactModelFilterForm, NetBoxModelFilterSetForm):
|
|
|
model = SiteGroup
|
|
model = SiteGroup
|
|
|
fieldsets = (
|
|
fieldsets = (
|
|
|
(None, ('q', 'filter_id', 'tag', 'parent_id')),
|
|
(None, ('q', 'filter_id', 'tag', 'parent_id')),
|
|
|
- ('Contacts', ('contact', 'contact_role', 'contact_group'))
|
|
|
|
|
|
|
+ (_('Contacts'), ('contact', 'contact_role', 'contact_group'))
|
|
|
)
|
|
)
|
|
|
parent_id = DynamicModelMultipleChoiceField(
|
|
parent_id = DynamicModelMultipleChoiceField(
|
|
|
queryset=SiteGroup.objects.all(),
|
|
queryset=SiteGroup.objects.all(),
|
|
@@ -158,11 +160,12 @@ class SiteFilterForm(TenancyFilterForm, ContactModelFilterForm, NetBoxModelFilte
|
|
|
model = Site
|
|
model = Site
|
|
|
fieldsets = (
|
|
fieldsets = (
|
|
|
(None, ('q', 'filter_id', 'tag')),
|
|
(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')),
|
|
|
|
|
|
|
+ (_('Attributes'), ('status', 'region_id', 'group_id', 'asn_id')),
|
|
|
|
|
+ (_('Tenant'), ('tenant_group_id', 'tenant_id')),
|
|
|
|
|
+ (_('Contacts'), ('contact', 'contact_role', 'contact_group')),
|
|
|
)
|
|
)
|
|
|
status = forms.MultipleChoiceField(
|
|
status = forms.MultipleChoiceField(
|
|
|
|
|
+ label=_('Status'),
|
|
|
choices=SiteStatusChoices,
|
|
choices=SiteStatusChoices,
|
|
|
required=False
|
|
required=False
|
|
|
)
|
|
)
|
|
@@ -188,9 +191,9 @@ class LocationFilterForm(TenancyFilterForm, ContactModelFilterForm, NetBoxModelF
|
|
|
model = Location
|
|
model = Location
|
|
|
fieldsets = (
|
|
fieldsets = (
|
|
|
(None, ('q', 'filter_id', 'tag')),
|
|
(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')),
|
|
|
|
|
|
|
+ (_('Attributes'), ('region_id', 'site_group_id', 'site_id', 'parent_id', 'status')),
|
|
|
|
|
+ (_('Tenant'), ('tenant_group_id', 'tenant_id')),
|
|
|
|
|
+ (_('Contacts'), ('contact', 'contact_role', 'contact_group')),
|
|
|
)
|
|
)
|
|
|
region_id = DynamicModelMultipleChoiceField(
|
|
region_id = DynamicModelMultipleChoiceField(
|
|
|
queryset=Region.objects.all(),
|
|
queryset=Region.objects.all(),
|
|
@@ -221,6 +224,7 @@ class LocationFilterForm(TenancyFilterForm, ContactModelFilterForm, NetBoxModelF
|
|
|
label=_('Parent')
|
|
label=_('Parent')
|
|
|
)
|
|
)
|
|
|
status = forms.MultipleChoiceField(
|
|
status = forms.MultipleChoiceField(
|
|
|
|
|
+ label=_('Status'),
|
|
|
choices=LocationStatusChoices,
|
|
choices=LocationStatusChoices,
|
|
|
required=False
|
|
required=False
|
|
|
)
|
|
)
|
|
@@ -236,12 +240,12 @@ class RackFilterForm(TenancyFilterForm, ContactModelFilterForm, NetBoxModelFilte
|
|
|
model = Rack
|
|
model = Rack
|
|
|
fieldsets = (
|
|
fieldsets = (
|
|
|
(None, ('q', 'filter_id', 'tag')),
|
|
(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')),
|
|
|
|
|
|
|
+ (_('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')),
|
|
|
)
|
|
)
|
|
|
region_id = DynamicModelMultipleChoiceField(
|
|
region_id = DynamicModelMultipleChoiceField(
|
|
|
queryset=Region.objects.all(),
|
|
queryset=Region.objects.all(),
|
|
@@ -271,14 +275,17 @@ class RackFilterForm(TenancyFilterForm, ContactModelFilterForm, NetBoxModelFilte
|
|
|
label=_('Location')
|
|
label=_('Location')
|
|
|
)
|
|
)
|
|
|
status = forms.MultipleChoiceField(
|
|
status = forms.MultipleChoiceField(
|
|
|
|
|
+ label=_('Status'),
|
|
|
choices=RackStatusChoices,
|
|
choices=RackStatusChoices,
|
|
|
required=False
|
|
required=False
|
|
|
)
|
|
)
|
|
|
type = forms.MultipleChoiceField(
|
|
type = forms.MultipleChoiceField(
|
|
|
|
|
+ label=_('Type'),
|
|
|
choices=RackTypeChoices,
|
|
choices=RackTypeChoices,
|
|
|
required=False
|
|
required=False
|
|
|
)
|
|
)
|
|
|
width = forms.MultipleChoiceField(
|
|
width = forms.MultipleChoiceField(
|
|
|
|
|
+ label=_('Width'),
|
|
|
choices=RackWidthChoices,
|
|
choices=RackWidthChoices,
|
|
|
required=False
|
|
required=False
|
|
|
)
|
|
)
|
|
@@ -289,21 +296,26 @@ class RackFilterForm(TenancyFilterForm, ContactModelFilterForm, NetBoxModelFilte
|
|
|
label=_('Role')
|
|
label=_('Role')
|
|
|
)
|
|
)
|
|
|
serial = forms.CharField(
|
|
serial = forms.CharField(
|
|
|
|
|
+ label=_('Serial'),
|
|
|
required=False
|
|
required=False
|
|
|
)
|
|
)
|
|
|
asset_tag = forms.CharField(
|
|
asset_tag = forms.CharField(
|
|
|
|
|
+ label=_('Asset tag'),
|
|
|
required=False
|
|
required=False
|
|
|
)
|
|
)
|
|
|
tag = TagFilterField(model)
|
|
tag = TagFilterField(model)
|
|
|
weight = forms.DecimalField(
|
|
weight = forms.DecimalField(
|
|
|
|
|
+ label=_('Weight'),
|
|
|
required=False,
|
|
required=False,
|
|
|
min_value=1
|
|
min_value=1
|
|
|
)
|
|
)
|
|
|
max_weight = forms.IntegerField(
|
|
max_weight = forms.IntegerField(
|
|
|
|
|
+ label=_('Max weight'),
|
|
|
required=False,
|
|
required=False,
|
|
|
min_value=1
|
|
min_value=1
|
|
|
)
|
|
)
|
|
|
weight_unit = forms.ChoiceField(
|
|
weight_unit = forms.ChoiceField(
|
|
|
|
|
+ label=_('Weight unit'),
|
|
|
choices=add_blank_choice(WeightUnitChoices),
|
|
choices=add_blank_choice(WeightUnitChoices),
|
|
|
required=False
|
|
required=False
|
|
|
)
|
|
)
|
|
@@ -312,12 +324,12 @@ class RackFilterForm(TenancyFilterForm, ContactModelFilterForm, NetBoxModelFilte
|
|
|
class RackElevationFilterForm(RackFilterForm):
|
|
class RackElevationFilterForm(RackFilterForm):
|
|
|
fieldsets = (
|
|
fieldsets = (
|
|
|
(None, ('q', 'filter_id', 'tag')),
|
|
(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')),
|
|
|
|
|
|
|
+ (_('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')),
|
|
|
)
|
|
)
|
|
|
id = DynamicModelMultipleChoiceField(
|
|
id = DynamicModelMultipleChoiceField(
|
|
|
queryset=Rack.objects.all(),
|
|
queryset=Rack.objects.all(),
|
|
@@ -334,9 +346,9 @@ class RackReservationFilterForm(TenancyFilterForm, NetBoxModelFilterSetForm):
|
|
|
model = RackReservation
|
|
model = RackReservation
|
|
|
fieldsets = (
|
|
fieldsets = (
|
|
|
(None, ('q', 'filter_id', 'tag')),
|
|
(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')),
|
|
|
|
|
|
|
+ (_('User'), ('user_id',)),
|
|
|
|
|
+ (_('Rack'), ('region_id', 'site_group_id', 'site_id', 'location_id', 'rack_id')),
|
|
|
|
|
+ (_('Tenant'), ('tenant_group_id', 'tenant_id')),
|
|
|
)
|
|
)
|
|
|
region_id = DynamicModelMultipleChoiceField(
|
|
region_id = DynamicModelMultipleChoiceField(
|
|
|
queryset=Region.objects.all(),
|
|
queryset=Region.objects.all(),
|
|
@@ -390,7 +402,7 @@ class ManufacturerFilterForm(ContactModelFilterForm, NetBoxModelFilterSetForm):
|
|
|
model = Manufacturer
|
|
model = Manufacturer
|
|
|
fieldsets = (
|
|
fieldsets = (
|
|
|
(None, ('q', 'filter_id', 'tag')),
|
|
(None, ('q', 'filter_id', 'tag')),
|
|
|
- ('Contacts', ('contact', 'contact_role', 'contact_group'))
|
|
|
|
|
|
|
+ (_('Contacts'), ('contact', 'contact_role', 'contact_group'))
|
|
|
)
|
|
)
|
|
|
tag = TagFilterField(model)
|
|
tag = TagFilterField(model)
|
|
|
|
|
|
|
@@ -399,13 +411,13 @@ class DeviceTypeFilterForm(NetBoxModelFilterSetForm):
|
|
|
model = DeviceType
|
|
model = DeviceType
|
|
|
fieldsets = (
|
|
fieldsets = (
|
|
|
(None, ('q', 'filter_id', 'tag')),
|
|
(None, ('q', 'filter_id', 'tag')),
|
|
|
- ('Hardware', ('manufacturer_id', 'default_platform_id', 'part_number', 'subdevice_role', 'airflow')),
|
|
|
|
|
- ('Images', ('has_front_image', 'has_rear_image')),
|
|
|
|
|
- ('Components', (
|
|
|
|
|
|
|
+ (_('Hardware'), ('manufacturer_id', 'default_platform_id', 'part_number', 'subdevice_role', 'airflow')),
|
|
|
|
|
+ (_('Images'), ('has_front_image', 'has_rear_image')),
|
|
|
|
|
+ (_('Components'), (
|
|
|
'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',
|
|
'pass_through_ports', 'device_bays', 'module_bays', 'inventory_items',
|
|
|
)),
|
|
)),
|
|
|
- ('Weight', ('weight', 'weight_unit')),
|
|
|
|
|
|
|
+ (_('Weight'), ('weight', 'weight_unit')),
|
|
|
)
|
|
)
|
|
|
manufacturer_id = DynamicModelMultipleChoiceField(
|
|
manufacturer_id = DynamicModelMultipleChoiceField(
|
|
|
queryset=Manufacturer.objects.all(),
|
|
queryset=Manufacturer.objects.all(),
|
|
@@ -418,98 +430,103 @@ class DeviceTypeFilterForm(NetBoxModelFilterSetForm):
|
|
|
label=_('Default platform')
|
|
label=_('Default platform')
|
|
|
)
|
|
)
|
|
|
part_number = forms.CharField(
|
|
part_number = forms.CharField(
|
|
|
|
|
+ label=_('Part number'),
|
|
|
required=False
|
|
required=False
|
|
|
)
|
|
)
|
|
|
subdevice_role = forms.MultipleChoiceField(
|
|
subdevice_role = forms.MultipleChoiceField(
|
|
|
|
|
+ label=_('Subdevice role'),
|
|
|
choices=add_blank_choice(SubdeviceRoleChoices),
|
|
choices=add_blank_choice(SubdeviceRoleChoices),
|
|
|
required=False
|
|
required=False
|
|
|
)
|
|
)
|
|
|
airflow = forms.MultipleChoiceField(
|
|
airflow = forms.MultipleChoiceField(
|
|
|
|
|
+ label=_('Airflow'),
|
|
|
choices=add_blank_choice(DeviceAirflowChoices),
|
|
choices=add_blank_choice(DeviceAirflowChoices),
|
|
|
required=False
|
|
required=False
|
|
|
)
|
|
)
|
|
|
has_front_image = forms.NullBooleanField(
|
|
has_front_image = forms.NullBooleanField(
|
|
|
required=False,
|
|
required=False,
|
|
|
- label='Has a front image',
|
|
|
|
|
|
|
+ label=_('Has a front image'),
|
|
|
widget=forms.Select(
|
|
widget=forms.Select(
|
|
|
choices=BOOLEAN_WITH_BLANK_CHOICES
|
|
choices=BOOLEAN_WITH_BLANK_CHOICES
|
|
|
)
|
|
)
|
|
|
)
|
|
)
|
|
|
has_rear_image = forms.NullBooleanField(
|
|
has_rear_image = forms.NullBooleanField(
|
|
|
required=False,
|
|
required=False,
|
|
|
- label='Has a rear image',
|
|
|
|
|
|
|
+ label=_('Has a rear image'),
|
|
|
widget=forms.Select(
|
|
widget=forms.Select(
|
|
|
choices=BOOLEAN_WITH_BLANK_CHOICES
|
|
choices=BOOLEAN_WITH_BLANK_CHOICES
|
|
|
)
|
|
)
|
|
|
)
|
|
)
|
|
|
console_ports = forms.NullBooleanField(
|
|
console_ports = forms.NullBooleanField(
|
|
|
required=False,
|
|
required=False,
|
|
|
- label='Has console ports',
|
|
|
|
|
|
|
+ label=_('Has console ports'),
|
|
|
widget=forms.Select(
|
|
widget=forms.Select(
|
|
|
choices=BOOLEAN_WITH_BLANK_CHOICES
|
|
choices=BOOLEAN_WITH_BLANK_CHOICES
|
|
|
)
|
|
)
|
|
|
)
|
|
)
|
|
|
console_server_ports = forms.NullBooleanField(
|
|
console_server_ports = forms.NullBooleanField(
|
|
|
required=False,
|
|
required=False,
|
|
|
- label='Has console server ports',
|
|
|
|
|
|
|
+ label=_('Has console server ports'),
|
|
|
widget=forms.Select(
|
|
widget=forms.Select(
|
|
|
choices=BOOLEAN_WITH_BLANK_CHOICES
|
|
choices=BOOLEAN_WITH_BLANK_CHOICES
|
|
|
)
|
|
)
|
|
|
)
|
|
)
|
|
|
power_ports = forms.NullBooleanField(
|
|
power_ports = forms.NullBooleanField(
|
|
|
required=False,
|
|
required=False,
|
|
|
- label='Has power ports',
|
|
|
|
|
|
|
+ label=_('Has power ports'),
|
|
|
widget=forms.Select(
|
|
widget=forms.Select(
|
|
|
choices=BOOLEAN_WITH_BLANK_CHOICES
|
|
choices=BOOLEAN_WITH_BLANK_CHOICES
|
|
|
)
|
|
)
|
|
|
)
|
|
)
|
|
|
power_outlets = forms.NullBooleanField(
|
|
power_outlets = forms.NullBooleanField(
|
|
|
required=False,
|
|
required=False,
|
|
|
- label='Has power outlets',
|
|
|
|
|
|
|
+ label=_('Has power outlets'),
|
|
|
widget=forms.Select(
|
|
widget=forms.Select(
|
|
|
choices=BOOLEAN_WITH_BLANK_CHOICES
|
|
choices=BOOLEAN_WITH_BLANK_CHOICES
|
|
|
)
|
|
)
|
|
|
)
|
|
)
|
|
|
interfaces = forms.NullBooleanField(
|
|
interfaces = forms.NullBooleanField(
|
|
|
required=False,
|
|
required=False,
|
|
|
- label='Has interfaces',
|
|
|
|
|
|
|
+ label=_('Has interfaces'),
|
|
|
widget=forms.Select(
|
|
widget=forms.Select(
|
|
|
choices=BOOLEAN_WITH_BLANK_CHOICES
|
|
choices=BOOLEAN_WITH_BLANK_CHOICES
|
|
|
)
|
|
)
|
|
|
)
|
|
)
|
|
|
pass_through_ports = forms.NullBooleanField(
|
|
pass_through_ports = forms.NullBooleanField(
|
|
|
required=False,
|
|
required=False,
|
|
|
- label='Has pass-through ports',
|
|
|
|
|
|
|
+ label=_('Has pass-through ports'),
|
|
|
widget=forms.Select(
|
|
widget=forms.Select(
|
|
|
choices=BOOLEAN_WITH_BLANK_CHOICES
|
|
choices=BOOLEAN_WITH_BLANK_CHOICES
|
|
|
)
|
|
)
|
|
|
)
|
|
)
|
|
|
device_bays = forms.NullBooleanField(
|
|
device_bays = forms.NullBooleanField(
|
|
|
required=False,
|
|
required=False,
|
|
|
- label='Has device bays',
|
|
|
|
|
|
|
+ label=_('Has device bays'),
|
|
|
widget=forms.Select(
|
|
widget=forms.Select(
|
|
|
choices=BOOLEAN_WITH_BLANK_CHOICES
|
|
choices=BOOLEAN_WITH_BLANK_CHOICES
|
|
|
)
|
|
)
|
|
|
)
|
|
)
|
|
|
module_bays = forms.NullBooleanField(
|
|
module_bays = forms.NullBooleanField(
|
|
|
required=False,
|
|
required=False,
|
|
|
- label='Has module bays',
|
|
|
|
|
|
|
+ label=_('Has module bays'),
|
|
|
widget=forms.Select(
|
|
widget=forms.Select(
|
|
|
choices=BOOLEAN_WITH_BLANK_CHOICES
|
|
choices=BOOLEAN_WITH_BLANK_CHOICES
|
|
|
)
|
|
)
|
|
|
)
|
|
)
|
|
|
inventory_items = forms.NullBooleanField(
|
|
inventory_items = forms.NullBooleanField(
|
|
|
required=False,
|
|
required=False,
|
|
|
- label='Has inventory items',
|
|
|
|
|
|
|
+ label=_('Has inventory items'),
|
|
|
widget=forms.Select(
|
|
widget=forms.Select(
|
|
|
choices=BOOLEAN_WITH_BLANK_CHOICES
|
|
choices=BOOLEAN_WITH_BLANK_CHOICES
|
|
|
)
|
|
)
|
|
|
)
|
|
)
|
|
|
tag = TagFilterField(model)
|
|
tag = TagFilterField(model)
|
|
|
weight = forms.DecimalField(
|
|
weight = forms.DecimalField(
|
|
|
|
|
+ label=_('Weight'),
|
|
|
required=False
|
|
required=False
|
|
|
)
|
|
)
|
|
|
weight_unit = forms.ChoiceField(
|
|
weight_unit = forms.ChoiceField(
|
|
|
|
|
+ label=_('Weight unit'),
|
|
|
choices=add_blank_choice(WeightUnitChoices),
|
|
choices=add_blank_choice(WeightUnitChoices),
|
|
|
required=False
|
|
required=False
|
|
|
)
|
|
)
|
|
@@ -519,12 +536,12 @@ class ModuleTypeFilterForm(NetBoxModelFilterSetForm):
|
|
|
model = ModuleType
|
|
model = ModuleType
|
|
|
fieldsets = (
|
|
fieldsets = (
|
|
|
(None, ('q', 'filter_id', 'tag')),
|
|
(None, ('q', 'filter_id', 'tag')),
|
|
|
- ('Hardware', ('manufacturer_id', 'part_number')),
|
|
|
|
|
- ('Components', (
|
|
|
|
|
|
|
+ (_('Hardware'), ('manufacturer_id', 'part_number')),
|
|
|
|
|
+ (_('Components'), (
|
|
|
'console_ports', 'console_server_ports', 'power_ports', 'power_outlets', 'interfaces',
|
|
'console_ports', 'console_server_ports', 'power_ports', 'power_outlets', 'interfaces',
|
|
|
'pass_through_ports',
|
|
'pass_through_ports',
|
|
|
)),
|
|
)),
|
|
|
- ('Weight', ('weight', 'weight_unit')),
|
|
|
|
|
|
|
+ (_('Weight'), ('weight', 'weight_unit')),
|
|
|
)
|
|
)
|
|
|
manufacturer_id = DynamicModelMultipleChoiceField(
|
|
manufacturer_id = DynamicModelMultipleChoiceField(
|
|
|
queryset=Manufacturer.objects.all(),
|
|
queryset=Manufacturer.objects.all(),
|
|
@@ -533,55 +550,58 @@ class ModuleTypeFilterForm(NetBoxModelFilterSetForm):
|
|
|
fetch_trigger='open'
|
|
fetch_trigger='open'
|
|
|
)
|
|
)
|
|
|
part_number = forms.CharField(
|
|
part_number = forms.CharField(
|
|
|
|
|
+ label=_('Part number'),
|
|
|
required=False
|
|
required=False
|
|
|
)
|
|
)
|
|
|
console_ports = forms.NullBooleanField(
|
|
console_ports = forms.NullBooleanField(
|
|
|
required=False,
|
|
required=False,
|
|
|
- label='Has console ports',
|
|
|
|
|
|
|
+ label=_('Has console ports'),
|
|
|
widget=forms.Select(
|
|
widget=forms.Select(
|
|
|
choices=BOOLEAN_WITH_BLANK_CHOICES
|
|
choices=BOOLEAN_WITH_BLANK_CHOICES
|
|
|
)
|
|
)
|
|
|
)
|
|
)
|
|
|
console_server_ports = forms.NullBooleanField(
|
|
console_server_ports = forms.NullBooleanField(
|
|
|
required=False,
|
|
required=False,
|
|
|
- label='Has console server ports',
|
|
|
|
|
|
|
+ label=_('Has console server ports'),
|
|
|
widget=forms.Select(
|
|
widget=forms.Select(
|
|
|
choices=BOOLEAN_WITH_BLANK_CHOICES
|
|
choices=BOOLEAN_WITH_BLANK_CHOICES
|
|
|
)
|
|
)
|
|
|
)
|
|
)
|
|
|
power_ports = forms.NullBooleanField(
|
|
power_ports = forms.NullBooleanField(
|
|
|
required=False,
|
|
required=False,
|
|
|
- label='Has power ports',
|
|
|
|
|
|
|
+ label=_('Has power ports'),
|
|
|
widget=forms.Select(
|
|
widget=forms.Select(
|
|
|
choices=BOOLEAN_WITH_BLANK_CHOICES
|
|
choices=BOOLEAN_WITH_BLANK_CHOICES
|
|
|
)
|
|
)
|
|
|
)
|
|
)
|
|
|
power_outlets = forms.NullBooleanField(
|
|
power_outlets = forms.NullBooleanField(
|
|
|
required=False,
|
|
required=False,
|
|
|
- label='Has power outlets',
|
|
|
|
|
|
|
+ label=_('Has power outlets'),
|
|
|
widget=forms.Select(
|
|
widget=forms.Select(
|
|
|
choices=BOOLEAN_WITH_BLANK_CHOICES
|
|
choices=BOOLEAN_WITH_BLANK_CHOICES
|
|
|
)
|
|
)
|
|
|
)
|
|
)
|
|
|
interfaces = forms.NullBooleanField(
|
|
interfaces = forms.NullBooleanField(
|
|
|
required=False,
|
|
required=False,
|
|
|
- label='Has interfaces',
|
|
|
|
|
|
|
+ label=_('Has interfaces'),
|
|
|
widget=forms.Select(
|
|
widget=forms.Select(
|
|
|
choices=BOOLEAN_WITH_BLANK_CHOICES
|
|
choices=BOOLEAN_WITH_BLANK_CHOICES
|
|
|
)
|
|
)
|
|
|
)
|
|
)
|
|
|
pass_through_ports = forms.NullBooleanField(
|
|
pass_through_ports = forms.NullBooleanField(
|
|
|
required=False,
|
|
required=False,
|
|
|
- label='Has pass-through ports',
|
|
|
|
|
|
|
+ label=_('Has pass-through ports'),
|
|
|
widget=forms.Select(
|
|
widget=forms.Select(
|
|
|
choices=BOOLEAN_WITH_BLANK_CHOICES
|
|
choices=BOOLEAN_WITH_BLANK_CHOICES
|
|
|
)
|
|
)
|
|
|
)
|
|
)
|
|
|
tag = TagFilterField(model)
|
|
tag = TagFilterField(model)
|
|
|
weight = forms.DecimalField(
|
|
weight = forms.DecimalField(
|
|
|
|
|
+ label=_('Weight'),
|
|
|
required=False
|
|
required=False
|
|
|
)
|
|
)
|
|
|
weight_unit = forms.ChoiceField(
|
|
weight_unit = forms.ChoiceField(
|
|
|
|
|
+ label=_('Weight unit'),
|
|
|
choices=add_blank_choice(WeightUnitChoices),
|
|
choices=add_blank_choice(WeightUnitChoices),
|
|
|
required=False
|
|
required=False
|
|
|
)
|
|
)
|
|
@@ -621,15 +641,17 @@ class DeviceFilterForm(
|
|
|
model = Device
|
|
model = Device
|
|
|
fieldsets = (
|
|
fieldsets = (
|
|
|
(None, ('q', 'filter_id', 'tag')),
|
|
(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', (
|
|
|
|
|
|
|
+ (_('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'), (
|
|
|
'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', ('has_primary_ip', 'has_oob_ip', 'virtual_chassis_member', 'config_template_id', 'local_context_data'))
|
|
|
|
|
|
|
+ (_('Miscellaneous'), (
|
|
|
|
|
+ 'has_primary_ip', 'has_oob_ip', 'virtual_chassis_member', 'config_template_id', 'local_context_data',
|
|
|
|
|
+ ))
|
|
|
)
|
|
)
|
|
|
region_id = DynamicModelMultipleChoiceField(
|
|
region_id = DynamicModelMultipleChoiceField(
|
|
|
queryset=Region.objects.all(),
|
|
queryset=Region.objects.all(),
|
|
@@ -694,22 +716,26 @@ class DeviceFilterForm(
|
|
|
label=_('Platform')
|
|
label=_('Platform')
|
|
|
)
|
|
)
|
|
|
status = forms.MultipleChoiceField(
|
|
status = forms.MultipleChoiceField(
|
|
|
|
|
+ label=_('Status'),
|
|
|
choices=DeviceStatusChoices,
|
|
choices=DeviceStatusChoices,
|
|
|
required=False
|
|
required=False
|
|
|
)
|
|
)
|
|
|
airflow = forms.MultipleChoiceField(
|
|
airflow = forms.MultipleChoiceField(
|
|
|
|
|
+ label=_('Airflow'),
|
|
|
choices=add_blank_choice(DeviceAirflowChoices),
|
|
choices=add_blank_choice(DeviceAirflowChoices),
|
|
|
required=False
|
|
required=False
|
|
|
)
|
|
)
|
|
|
serial = forms.CharField(
|
|
serial = forms.CharField(
|
|
|
|
|
+ label=_('Serial'),
|
|
|
required=False
|
|
required=False
|
|
|
)
|
|
)
|
|
|
asset_tag = forms.CharField(
|
|
asset_tag = forms.CharField(
|
|
|
|
|
+ label=_('Asset tag'),
|
|
|
required=False
|
|
required=False
|
|
|
)
|
|
)
|
|
|
mac_address = forms.CharField(
|
|
mac_address = forms.CharField(
|
|
|
required=False,
|
|
required=False,
|
|
|
- label='MAC address'
|
|
|
|
|
|
|
+ label=_('MAC address')
|
|
|
)
|
|
)
|
|
|
config_template_id = DynamicModelMultipleChoiceField(
|
|
config_template_id = DynamicModelMultipleChoiceField(
|
|
|
queryset=ConfigTemplate.objects.all(),
|
|
queryset=ConfigTemplate.objects.all(),
|
|
@@ -718,7 +744,7 @@ class DeviceFilterForm(
|
|
|
)
|
|
)
|
|
|
has_primary_ip = forms.NullBooleanField(
|
|
has_primary_ip = forms.NullBooleanField(
|
|
|
required=False,
|
|
required=False,
|
|
|
- label='Has a primary IP',
|
|
|
|
|
|
|
+ label=_('Has a primary IP'),
|
|
|
widget=forms.Select(
|
|
widget=forms.Select(
|
|
|
choices=BOOLEAN_WITH_BLANK_CHOICES
|
|
choices=BOOLEAN_WITH_BLANK_CHOICES
|
|
|
)
|
|
)
|
|
@@ -732,49 +758,49 @@ class DeviceFilterForm(
|
|
|
)
|
|
)
|
|
|
virtual_chassis_member = forms.NullBooleanField(
|
|
virtual_chassis_member = forms.NullBooleanField(
|
|
|
required=False,
|
|
required=False,
|
|
|
- label='Virtual chassis member',
|
|
|
|
|
|
|
+ label=_('Virtual chassis member'),
|
|
|
widget=forms.Select(
|
|
widget=forms.Select(
|
|
|
choices=BOOLEAN_WITH_BLANK_CHOICES
|
|
choices=BOOLEAN_WITH_BLANK_CHOICES
|
|
|
)
|
|
)
|
|
|
)
|
|
)
|
|
|
console_ports = forms.NullBooleanField(
|
|
console_ports = forms.NullBooleanField(
|
|
|
required=False,
|
|
required=False,
|
|
|
- label='Has console ports',
|
|
|
|
|
|
|
+ label=_('Has console ports'),
|
|
|
widget=forms.Select(
|
|
widget=forms.Select(
|
|
|
choices=BOOLEAN_WITH_BLANK_CHOICES
|
|
choices=BOOLEAN_WITH_BLANK_CHOICES
|
|
|
)
|
|
)
|
|
|
)
|
|
)
|
|
|
console_server_ports = forms.NullBooleanField(
|
|
console_server_ports = forms.NullBooleanField(
|
|
|
required=False,
|
|
required=False,
|
|
|
- label='Has console server ports',
|
|
|
|
|
|
|
+ label=_('Has console server ports'),
|
|
|
widget=forms.Select(
|
|
widget=forms.Select(
|
|
|
choices=BOOLEAN_WITH_BLANK_CHOICES
|
|
choices=BOOLEAN_WITH_BLANK_CHOICES
|
|
|
)
|
|
)
|
|
|
)
|
|
)
|
|
|
power_ports = forms.NullBooleanField(
|
|
power_ports = forms.NullBooleanField(
|
|
|
required=False,
|
|
required=False,
|
|
|
- label='Has power ports',
|
|
|
|
|
|
|
+ label=_('Has power ports'),
|
|
|
widget=forms.Select(
|
|
widget=forms.Select(
|
|
|
choices=BOOLEAN_WITH_BLANK_CHOICES
|
|
choices=BOOLEAN_WITH_BLANK_CHOICES
|
|
|
)
|
|
)
|
|
|
)
|
|
)
|
|
|
power_outlets = forms.NullBooleanField(
|
|
power_outlets = forms.NullBooleanField(
|
|
|
required=False,
|
|
required=False,
|
|
|
- label='Has power outlets',
|
|
|
|
|
|
|
+ label=_('Has power outlets'),
|
|
|
widget=forms.Select(
|
|
widget=forms.Select(
|
|
|
choices=BOOLEAN_WITH_BLANK_CHOICES
|
|
choices=BOOLEAN_WITH_BLANK_CHOICES
|
|
|
)
|
|
)
|
|
|
)
|
|
)
|
|
|
interfaces = forms.NullBooleanField(
|
|
interfaces = forms.NullBooleanField(
|
|
|
required=False,
|
|
required=False,
|
|
|
- label='Has interfaces',
|
|
|
|
|
|
|
+ label=_('Has interfaces'),
|
|
|
widget=forms.Select(
|
|
widget=forms.Select(
|
|
|
choices=BOOLEAN_WITH_BLANK_CHOICES
|
|
choices=BOOLEAN_WITH_BLANK_CHOICES
|
|
|
)
|
|
)
|
|
|
)
|
|
)
|
|
|
pass_through_ports = forms.NullBooleanField(
|
|
pass_through_ports = forms.NullBooleanField(
|
|
|
required=False,
|
|
required=False,
|
|
|
- label='Has pass-through ports',
|
|
|
|
|
|
|
+ label=_('Has pass-through ports'),
|
|
|
widget=forms.Select(
|
|
widget=forms.Select(
|
|
|
choices=BOOLEAN_WITH_BLANK_CHOICES
|
|
choices=BOOLEAN_WITH_BLANK_CHOICES
|
|
|
)
|
|
)
|
|
@@ -789,8 +815,8 @@ class VirtualDeviceContextFilterForm(
|
|
|
model = VirtualDeviceContext
|
|
model = VirtualDeviceContext
|
|
|
fieldsets = (
|
|
fieldsets = (
|
|
|
(None, ('q', 'filter_id', 'tag')),
|
|
(None, ('q', 'filter_id', 'tag')),
|
|
|
- ('Attributes', ('device', 'status', 'has_primary_ip')),
|
|
|
|
|
- ('Tenant', ('tenant_group_id', 'tenant_id')),
|
|
|
|
|
|
|
+ (_('Attributes'), ('device', 'status', 'has_primary_ip')),
|
|
|
|
|
+ (_('Tenant'), ('tenant_group_id', 'tenant_id')),
|
|
|
)
|
|
)
|
|
|
device = DynamicModelMultipleChoiceField(
|
|
device = DynamicModelMultipleChoiceField(
|
|
|
queryset=Device.objects.all(),
|
|
queryset=Device.objects.all(),
|
|
@@ -799,12 +825,13 @@ class VirtualDeviceContextFilterForm(
|
|
|
fetch_trigger='open'
|
|
fetch_trigger='open'
|
|
|
)
|
|
)
|
|
|
status = forms.MultipleChoiceField(
|
|
status = forms.MultipleChoiceField(
|
|
|
|
|
+ label=_('Status'),
|
|
|
required=False,
|
|
required=False,
|
|
|
choices=add_blank_choice(VirtualDeviceContextStatusChoices)
|
|
choices=add_blank_choice(VirtualDeviceContextStatusChoices)
|
|
|
)
|
|
)
|
|
|
has_primary_ip = forms.NullBooleanField(
|
|
has_primary_ip = forms.NullBooleanField(
|
|
|
required=False,
|
|
required=False,
|
|
|
- label='Has a primary IP',
|
|
|
|
|
|
|
+ label=_('Has a primary IP'),
|
|
|
widget=forms.Select(
|
|
widget=forms.Select(
|
|
|
choices=BOOLEAN_WITH_BLANK_CHOICES
|
|
choices=BOOLEAN_WITH_BLANK_CHOICES
|
|
|
)
|
|
)
|
|
@@ -816,7 +843,7 @@ class ModuleFilterForm(LocalConfigContextFilterForm, TenancyFilterForm, NetBoxMo
|
|
|
model = Module
|
|
model = Module
|
|
|
fieldsets = (
|
|
fieldsets = (
|
|
|
(None, ('q', 'filter_id', 'tag')),
|
|
(None, ('q', 'filter_id', 'tag')),
|
|
|
- ('Hardware', ('manufacturer_id', 'module_type_id', 'status', 'serial', 'asset_tag')),
|
|
|
|
|
|
|
+ (_('Hardware'), ('manufacturer_id', 'module_type_id', 'status', 'serial', 'asset_tag')),
|
|
|
)
|
|
)
|
|
|
manufacturer_id = DynamicModelMultipleChoiceField(
|
|
manufacturer_id = DynamicModelMultipleChoiceField(
|
|
|
queryset=Manufacturer.objects.all(),
|
|
queryset=Manufacturer.objects.all(),
|
|
@@ -834,13 +861,16 @@ class ModuleFilterForm(LocalConfigContextFilterForm, TenancyFilterForm, NetBoxMo
|
|
|
fetch_trigger='open'
|
|
fetch_trigger='open'
|
|
|
)
|
|
)
|
|
|
status = forms.MultipleChoiceField(
|
|
status = forms.MultipleChoiceField(
|
|
|
|
|
+ label=_('Status'),
|
|
|
choices=ModuleStatusChoices,
|
|
choices=ModuleStatusChoices,
|
|
|
required=False
|
|
required=False
|
|
|
)
|
|
)
|
|
|
serial = forms.CharField(
|
|
serial = forms.CharField(
|
|
|
|
|
+ label=_('Serial'),
|
|
|
required=False
|
|
required=False
|
|
|
)
|
|
)
|
|
|
asset_tag = forms.CharField(
|
|
asset_tag = forms.CharField(
|
|
|
|
|
+ label=_('Asset tag'),
|
|
|
required=False
|
|
required=False
|
|
|
)
|
|
)
|
|
|
tag = TagFilterField(model)
|
|
tag = TagFilterField(model)
|
|
@@ -850,8 +880,8 @@ class VirtualChassisFilterForm(TenancyFilterForm, NetBoxModelFilterSetForm):
|
|
|
model = VirtualChassis
|
|
model = VirtualChassis
|
|
|
fieldsets = (
|
|
fieldsets = (
|
|
|
(None, ('q', 'filter_id', 'tag')),
|
|
(None, ('q', 'filter_id', 'tag')),
|
|
|
- ('Location', ('region_id', 'site_group_id', 'site_id')),
|
|
|
|
|
- ('Tenant', ('tenant_group_id', 'tenant_id')),
|
|
|
|
|
|
|
+ (_('Location'), ('region_id', 'site_group_id', 'site_id')),
|
|
|
|
|
+ (_('Tenant'), ('tenant_group_id', 'tenant_id')),
|
|
|
)
|
|
)
|
|
|
region_id = DynamicModelMultipleChoiceField(
|
|
region_id = DynamicModelMultipleChoiceField(
|
|
|
queryset=Region.objects.all(),
|
|
queryset=Region.objects.all(),
|
|
@@ -879,9 +909,9 @@ class CableFilterForm(TenancyFilterForm, NetBoxModelFilterSetForm):
|
|
|
model = Cable
|
|
model = Cable
|
|
|
fieldsets = (
|
|
fieldsets = (
|
|
|
(None, ('q', 'filter_id', 'tag')),
|
|
(None, ('q', 'filter_id', 'tag')),
|
|
|
- ('Location', ('site_id', 'location_id', 'rack_id', 'device_id')),
|
|
|
|
|
- ('Attributes', ('type', 'status', 'color', 'length', 'length_unit')),
|
|
|
|
|
- ('Tenant', ('tenant_group_id', 'tenant_id')),
|
|
|
|
|
|
|
+ (_('Location'), ('site_id', 'location_id', 'rack_id', 'device_id')),
|
|
|
|
|
+ (_('Attributes'), ('type', 'status', 'color', 'length', 'length_unit')),
|
|
|
|
|
+ (_('Tenant'), ('tenant_group_id', 'tenant_id')),
|
|
|
)
|
|
)
|
|
|
region_id = DynamicModelMultipleChoiceField(
|
|
region_id = DynamicModelMultipleChoiceField(
|
|
|
queryset=Region.objects.all(),
|
|
queryset=Region.objects.all(),
|
|
@@ -927,20 +957,25 @@ class CableFilterForm(TenancyFilterForm, NetBoxModelFilterSetForm):
|
|
|
label=_('Device')
|
|
label=_('Device')
|
|
|
)
|
|
)
|
|
|
type = forms.MultipleChoiceField(
|
|
type = forms.MultipleChoiceField(
|
|
|
|
|
+ label=_('Type'),
|
|
|
choices=add_blank_choice(CableTypeChoices),
|
|
choices=add_blank_choice(CableTypeChoices),
|
|
|
required=False
|
|
required=False
|
|
|
)
|
|
)
|
|
|
status = forms.MultipleChoiceField(
|
|
status = forms.MultipleChoiceField(
|
|
|
|
|
+ label=_('Status'),
|
|
|
required=False,
|
|
required=False,
|
|
|
choices=add_blank_choice(LinkStatusChoices)
|
|
choices=add_blank_choice(LinkStatusChoices)
|
|
|
)
|
|
)
|
|
|
color = ColorField(
|
|
color = ColorField(
|
|
|
|
|
+ label=_('Color'),
|
|
|
required=False
|
|
required=False
|
|
|
)
|
|
)
|
|
|
length = forms.IntegerField(
|
|
length = forms.IntegerField(
|
|
|
|
|
+ label=_('Length'),
|
|
|
required=False
|
|
required=False
|
|
|
)
|
|
)
|
|
|
length_unit = forms.ChoiceField(
|
|
length_unit = forms.ChoiceField(
|
|
|
|
|
+ label=_('Length unit'),
|
|
|
choices=add_blank_choice(CableLengthUnitChoices),
|
|
choices=add_blank_choice(CableLengthUnitChoices),
|
|
|
required=False
|
|
required=False
|
|
|
)
|
|
)
|
|
@@ -951,8 +986,8 @@ class PowerPanelFilterForm(ContactModelFilterForm, NetBoxModelFilterSetForm):
|
|
|
model = PowerPanel
|
|
model = PowerPanel
|
|
|
fieldsets = (
|
|
fieldsets = (
|
|
|
(None, ('q', 'filter_id', 'tag')),
|
|
(None, ('q', 'filter_id', 'tag')),
|
|
|
- ('Location', ('region_id', 'site_group_id', 'site_id', 'location_id')),
|
|
|
|
|
- ('Contacts', ('contact', 'contact_role', 'contact_group')),
|
|
|
|
|
|
|
+ (_('Location'), ('region_id', 'site_group_id', 'site_id', 'location_id')),
|
|
|
|
|
+ (_('Contacts'), ('contact', 'contact_role', 'contact_group')),
|
|
|
)
|
|
)
|
|
|
region_id = DynamicModelMultipleChoiceField(
|
|
region_id = DynamicModelMultipleChoiceField(
|
|
|
queryset=Region.objects.all(),
|
|
queryset=Region.objects.all(),
|
|
@@ -989,9 +1024,9 @@ class PowerFeedFilterForm(TenancyFilterForm, NetBoxModelFilterSetForm):
|
|
|
model = PowerFeed
|
|
model = PowerFeed
|
|
|
fieldsets = (
|
|
fieldsets = (
|
|
|
(None, ('q', 'filter_id', 'tag')),
|
|
(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')),
|
|
|
|
|
|
|
+ (_('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')),
|
|
|
)
|
|
)
|
|
|
region_id = DynamicModelMultipleChoiceField(
|
|
region_id = DynamicModelMultipleChoiceField(
|
|
|
queryset=Region.objects.all(),
|
|
queryset=Region.objects.all(),
|
|
@@ -1030,28 +1065,35 @@ class PowerFeedFilterForm(TenancyFilterForm, NetBoxModelFilterSetForm):
|
|
|
label=_('Rack')
|
|
label=_('Rack')
|
|
|
)
|
|
)
|
|
|
status = forms.MultipleChoiceField(
|
|
status = forms.MultipleChoiceField(
|
|
|
|
|
+ label=_('Status'),
|
|
|
choices=PowerFeedStatusChoices,
|
|
choices=PowerFeedStatusChoices,
|
|
|
required=False
|
|
required=False
|
|
|
)
|
|
)
|
|
|
type = forms.ChoiceField(
|
|
type = forms.ChoiceField(
|
|
|
|
|
+ label=_('Type'),
|
|
|
choices=add_blank_choice(PowerFeedTypeChoices),
|
|
choices=add_blank_choice(PowerFeedTypeChoices),
|
|
|
required=False
|
|
required=False
|
|
|
)
|
|
)
|
|
|
supply = forms.ChoiceField(
|
|
supply = forms.ChoiceField(
|
|
|
|
|
+ label=_('Supply'),
|
|
|
choices=add_blank_choice(PowerFeedSupplyChoices),
|
|
choices=add_blank_choice(PowerFeedSupplyChoices),
|
|
|
required=False
|
|
required=False
|
|
|
)
|
|
)
|
|
|
phase = forms.ChoiceField(
|
|
phase = forms.ChoiceField(
|
|
|
|
|
+ label=_('Phase'),
|
|
|
choices=add_blank_choice(PowerFeedPhaseChoices),
|
|
choices=add_blank_choice(PowerFeedPhaseChoices),
|
|
|
required=False
|
|
required=False
|
|
|
)
|
|
)
|
|
|
voltage = forms.IntegerField(
|
|
voltage = forms.IntegerField(
|
|
|
|
|
+ label=_('Voltage'),
|
|
|
required=False
|
|
required=False
|
|
|
)
|
|
)
|
|
|
amperage = forms.IntegerField(
|
|
amperage = forms.IntegerField(
|
|
|
|
|
+ label=_('Amperage'),
|
|
|
required=False
|
|
required=False
|
|
|
)
|
|
)
|
|
|
max_utilization = forms.IntegerField(
|
|
max_utilization = forms.IntegerField(
|
|
|
|
|
+ label=_('Max utilization'),
|
|
|
required=False
|
|
required=False
|
|
|
)
|
|
)
|
|
|
tag = TagFilterField(model)
|
|
tag = TagFilterField(model)
|
|
@@ -1063,12 +1105,14 @@ class PowerFeedFilterForm(TenancyFilterForm, NetBoxModelFilterSetForm):
|
|
|
|
|
|
|
|
class CabledFilterForm(forms.Form):
|
|
class CabledFilterForm(forms.Form):
|
|
|
cabled = forms.NullBooleanField(
|
|
cabled = forms.NullBooleanField(
|
|
|
|
|
+ label=_('Cabled'),
|
|
|
required=False,
|
|
required=False,
|
|
|
widget=forms.Select(
|
|
widget=forms.Select(
|
|
|
choices=BOOLEAN_WITH_BLANK_CHOICES
|
|
choices=BOOLEAN_WITH_BLANK_CHOICES
|
|
|
)
|
|
)
|
|
|
)
|
|
)
|
|
|
occupied = forms.NullBooleanField(
|
|
occupied = forms.NullBooleanField(
|
|
|
|
|
+ label=_('Occupied'),
|
|
|
required=False,
|
|
required=False,
|
|
|
widget=forms.Select(
|
|
widget=forms.Select(
|
|
|
choices=BOOLEAN_WITH_BLANK_CHOICES
|
|
choices=BOOLEAN_WITH_BLANK_CHOICES
|
|
@@ -1078,6 +1122,7 @@ class CabledFilterForm(forms.Form):
|
|
|
|
|
|
|
|
class PathEndpointFilterForm(CabledFilterForm):
|
|
class PathEndpointFilterForm(CabledFilterForm):
|
|
|
connected = forms.NullBooleanField(
|
|
connected = forms.NullBooleanField(
|
|
|
|
|
+ label=_('Connected'),
|
|
|
required=False,
|
|
required=False,
|
|
|
widget=forms.Select(
|
|
widget=forms.Select(
|
|
|
choices=BOOLEAN_WITH_BLANK_CHOICES
|
|
choices=BOOLEAN_WITH_BLANK_CHOICES
|
|
@@ -1089,16 +1134,18 @@ class ConsolePortFilterForm(PathEndpointFilterForm, DeviceComponentFilterForm):
|
|
|
model = ConsolePort
|
|
model = ConsolePort
|
|
|
fieldsets = (
|
|
fieldsets = (
|
|
|
(None, ('q', 'filter_id', 'tag')),
|
|
(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')),
|
|
|
|
|
|
|
+ (_('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')),
|
|
|
)
|
|
)
|
|
|
type = forms.MultipleChoiceField(
|
|
type = forms.MultipleChoiceField(
|
|
|
|
|
+ label=_('Type'),
|
|
|
choices=ConsolePortTypeChoices,
|
|
choices=ConsolePortTypeChoices,
|
|
|
required=False
|
|
required=False
|
|
|
)
|
|
)
|
|
|
speed = forms.MultipleChoiceField(
|
|
speed = forms.MultipleChoiceField(
|
|
|
|
|
+ label=_('Speed'),
|
|
|
choices=ConsolePortSpeedChoices,
|
|
choices=ConsolePortSpeedChoices,
|
|
|
required=False
|
|
required=False
|
|
|
)
|
|
)
|
|
@@ -1109,16 +1156,18 @@ class ConsoleServerPortFilterForm(PathEndpointFilterForm, DeviceComponentFilterF
|
|
|
model = ConsoleServerPort
|
|
model = ConsoleServerPort
|
|
|
fieldsets = (
|
|
fieldsets = (
|
|
|
(None, ('q', 'filter_id', 'tag')),
|
|
(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')),
|
|
|
|
|
|
|
+ (_('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')),
|
|
|
)
|
|
)
|
|
|
type = forms.MultipleChoiceField(
|
|
type = forms.MultipleChoiceField(
|
|
|
|
|
+ label=_('Type'),
|
|
|
choices=ConsolePortTypeChoices,
|
|
choices=ConsolePortTypeChoices,
|
|
|
required=False
|
|
required=False
|
|
|
)
|
|
)
|
|
|
speed = forms.MultipleChoiceField(
|
|
speed = forms.MultipleChoiceField(
|
|
|
|
|
+ label=_('Speed'),
|
|
|
choices=ConsolePortSpeedChoices,
|
|
choices=ConsolePortSpeedChoices,
|
|
|
required=False
|
|
required=False
|
|
|
)
|
|
)
|
|
@@ -1129,12 +1178,13 @@ class PowerPortFilterForm(PathEndpointFilterForm, DeviceComponentFilterForm):
|
|
|
model = PowerPort
|
|
model = PowerPort
|
|
|
fieldsets = (
|
|
fieldsets = (
|
|
|
(None, ('q', 'filter_id', 'tag')),
|
|
(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')),
|
|
|
|
|
|
|
+ (_('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')),
|
|
|
)
|
|
)
|
|
|
type = forms.MultipleChoiceField(
|
|
type = forms.MultipleChoiceField(
|
|
|
|
|
+ label=_('Type'),
|
|
|
choices=PowerPortTypeChoices,
|
|
choices=PowerPortTypeChoices,
|
|
|
required=False
|
|
required=False
|
|
|
)
|
|
)
|
|
@@ -1145,12 +1195,13 @@ class PowerOutletFilterForm(PathEndpointFilterForm, DeviceComponentFilterForm):
|
|
|
model = PowerOutlet
|
|
model = PowerOutlet
|
|
|
fieldsets = (
|
|
fieldsets = (
|
|
|
(None, ('q', 'filter_id', 'tag')),
|
|
(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')),
|
|
|
|
|
|
|
+ (_('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')),
|
|
|
)
|
|
)
|
|
|
type = forms.MultipleChoiceField(
|
|
type = forms.MultipleChoiceField(
|
|
|
|
|
+ label=_('Type'),
|
|
|
choices=PowerOutletTypeChoices,
|
|
choices=PowerOutletTypeChoices,
|
|
|
required=False
|
|
required=False
|
|
|
)
|
|
)
|
|
@@ -1161,13 +1212,13 @@ class InterfaceFilterForm(PathEndpointFilterForm, DeviceComponentFilterForm):
|
|
|
model = Interface
|
|
model = Interface
|
|
|
fieldsets = (
|
|
fieldsets = (
|
|
|
(None, ('q', 'filter_id', 'tag')),
|
|
(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')),
|
|
|
|
|
|
|
+ (_('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')),
|
|
|
)
|
|
)
|
|
|
vdc_id = DynamicModelMultipleChoiceField(
|
|
vdc_id = DynamicModelMultipleChoiceField(
|
|
|
queryset=VirtualDeviceContext.objects.all(),
|
|
queryset=VirtualDeviceContext.objects.all(),
|
|
@@ -1178,30 +1229,36 @@ class InterfaceFilterForm(PathEndpointFilterForm, DeviceComponentFilterForm):
|
|
|
label=_('Virtual Device Context')
|
|
label=_('Virtual Device Context')
|
|
|
)
|
|
)
|
|
|
kind = forms.MultipleChoiceField(
|
|
kind = forms.MultipleChoiceField(
|
|
|
|
|
+ label=_('Kind'),
|
|
|
choices=InterfaceKindChoices,
|
|
choices=InterfaceKindChoices,
|
|
|
required=False
|
|
required=False
|
|
|
)
|
|
)
|
|
|
type = forms.MultipleChoiceField(
|
|
type = forms.MultipleChoiceField(
|
|
|
|
|
+ label=_('Type'),
|
|
|
choices=InterfaceTypeChoices,
|
|
choices=InterfaceTypeChoices,
|
|
|
required=False
|
|
required=False
|
|
|
)
|
|
)
|
|
|
speed = forms.IntegerField(
|
|
speed = forms.IntegerField(
|
|
|
|
|
+ label=_('Speed'),
|
|
|
required=False,
|
|
required=False,
|
|
|
widget=NumberWithOptions(
|
|
widget=NumberWithOptions(
|
|
|
options=InterfaceSpeedChoices
|
|
options=InterfaceSpeedChoices
|
|
|
)
|
|
)
|
|
|
)
|
|
)
|
|
|
duplex = forms.MultipleChoiceField(
|
|
duplex = forms.MultipleChoiceField(
|
|
|
|
|
+ label=_('Duplex'),
|
|
|
choices=InterfaceDuplexChoices,
|
|
choices=InterfaceDuplexChoices,
|
|
|
required=False
|
|
required=False
|
|
|
)
|
|
)
|
|
|
enabled = forms.NullBooleanField(
|
|
enabled = forms.NullBooleanField(
|
|
|
|
|
+ label=_('Enabled'),
|
|
|
required=False,
|
|
required=False,
|
|
|
widget=forms.Select(
|
|
widget=forms.Select(
|
|
|
choices=BOOLEAN_WITH_BLANK_CHOICES
|
|
choices=BOOLEAN_WITH_BLANK_CHOICES
|
|
|
)
|
|
)
|
|
|
)
|
|
)
|
|
|
mgmt_only = forms.NullBooleanField(
|
|
mgmt_only = forms.NullBooleanField(
|
|
|
|
|
+ label=_('Mgmt only'),
|
|
|
required=False,
|
|
required=False,
|
|
|
widget=forms.Select(
|
|
widget=forms.Select(
|
|
|
choices=BOOLEAN_WITH_BLANK_CHOICES
|
|
choices=BOOLEAN_WITH_BLANK_CHOICES
|
|
@@ -1209,50 +1266,50 @@ class InterfaceFilterForm(PathEndpointFilterForm, DeviceComponentFilterForm):
|
|
|
)
|
|
)
|
|
|
mac_address = forms.CharField(
|
|
mac_address = forms.CharField(
|
|
|
required=False,
|
|
required=False,
|
|
|
- label='MAC address'
|
|
|
|
|
|
|
+ label=_('MAC address')
|
|
|
)
|
|
)
|
|
|
wwn = forms.CharField(
|
|
wwn = forms.CharField(
|
|
|
required=False,
|
|
required=False,
|
|
|
- label='WWN'
|
|
|
|
|
|
|
+ label=_('WWN')
|
|
|
)
|
|
)
|
|
|
poe_mode = forms.MultipleChoiceField(
|
|
poe_mode = forms.MultipleChoiceField(
|
|
|
choices=InterfacePoEModeChoices,
|
|
choices=InterfacePoEModeChoices,
|
|
|
required=False,
|
|
required=False,
|
|
|
- label='PoE mode'
|
|
|
|
|
|
|
+ label=_('PoE mode')
|
|
|
)
|
|
)
|
|
|
poe_type = forms.MultipleChoiceField(
|
|
poe_type = forms.MultipleChoiceField(
|
|
|
choices=InterfacePoETypeChoices,
|
|
choices=InterfacePoETypeChoices,
|
|
|
required=False,
|
|
required=False,
|
|
|
- label='PoE type'
|
|
|
|
|
|
|
+ label=_('PoE type')
|
|
|
)
|
|
)
|
|
|
rf_role = forms.MultipleChoiceField(
|
|
rf_role = forms.MultipleChoiceField(
|
|
|
choices=WirelessRoleChoices,
|
|
choices=WirelessRoleChoices,
|
|
|
required=False,
|
|
required=False,
|
|
|
- label='Wireless role'
|
|
|
|
|
|
|
+ label=_('Wireless role')
|
|
|
)
|
|
)
|
|
|
rf_channel = forms.MultipleChoiceField(
|
|
rf_channel = forms.MultipleChoiceField(
|
|
|
choices=WirelessChannelChoices,
|
|
choices=WirelessChannelChoices,
|
|
|
required=False,
|
|
required=False,
|
|
|
- label='Wireless channel'
|
|
|
|
|
|
|
+ label=_('Wireless channel')
|
|
|
)
|
|
)
|
|
|
rf_channel_frequency = forms.IntegerField(
|
|
rf_channel_frequency = forms.IntegerField(
|
|
|
required=False,
|
|
required=False,
|
|
|
- label='Channel frequency (MHz)'
|
|
|
|
|
|
|
+ label=_('Channel frequency (MHz)')
|
|
|
)
|
|
)
|
|
|
rf_channel_width = forms.IntegerField(
|
|
rf_channel_width = forms.IntegerField(
|
|
|
required=False,
|
|
required=False,
|
|
|
- label='Channel width (MHz)'
|
|
|
|
|
|
|
+ label=_('Channel width (MHz)')
|
|
|
)
|
|
)
|
|
|
tx_power = forms.IntegerField(
|
|
tx_power = forms.IntegerField(
|
|
|
required=False,
|
|
required=False,
|
|
|
- label='Transmit power (dBm)',
|
|
|
|
|
|
|
+ label=_('Transmit power (dBm)'),
|
|
|
min_value=0,
|
|
min_value=0,
|
|
|
max_value=127
|
|
max_value=127
|
|
|
)
|
|
)
|
|
|
vrf_id = DynamicModelMultipleChoiceField(
|
|
vrf_id = DynamicModelMultipleChoiceField(
|
|
|
queryset=VRF.objects.all(),
|
|
queryset=VRF.objects.all(),
|
|
|
required=False,
|
|
required=False,
|
|
|
- label='VRF'
|
|
|
|
|
|
|
+ label=_('VRF')
|
|
|
)
|
|
)
|
|
|
l2vpn_id = DynamicModelMultipleChoiceField(
|
|
l2vpn_id = DynamicModelMultipleChoiceField(
|
|
|
queryset=L2VPN.objects.all(),
|
|
queryset=L2VPN.objects.all(),
|
|
@@ -1265,17 +1322,19 @@ class InterfaceFilterForm(PathEndpointFilterForm, DeviceComponentFilterForm):
|
|
|
class FrontPortFilterForm(CabledFilterForm, DeviceComponentFilterForm):
|
|
class FrontPortFilterForm(CabledFilterForm, DeviceComponentFilterForm):
|
|
|
fieldsets = (
|
|
fieldsets = (
|
|
|
(None, ('q', 'filter_id', 'tag')),
|
|
(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')),
|
|
|
|
|
|
|
+ (_('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')),
|
|
|
)
|
|
)
|
|
|
model = FrontPort
|
|
model = FrontPort
|
|
|
type = forms.MultipleChoiceField(
|
|
type = forms.MultipleChoiceField(
|
|
|
|
|
+ label=_('Type'),
|
|
|
choices=PortTypeChoices,
|
|
choices=PortTypeChoices,
|
|
|
required=False
|
|
required=False
|
|
|
)
|
|
)
|
|
|
color = ColorField(
|
|
color = ColorField(
|
|
|
|
|
+ label=_('Color'),
|
|
|
required=False
|
|
required=False
|
|
|
)
|
|
)
|
|
|
tag = TagFilterField(model)
|
|
tag = TagFilterField(model)
|
|
@@ -1285,16 +1344,18 @@ class RearPortFilterForm(CabledFilterForm, DeviceComponentFilterForm):
|
|
|
model = RearPort
|
|
model = RearPort
|
|
|
fieldsets = (
|
|
fieldsets = (
|
|
|
(None, ('q', 'filter_id', 'tag')),
|
|
(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')),
|
|
|
|
|
|
|
+ (_('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')),
|
|
|
)
|
|
)
|
|
|
type = forms.MultipleChoiceField(
|
|
type = forms.MultipleChoiceField(
|
|
|
|
|
+ label=_('Type'),
|
|
|
choices=PortTypeChoices,
|
|
choices=PortTypeChoices,
|
|
|
required=False
|
|
required=False
|
|
|
)
|
|
)
|
|
|
color = ColorField(
|
|
color = ColorField(
|
|
|
|
|
+ label=_('Color'),
|
|
|
required=False
|
|
required=False
|
|
|
)
|
|
)
|
|
|
tag = TagFilterField(model)
|
|
tag = TagFilterField(model)
|
|
@@ -1304,12 +1365,13 @@ class ModuleBayFilterForm(DeviceComponentFilterForm):
|
|
|
model = ModuleBay
|
|
model = ModuleBay
|
|
|
fieldsets = (
|
|
fieldsets = (
|
|
|
(None, ('q', 'filter_id', 'tag')),
|
|
(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')),
|
|
|
|
|
|
|
+ (_('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')),
|
|
|
)
|
|
)
|
|
|
tag = TagFilterField(model)
|
|
tag = TagFilterField(model)
|
|
|
position = forms.CharField(
|
|
position = forms.CharField(
|
|
|
|
|
+ label=_('Position'),
|
|
|
required=False
|
|
required=False
|
|
|
)
|
|
)
|
|
|
|
|
|
|
@@ -1318,9 +1380,9 @@ class DeviceBayFilterForm(DeviceComponentFilterForm):
|
|
|
model = DeviceBay
|
|
model = DeviceBay
|
|
|
fieldsets = (
|
|
fieldsets = (
|
|
|
(None, ('q', 'filter_id', 'tag')),
|
|
(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')),
|
|
|
|
|
|
|
+ (_('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')),
|
|
|
)
|
|
)
|
|
|
tag = TagFilterField(model)
|
|
tag = TagFilterField(model)
|
|
|
|
|
|
|
@@ -1329,9 +1391,9 @@ class InventoryItemFilterForm(DeviceComponentFilterForm):
|
|
|
model = InventoryItem
|
|
model = InventoryItem
|
|
|
fieldsets = (
|
|
fieldsets = (
|
|
|
(None, ('q', 'filter_id', 'tag')),
|
|
(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')),
|
|
|
|
|
|
|
+ (_('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')),
|
|
|
)
|
|
)
|
|
|
role_id = DynamicModelMultipleChoiceField(
|
|
role_id = DynamicModelMultipleChoiceField(
|
|
|
queryset=InventoryItemRole.objects.all(),
|
|
queryset=InventoryItemRole.objects.all(),
|
|
@@ -1345,12 +1407,15 @@ class InventoryItemFilterForm(DeviceComponentFilterForm):
|
|
|
label=_('Manufacturer')
|
|
label=_('Manufacturer')
|
|
|
)
|
|
)
|
|
|
serial = forms.CharField(
|
|
serial = forms.CharField(
|
|
|
|
|
+ label=_('Serial'),
|
|
|
required=False
|
|
required=False
|
|
|
)
|
|
)
|
|
|
asset_tag = forms.CharField(
|
|
asset_tag = forms.CharField(
|
|
|
|
|
+ label=_('Asset tag'),
|
|
|
required=False
|
|
required=False
|
|
|
)
|
|
)
|
|
|
discovered = forms.NullBooleanField(
|
|
discovered = forms.NullBooleanField(
|
|
|
|
|
+ label=_('Discovered'),
|
|
|
required=False,
|
|
required=False,
|
|
|
widget=forms.Select(
|
|
widget=forms.Select(
|
|
|
choices=BOOLEAN_WITH_BLANK_CHOICES
|
|
choices=BOOLEAN_WITH_BLANK_CHOICES
|