mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-29 11:56:25 -06:00
Formatting cleanup
This commit is contained in:
parent
b5706f40b1
commit
a03788fe10
@ -931,17 +931,41 @@ class ConsoleServerPortConnectionForm(BootstrapMixin, forms.Form):
|
|||||||
attrs={'filter-for': 'device', 'nullable': 'true'}
|
attrs={'filter-for': 'device', 'nullable': 'true'}
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
device = forms.ModelChoiceField(queryset=Device.objects.all(), label='Device', required=False,
|
device = forms.ModelChoiceField(
|
||||||
widget=APISelect(api_url='/api/dcim/devices/?site_id={{site}}&rack_id={{rack}}',
|
queryset=Device.objects.all(),
|
||||||
display_field='display_name', attrs={'filter-for': 'port'}))
|
label='Device',
|
||||||
livesearch = forms.CharField(required=False, label='Device', widget=Livesearch(
|
required=False,
|
||||||
query_key='q', query_url='dcim-api:device_list', field_to_update='device')
|
widget=APISelect(
|
||||||
|
api_url='/api/dcim/devices/?site_id={{site}}&rack_id={{rack}}',
|
||||||
|
display_field='display_name',
|
||||||
|
attrs={'filter-for': 'port'}
|
||||||
|
)
|
||||||
|
)
|
||||||
|
livesearch = forms.CharField(
|
||||||
|
required=False,
|
||||||
|
label='Device',
|
||||||
|
widget=Livesearch(
|
||||||
|
query_key='q',
|
||||||
|
query_url='dcim-api:device_list',
|
||||||
|
field_to_update='device'
|
||||||
|
)
|
||||||
|
)
|
||||||
|
port = forms.ModelChoiceField(
|
||||||
|
queryset=ConsolePort.objects.all(),
|
||||||
|
label='Port',
|
||||||
|
widget=APISelect(
|
||||||
|
api_url='/api/dcim/devices/{{device}}/console-ports/',
|
||||||
|
disabled_indicator='cs_port'
|
||||||
|
)
|
||||||
|
)
|
||||||
|
connection_status = forms.BooleanField(
|
||||||
|
required=False,
|
||||||
|
initial=CONNECTION_STATUS_CONNECTED,
|
||||||
|
label='Status',
|
||||||
|
widget=forms.Select(
|
||||||
|
choices=CONNECTION_STATUS_CHOICES
|
||||||
|
)
|
||||||
)
|
)
|
||||||
port = forms.ModelChoiceField(queryset=ConsolePort.objects.all(), label='Port',
|
|
||||||
widget=APISelect(api_url='/api/dcim/devices/{{device}}/console-ports/',
|
|
||||||
disabled_indicator='cs_port'))
|
|
||||||
connection_status = forms.BooleanField(required=False, initial=CONNECTION_STATUS_CONNECTED, label='Status',
|
|
||||||
widget=forms.Select(choices=CONNECTION_STATUS_CHOICES))
|
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
fields = ['site', 'rack', 'device', 'livesearch', 'port', 'connection_status']
|
fields = ['site', 'rack', 'device', 'livesearch', 'port', 'connection_status']
|
||||||
|
Loading…
Reference in New Issue
Block a user