mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-22 23:46:44 -06:00
Add columns to TunnelTerminationTable
This commit is contained in:
parent
a4e8070c6d
commit
bf4bc2344c
@ -1,4 +1,5 @@
|
||||
import django_tables2 as tables
|
||||
from django.contrib.contenttypes.fields import GenericRelation
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
from django_tables2.utils import Accessor
|
||||
|
||||
@ -55,10 +56,22 @@ class TunnelTerminationTable(TenancyColumnsMixin, NetBoxTable):
|
||||
role = columns.ChoiceFieldColumn(
|
||||
verbose_name=_('Role')
|
||||
)
|
||||
interface_parent = tables.Column(
|
||||
accessor='interface__parent_object',
|
||||
linkify=True,
|
||||
orderable=False,
|
||||
verbose_name=_('Host')
|
||||
)
|
||||
interface = tables.Column(
|
||||
verbose_name=_('Interface'),
|
||||
linkify=True
|
||||
)
|
||||
ip_addresses = tables.ManyToManyColumn(
|
||||
accessor=tables.A('interface__ip_addresses'),
|
||||
orderable=False,
|
||||
linkify_item=True,
|
||||
verbose_name=_('IP Addresses')
|
||||
)
|
||||
outside_ip = tables.Column(
|
||||
verbose_name=_('Outside IP'),
|
||||
linkify=True
|
||||
@ -70,9 +83,10 @@ class TunnelTerminationTable(TenancyColumnsMixin, NetBoxTable):
|
||||
class Meta(NetBoxTable.Meta):
|
||||
model = TunnelTermination
|
||||
fields = (
|
||||
'pk', 'id', 'tunnel', 'role', 'interface', 'outside_ip', 'tags', 'created', 'last_updated',
|
||||
'pk', 'id', 'tunnel', 'role', 'interface_parent', 'interface', 'ip_addresses', 'outside_ip', 'tags',
|
||||
'created', 'last_updated',
|
||||
)
|
||||
default_columns = ('pk', 'tunnel', 'role', 'interface', 'outside_ip')
|
||||
default_columns = ('pk', 'tunnel', 'role', 'interface_parent', 'interface', 'ip_addresses', 'outside_ip')
|
||||
|
||||
|
||||
class IPSecProfileTable(TenancyColumnsMixin, NetBoxTable):
|
||||
|
Loading…
Reference in New Issue
Block a user