mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-15 19:52:52 -06:00
#4867: Misc cleanup
This commit is contained in:
parent
14d769a501
commit
0946a536f3
@ -23,7 +23,8 @@ class InterfaceCommonForm(forms.Form):
|
||||
primary_mac_address = DynamicModelChoiceField(
|
||||
queryset=MACAddress.objects.all(),
|
||||
label=_('Primary MAC address'),
|
||||
required=False
|
||||
required=False,
|
||||
quick_add=True
|
||||
)
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
|
@ -1758,11 +1758,17 @@ class MACAddressForm(NetBoxModelForm):
|
||||
label=_('Interface'),
|
||||
queryset=Interface.objects.all(),
|
||||
required=False,
|
||||
context={
|
||||
'parent': 'device',
|
||||
},
|
||||
)
|
||||
vminterface = DynamicModelChoiceField(
|
||||
label=_('VM Interface'),
|
||||
queryset=VMInterface.objects.all(),
|
||||
required=False,
|
||||
context={
|
||||
'parent': 'virtual_machine',
|
||||
},
|
||||
)
|
||||
|
||||
fieldsets = (
|
||||
|
@ -88,12 +88,6 @@ DEVICES_MENU = Menu(
|
||||
get_model_item('dcim', 'manufacturer', _('Manufacturers')),
|
||||
),
|
||||
),
|
||||
MenuGroup(
|
||||
label=_('Addressing'),
|
||||
items=(
|
||||
get_model_item('dcim', 'macaddress', _('MAC Addresses')),
|
||||
),
|
||||
),
|
||||
MenuGroup(
|
||||
label=_('Device Components'),
|
||||
items=(
|
||||
@ -110,6 +104,12 @@ DEVICES_MENU = Menu(
|
||||
get_model_item('dcim', 'inventoryitemrole', _('Inventory Item Roles')),
|
||||
),
|
||||
),
|
||||
MenuGroup(
|
||||
label=_('Addressing'),
|
||||
items=(
|
||||
get_model_item('dcim', 'macaddress', _('MAC Addresses')),
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
|
||||
|
@ -124,8 +124,8 @@
|
||||
<tr>
|
||||
<th scope="row">{% trans "MAC Address" %}</th>
|
||||
<td>
|
||||
{% if object.mac_address %}
|
||||
<span class="font-monospace">{{ object.mac_address }}</span>
|
||||
{% if object.primary_mac_address %}
|
||||
<span class="font-monospace">{{ object.primary_mac_address|linkify }}</span>
|
||||
<span class="badge text-bg-primary">{% trans "Primary" %}</span>
|
||||
{% else %}
|
||||
{{ ''|placeholder }}
|
||||
|
Loading…
Reference in New Issue
Block a user