mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-25 01:48:38 -06:00
16176 Add UI for multi-termination cables
This commit is contained in:
parent
b7b0ab16f5
commit
f6c1642116
@ -19,7 +19,7 @@ def get_cable_form(a_type, b_type):
|
|||||||
# Device component
|
# Device component
|
||||||
if hasattr(term_cls, 'device'):
|
if hasattr(term_cls, 'device'):
|
||||||
|
|
||||||
attrs[f'termination_{cable_end}_device'] = DynamicModelChoiceField(
|
attrs[f'termination_{cable_end}_device'] = DynamicModelMultipleChoiceField(
|
||||||
queryset=Device.objects.all(),
|
queryset=Device.objects.all(),
|
||||||
label=_('Device'),
|
label=_('Device'),
|
||||||
required=False,
|
required=False,
|
||||||
@ -33,6 +33,7 @@ def get_cable_form(a_type, b_type):
|
|||||||
label=term_cls._meta.verbose_name.title(),
|
label=term_cls._meta.verbose_name.title(),
|
||||||
context={
|
context={
|
||||||
'disabled': '_occupied',
|
'disabled': '_occupied',
|
||||||
|
'parent': 'device',
|
||||||
},
|
},
|
||||||
query_params={
|
query_params={
|
||||||
'device_id': f'$termination_{cable_end}_device',
|
'device_id': f'$termination_{cable_end}_device',
|
||||||
@ -43,7 +44,7 @@ def get_cable_form(a_type, b_type):
|
|||||||
# PowerFeed
|
# PowerFeed
|
||||||
elif term_cls == PowerFeed:
|
elif term_cls == PowerFeed:
|
||||||
|
|
||||||
attrs[f'termination_{cable_end}_powerpanel'] = DynamicModelChoiceField(
|
attrs[f'termination_{cable_end}_powerpanel'] = DynamicModelMultipleChoiceField(
|
||||||
queryset=PowerPanel.objects.all(),
|
queryset=PowerPanel.objects.all(),
|
||||||
label=_('Power Panel'),
|
label=_('Power Panel'),
|
||||||
required=False,
|
required=False,
|
||||||
@ -57,6 +58,7 @@ def get_cable_form(a_type, b_type):
|
|||||||
label=_('Power Feed'),
|
label=_('Power Feed'),
|
||||||
context={
|
context={
|
||||||
'disabled': '_occupied',
|
'disabled': '_occupied',
|
||||||
|
'parent': 'powerpanel',
|
||||||
},
|
},
|
||||||
query_params={
|
query_params={
|
||||||
'power_panel_id': f'$termination_{cable_end}_powerpanel',
|
'power_panel_id': f'$termination_{cable_end}_powerpanel',
|
||||||
@ -66,7 +68,7 @@ def get_cable_form(a_type, b_type):
|
|||||||
# CircuitTermination
|
# CircuitTermination
|
||||||
elif term_cls == CircuitTermination:
|
elif term_cls == CircuitTermination:
|
||||||
|
|
||||||
attrs[f'termination_{cable_end}_circuit'] = DynamicModelChoiceField(
|
attrs[f'termination_{cable_end}_circuit'] = DynamicModelMultipleChoiceField(
|
||||||
queryset=Circuit.objects.all(),
|
queryset=Circuit.objects.all(),
|
||||||
label=_('Circuit'),
|
label=_('Circuit'),
|
||||||
selector=True,
|
selector=True,
|
||||||
@ -79,6 +81,7 @@ def get_cable_form(a_type, b_type):
|
|||||||
label=_('Side'),
|
label=_('Side'),
|
||||||
context={
|
context={
|
||||||
'disabled': '_occupied',
|
'disabled': '_occupied',
|
||||||
|
'parent': 'circuit',
|
||||||
},
|
},
|
||||||
query_params={
|
query_params={
|
||||||
'circuit_id': f'$termination_{cable_end}_circuit',
|
'circuit_id': f'$termination_{cable_end}_circuit',
|
||||||
|
Loading…
Reference in New Issue
Block a user