mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
cef0d168a5
* netbox-community/netbox#6930: Add ID column to devices, device types, and components * netbox-community/netbox#6930: Add ID column to sites, racks, and tenants * netbox-community/netbox#6930: Add ID column to power, providers, TODO circuits * netbox-community/netbox#6930: Add ID column to virtualization tables * netbox-community/netbox#6930: Add ID column to IPAM tables * netbox-community/netbox#6930: Add ID column to 'extras' tables * netbox-community/netbox#6930: Move ID column to BaseTable class * netbox-community/netbox#6930: Don't linkify ID in device component template tables * netbox-community/netbox#6930: Don't show ID column in interface/console/power connections tables * netbox-community/netbox#6930: Don't show ID column in device component template tables * netbox-community/netbox#6930: Add ID column to ObjectJournal, DeviceImport, and Circuit tables * Exclude ID column from selected tables * netbox-community/netbox#6930:revert default columns on ObjectChangeTable, not configurable * netbox-community/netbox#6930: Add object ID to tagged objects table in tag detail view Co-authored-by: Jeremy Stretch <jstretch@ns1.com>
36 lines
821 B
Python
36 lines
821 B
Python
import django_tables2 as tables
|
|
|
|
from utilities.tables import BaseTable, TagColumn, ToggleColumn
|
|
from ipam.models import *
|
|
|
|
__all__ = (
|
|
'ServiceTable',
|
|
)
|
|
|
|
|
|
#
|
|
# Services
|
|
#
|
|
|
|
class ServiceTable(BaseTable):
|
|
pk = ToggleColumn()
|
|
name = tables.Column(
|
|
linkify=True
|
|
)
|
|
parent = tables.Column(
|
|
linkify=True,
|
|
order_by=('device', 'virtual_machine')
|
|
)
|
|
ports = tables.TemplateColumn(
|
|
template_code='{{ record.port_list }}',
|
|
verbose_name='Ports'
|
|
)
|
|
tags = TagColumn(
|
|
url_name='ipam:service_list'
|
|
)
|
|
|
|
class Meta(BaseTable.Meta):
|
|
model = Service
|
|
fields = ('pk', 'id', 'name', 'parent', 'protocol', 'ports', 'ipaddresses', 'description', 'tags')
|
|
default_columns = ('pk', 'name', 'parent', 'protocol', 'ports', 'description')
|