diff --git a/netbox_topology_views/forms.py b/netbox_topology_views/forms.py index 32edd46..315500b 100644 --- a/netbox_topology_views/forms.py +++ b/netbox_topology_views/forms.py @@ -35,12 +35,12 @@ class DeviceFilterForm( fieldsets = ( FieldSet('q', 'filter_id', 'tag'), FieldSet( - 'group', 'ignore_cable_type', 'save_coords', 'show_unconnected', 'show_cables', 'show_logical_connections', - 'show_single_cable_logical_conns', 'show_neighbors', + 'group', 'ignore_cable_type', 'save_coords', 'show_unconnected', 'show_cables', 'show_wireless', + 'show_logical_connections', 'show_single_cable_logical_conns', 'show_neighbors', 'group_sites', 'group_locations', 'group_racks', 'group_virtualchassis', 'straight_cables', 'grid_size', 'node_label_items', name=_("Options") ), FieldSet( - 'show_circuit', 'show_power', 'show_wireless', name=_("Additional filter-independent types (non-devices)") + 'show_circuit', 'show_power', name=_("Additional filter-independent types (non-devices)") ), FieldSet('id', name=_("Device")), FieldSet('region_id', 'site_group_id', 'site_id', 'location_id', 'rack_id', name=_("Location")), @@ -264,7 +264,12 @@ class DeviceFilterForm( choices=BOOLEAN_WITH_BLANK_CHOICES ) ) - + show_wireless = forms.NullBooleanField( + label =_('Show Wireless Links'), required=False, initial=False, + widget=forms.Select( + choices=BOOLEAN_WITH_BLANK_CHOICES + ) + ) show_logical_connections = forms.NullBooleanField( label =_('Show Logical Connections'), required=False, initial=False, widget=forms.Select( @@ -342,13 +347,6 @@ class DeviceFilterForm( choices=BOOLEAN_WITH_BLANK_CHOICES ) ) - show_wireless = forms.NullBooleanField( - label =_('Show Wireless Links'), required=False, initial=False, - help_text=_('All Wireless Links will be displayed. Wireless Links cannot be filtered.'), - widget=forms.Select( - choices=BOOLEAN_WITH_BLANK_CHOICES - ) - ) class CoordinateGroupsForm(NetBoxModelForm): fieldsets = ( @@ -530,6 +528,7 @@ class IndividualOptionsForm(NetBoxModelForm): 'save_coords', 'show_unconnected', 'show_cables', + 'show_wireless', 'show_logical_connections', 'show_single_cable_logical_conns', 'show_neighbors', @@ -546,7 +545,6 @@ class IndividualOptionsForm(NetBoxModelForm): ( 'show_circuit', 'show_power', - 'show_wireless', name=_("Additional filter-independent types (non-devices)") ), ) @@ -600,6 +598,13 @@ class IndividualOptionsForm(NetBoxModelForm): 'with one or more cables. These connections are displayed as solid ' 'lines in the color of the cable.') ) + show_wireless = forms.BooleanField( + label =_('Show Wireless Links'), + required=False, + initial=False, + help_text=_('Displays wireless connections. These connections are ' + 'displayed as blue dotted lines.') + ) show_logical_connections = forms.BooleanField( label =_('Show Logical Connections'), required=False, @@ -700,22 +705,14 @@ class IndividualOptionsForm(NetBoxModelForm): 'color of the cable. This option depends on \'Show Cables\'. ' 'Be aware that Power Feeds cannot be filtered.') ) - show_wireless = forms.BooleanField( - label =_('Show Wireless Links'), - required=False, - initial=False, - help_text=_('Displays wireless connections. These connections are ' - 'displayed as blue dotted lines. ' - 'Be aware that Wireless Links cannot be filtered.') - ) class Meta: model = IndividualOptions fields = [ 'user_id', 'ignore_cable_type', 'preselected_device_roles', 'preselected_tags', - 'save_coords', 'show_unconnected', 'show_cables', 'show_logical_connections', - 'show_single_cable_logical_conns', 'show_neighbors', + 'save_coords', 'show_unconnected', 'show_cables', 'show_wireless', + 'show_logical_connections', 'show_single_cable_logical_conns', 'show_neighbors', 'group_sites', 'group_locations', 'group_racks', 'group_virtualchassis', 'draw_default_layout', 'straight_cables', 'grid_size', 'node_label_items', - 'show_circuit', 'show_power', 'show_wireless' + 'show_circuit', 'show_power' ]