Adds L2VPN.status to table/detail display

This commit is contained in:
Jason Novinger 2025-03-03 11:19:53 -06:00
parent 7ca125f35d
commit 0ae134d40f
2 changed files with 10 additions and 3 deletions

View File

@ -22,6 +22,10 @@
<th scope="row">{% trans "Type" %}</th>
<td>{{ object.get_type_display }}</td>
</tr>
<tr>
<th scope="row">{% trans "Status" %}</th>
<td>{% badge object.get_status_display bg_color=object.get_status_color %}</td>
</tr>
<tr>
<th scope="row">{% trans "Description" %}</th>
<td>{{ object.description|placeholder }}</td>

View File

@ -23,6 +23,9 @@ class L2VPNTable(TenancyColumnsMixin, NetBoxTable):
verbose_name=_('Name'),
linkify=True
)
status = columns.ChoiceFieldColumn(
verbose_name=_('Status')
)
import_targets = columns.TemplateColumn(
verbose_name=_('Import Targets'),
template_code=L2VPN_TARGETS,
@ -43,10 +46,10 @@ class L2VPNTable(TenancyColumnsMixin, NetBoxTable):
class Meta(NetBoxTable.Meta):
model = L2VPN
fields = (
'pk', 'name', 'slug', 'identifier', 'type', 'import_targets', 'export_targets', 'tenant', 'tenant_group',
'description', 'comments', 'tags', 'created', 'last_updated',
'pk', 'name', 'slug', 'status', 'identifier', 'type', 'import_targets', 'export_targets', 'tenant',
'tenant_group', 'description', 'comments', 'tags', 'created', 'last_updated',
)
default_columns = ('pk', 'name', 'identifier', 'type', 'description')
default_columns = ('pk', 'name', 'status', 'identifier', 'type', 'description')
class L2VPNTerminationTable(NetBoxTable):