mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-23 17:08:41 -06:00
Closes #6540: Add a 'flat' column to the prefix table
This commit is contained in:
parent
04c1619eb4
commit
5c263fac8d
@ -8,6 +8,7 @@
|
|||||||
* [#6487](https://github.com/netbox-community/netbox/issues/6487) - Add location filter to cable connection form
|
* [#6487](https://github.com/netbox-community/netbox/issues/6487) - Add location filter to cable connection form
|
||||||
* [#6501](https://github.com/netbox-community/netbox/issues/6501) - Expose prefix depth and children on REST API serializer
|
* [#6501](https://github.com/netbox-community/netbox/issues/6501) - Expose prefix depth and children on REST API serializer
|
||||||
* [#6527](https://github.com/netbox-community/netbox/issues/6527) - Support Markdown for report descriptions
|
* [#6527](https://github.com/netbox-community/netbox/issues/6527) - Support Markdown for report descriptions
|
||||||
|
* [#6540](https://github.com/netbox-community/netbox/issues/6540) - Add a "flat" column to the prefix table
|
||||||
|
|
||||||
### Bug Fixes
|
### Bug Fixes
|
||||||
|
|
||||||
|
@ -262,6 +262,11 @@ class PrefixTable(BaseTable):
|
|||||||
template_code=PREFIX_LINK,
|
template_code=PREFIX_LINK,
|
||||||
attrs={'td': {'class': 'text-nowrap'}}
|
attrs={'td': {'class': 'text-nowrap'}}
|
||||||
)
|
)
|
||||||
|
prefix_flat = tables.Column(
|
||||||
|
accessor=Accessor('prefix'),
|
||||||
|
linkify=True,
|
||||||
|
verbose_name='Prefix (Flat)'
|
||||||
|
)
|
||||||
depth = tables.Column(
|
depth = tables.Column(
|
||||||
accessor=Accessor('_depth'),
|
accessor=Accessor('_depth'),
|
||||||
verbose_name='Depth'
|
verbose_name='Depth'
|
||||||
@ -300,8 +305,8 @@ class PrefixTable(BaseTable):
|
|||||||
class Meta(BaseTable.Meta):
|
class Meta(BaseTable.Meta):
|
||||||
model = Prefix
|
model = Prefix
|
||||||
fields = (
|
fields = (
|
||||||
'pk', 'prefix', 'status', 'depth', 'children', 'vrf', 'tenant', 'site', 'vlan', 'role', 'is_pool',
|
'pk', 'prefix', 'prefix_flat', 'status', 'depth', 'children', 'vrf', 'tenant', 'site', 'vlan', 'role',
|
||||||
'description',
|
'is_pool', 'description',
|
||||||
)
|
)
|
||||||
default_columns = ('pk', 'prefix', 'status', 'vrf', 'tenant', 'site', 'vlan', 'role', 'description')
|
default_columns = ('pk', 'prefix', 'status', 'vrf', 'tenant', 'site', 'vlan', 'role', 'description')
|
||||||
row_attrs = {
|
row_attrs = {
|
||||||
@ -314,15 +319,14 @@ class PrefixDetailTable(PrefixTable):
|
|||||||
accessor='get_utilization',
|
accessor='get_utilization',
|
||||||
orderable=False
|
orderable=False
|
||||||
)
|
)
|
||||||
tenant = TenantColumn()
|
|
||||||
tags = TagColumn(
|
tags = TagColumn(
|
||||||
url_name='ipam:prefix_list'
|
url_name='ipam:prefix_list'
|
||||||
)
|
)
|
||||||
|
|
||||||
class Meta(PrefixTable.Meta):
|
class Meta(PrefixTable.Meta):
|
||||||
fields = (
|
fields = (
|
||||||
'pk', 'prefix', 'status', 'children', 'vrf', 'utilization', 'tenant', 'site', 'vlan', 'role', 'is_pool',
|
'pk', 'prefix', 'prefix_flat', 'status', 'children', 'vrf', 'utilization', 'tenant', 'site', 'vlan', 'role',
|
||||||
'description', 'tags',
|
'is_pool', 'description', 'tags',
|
||||||
)
|
)
|
||||||
default_columns = (
|
default_columns = (
|
||||||
'pk', 'prefix', 'status', 'children', 'vrf', 'utilization', 'tenant', 'site', 'vlan', 'role', 'description',
|
'pk', 'prefix', 'status', 'children', 'vrf', 'utilization', 'tenant', 'site', 'vlan', 'role', 'description',
|
||||||
|
Loading…
Reference in New Issue
Block a user