mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
Remove choices from rf_channel_width
This commit is contained in:
@ -637,7 +637,6 @@ class InterfaceSerializer(PrimaryModelSerializer, LinkTerminationSerializer, Con
|
||||
mode = ChoiceField(choices=InterfaceModeChoices, allow_blank=True, required=False)
|
||||
rf_role = ChoiceField(choices=WirelessRoleChoices, required=False, allow_null=True)
|
||||
rf_channel = ChoiceField(choices=WirelessChannelChoices, required=False)
|
||||
rf_channel_width = ChoiceField(choices=WirelessChannelWidthChoices, required=False, allow_null=True)
|
||||
untagged_vlan = NestedVLANSerializer(required=False, allow_null=True)
|
||||
tagged_vlans = SerializedPKRelatedField(
|
||||
queryset=VLAN.objects.all(),
|
||||
|
@ -1014,11 +1014,9 @@ class InterfaceFilterForm(DeviceComponentFilterForm):
|
||||
widget=StaticSelectMultiple(),
|
||||
label='Wireless channel'
|
||||
)
|
||||
rf_channel_width = forms.MultipleChoiceField(
|
||||
choices=WirelessChannelWidthChoices,
|
||||
rf_channel_width = forms.IntegerField(
|
||||
required=False,
|
||||
widget=StaticSelectMultiple(),
|
||||
label='Channel width'
|
||||
label='Channel width (kHz)'
|
||||
)
|
||||
tag = TagFilterField(model)
|
||||
|
||||
|
@ -1117,7 +1117,6 @@ class InterfaceForm(BootstrapMixin, InterfaceCommonForm, CustomFieldModelForm):
|
||||
'mode': StaticSelect(),
|
||||
'rf_role': StaticSelect(),
|
||||
'rf_channel': StaticSelect(),
|
||||
'rf_channel_width': StaticSelect(),
|
||||
}
|
||||
labels = {
|
||||
'mode': '802.1Q Mode',
|
||||
|
@ -480,10 +480,8 @@ class InterfaceCreateForm(ComponentCreateForm, InterfaceCommonForm):
|
||||
widget=StaticSelect(),
|
||||
label='Wireless channel'
|
||||
)
|
||||
rf_channel_width = forms.ChoiceField(
|
||||
choices=add_blank_choice(WirelessChannelWidthChoices),
|
||||
rf_channel_width = forms.IntegerField(
|
||||
required=False,
|
||||
widget=StaticSelect(),
|
||||
label='Channel width'
|
||||
)
|
||||
untagged_vlan = DynamicModelChoiceField(
|
||||
|
@ -538,10 +538,9 @@ class Interface(ComponentModel, BaseInterface, LinkTermination, PathEndpoint):
|
||||
verbose_name='Wireless channel'
|
||||
)
|
||||
rf_channel_width = models.PositiveSmallIntegerField(
|
||||
choices=WirelessChannelWidthChoices,
|
||||
blank=True,
|
||||
null=True,
|
||||
verbose_name='Channel width'
|
||||
verbose_name='Channel width (kHz)'
|
||||
)
|
||||
wireless_link = models.ForeignKey(
|
||||
to='wireless.WirelessLink',
|
||||
|
@ -278,7 +278,7 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">Channel Width</th>
|
||||
<td>{{ object.get_rf_channel_width_display|placeholder }}</td>
|
||||
<td>{{ object.rf_channel_width|placeholder }}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
@ -165,18 +165,3 @@ class WirelessChannelChoices(ChoiceSet):
|
||||
)
|
||||
),
|
||||
)
|
||||
|
||||
|
||||
class WirelessChannelWidthChoices(ChoiceSet):
|
||||
|
||||
CHANNEL_WIDTH_20 = 20
|
||||
CHANNEL_WIDTH_40 = 40
|
||||
CHANNEL_WIDTH_80 = 80
|
||||
CHANNEL_WIDTH_160 = 160
|
||||
|
||||
CHOICES = (
|
||||
(CHANNEL_WIDTH_20, '20 MHz'),
|
||||
(CHANNEL_WIDTH_40, '40 MHz'),
|
||||
(CHANNEL_WIDTH_80, '80 MHz'),
|
||||
(CHANNEL_WIDTH_160, '160 MHz'),
|
||||
)
|
||||
|
Reference in New Issue
Block a user