mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-30 04:16:24 -06:00
Misc cleanup
This commit is contained in:
parent
a7fbb986bb
commit
1275c55e1b
@ -2579,6 +2579,8 @@ class InterfaceView(generic.ObjectView):
|
||||
data=vlans,
|
||||
orderable=False
|
||||
)
|
||||
|
||||
# Get VLAN translation rules
|
||||
vlan_translation_table = None
|
||||
if instance.vlan_translation_policy:
|
||||
vlan_translation_table = VLANTranslationRuleTable(
|
||||
|
@ -284,6 +284,9 @@ class VLANTranslationRuleTable(NetBoxTable):
|
||||
remote_vid = tables.Column(
|
||||
verbose_name=_('Remote VID'),
|
||||
)
|
||||
description = tables.Column(
|
||||
verbose_name=_('Description'),
|
||||
)
|
||||
tags = columns.TagColumn(
|
||||
url_name='ipam:vlantranslationrule_list'
|
||||
)
|
||||
@ -291,6 +294,6 @@ class VLANTranslationRuleTable(NetBoxTable):
|
||||
class Meta(NetBoxTable.Meta):
|
||||
model = VLANTranslationRule
|
||||
fields = (
|
||||
'pk', 'id', 'name', 'policy', 'local_vid', 'remote_vid', 'tags', 'created', 'last_updated',
|
||||
'pk', 'id', 'name', 'policy', 'local_vid', 'remote_vid', 'description', 'tags', 'created', 'last_updated',
|
||||
)
|
||||
default_columns = ('pk', 'id', 'local_vid', 'remote_vid', 'policy')
|
||||
default_columns = ('pk', 'policy', 'local_vid', 'remote_vid', 'description')
|
||||
|
@ -1975,9 +1975,6 @@ class VLANTranslationRuleTestCase(TestCase, ChangeLoggedFilterSetTests):
|
||||
policies = VLANTranslationPolicy.objects.all()[:2]
|
||||
params = {'policy_id': [policies[0].pk]}
|
||||
self.assertEqual(self.filterset(params, self.queryset).qs.count(), 2)
|
||||
|
||||
def test_policy(self):
|
||||
policies = VLANTranslationPolicy.objects.all()[:2]
|
||||
params = {'policy': [policies[0].name]}
|
||||
self.assertEqual(self.filterset(params, self.queryset).qs.count(), 2)
|
||||
|
||||
|
@ -11,7 +11,7 @@
|
||||
<h2 class="card-header">{% trans "VLAN Translation Policy" %}</h2>
|
||||
<table class="table table-hover attr-table">
|
||||
<tr>
|
||||
<th scope="row">{% trans "DNS Name" %}</th>
|
||||
<th scope="row">{% trans "Name" %}</th>
|
||||
<td>{{ object.name|placeholder }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -515,6 +515,8 @@ class VMInterfaceView(generic.ObjectView):
|
||||
exclude=('virtual_machine',),
|
||||
orderable=False
|
||||
)
|
||||
|
||||
# Get VLAN translation rules
|
||||
vlan_translation_table = None
|
||||
if instance.vlan_translation_policy:
|
||||
vlan_translation_table = VLANTranslationRuleTable(
|
||||
|
Loading…
Reference in New Issue
Block a user