|
@@ -84,6 +84,11 @@ class RackTypeTable(NetBoxTable):
|
|
|
comments = columns.MarkdownColumn(
|
|
comments = columns.MarkdownColumn(
|
|
|
verbose_name=_('Comments'),
|
|
verbose_name=_('Comments'),
|
|
|
)
|
|
)
|
|
|
|
|
+ instance_count = columns.LinkedCountColumn(
|
|
|
|
|
+ viewname='dcim:rack_list',
|
|
|
|
|
+ url_params={'rack_type_id': 'pk'},
|
|
|
|
|
+ verbose_name=_('Instances')
|
|
|
|
|
+ )
|
|
|
tags = columns.TagColumn(
|
|
tags = columns.TagColumn(
|
|
|
url_name='dcim:rack_list'
|
|
url_name='dcim:rack_list'
|
|
|
)
|
|
)
|
|
@@ -92,11 +97,11 @@ class RackTypeTable(NetBoxTable):
|
|
|
model = RackType
|
|
model = RackType
|
|
|
fields = (
|
|
fields = (
|
|
|
'pk', 'id', 'name', 'manufacturer', 'form_factor', 'u_height', 'starting_unit', 'width', 'outer_width',
|
|
'pk', 'id', 'name', 'manufacturer', 'form_factor', 'u_height', 'starting_unit', 'width', 'outer_width',
|
|
|
- 'outer_depth', 'mounting_depth', 'airflow', 'weight', 'max_weight', 'description', 'comments', 'tags',
|
|
|
|
|
- 'created', 'last_updated',
|
|
|
|
|
|
|
+ 'outer_depth', 'mounting_depth', 'airflow', 'weight', 'max_weight', 'description', 'comments',
|
|
|
|
|
+ 'instance_count', 'tags', 'created', 'last_updated',
|
|
|
)
|
|
)
|
|
|
default_columns = (
|
|
default_columns = (
|
|
|
- 'pk', 'name', 'manufacturer', 'type', 'u_height', 'description',
|
|
|
|
|
|
|
+ 'pk', 'name', 'manufacturer', 'type', 'u_height', 'description', 'instance_count',
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
@@ -124,6 +129,15 @@ class RackTable(TenancyColumnsMixin, ContactsColumnMixin, NetBoxTable):
|
|
|
role = columns.ColoredLabelColumn(
|
|
role = columns.ColoredLabelColumn(
|
|
|
verbose_name=_('Role'),
|
|
verbose_name=_('Role'),
|
|
|
)
|
|
)
|
|
|
|
|
+ manufacturer = tables.Column(
|
|
|
|
|
+ verbose_name=_('Manufacturer'),
|
|
|
|
|
+ accessor=Accessor('rack_type__manufacturer'),
|
|
|
|
|
+ linkify=True
|
|
|
|
|
+ )
|
|
|
|
|
+ rack_type = tables.Column(
|
|
|
|
|
+ linkify=True,
|
|
|
|
|
+ verbose_name=_('Type')
|
|
|
|
|
+ )
|
|
|
u_height = tables.TemplateColumn(
|
|
u_height = tables.TemplateColumn(
|
|
|
template_code="{{ value }}U",
|
|
template_code="{{ value }}U",
|
|
|
verbose_name=_('Height')
|
|
verbose_name=_('Height')
|
|
@@ -169,14 +183,14 @@ class RackTable(TenancyColumnsMixin, ContactsColumnMixin, NetBoxTable):
|
|
|
class Meta(NetBoxTable.Meta):
|
|
class Meta(NetBoxTable.Meta):
|
|
|
model = Rack
|
|
model = Rack
|
|
|
fields = (
|
|
fields = (
|
|
|
- 'pk', 'id', 'name', 'site', 'location', 'status', 'facility_id', 'tenant', 'tenant_group', 'role', 'serial',
|
|
|
|
|
- 'asset_tag', 'form_factor', 'u_height', 'starting_unit', 'width', 'outer_width', 'outer_depth',
|
|
|
|
|
- 'mounting_depth', 'airflow', 'weight', 'max_weight', 'comments', 'device_count', 'get_utilization',
|
|
|
|
|
- 'get_power_utilization', 'description', 'contacts', 'tags', 'created', 'last_updated',
|
|
|
|
|
|
|
+ 'pk', 'id', 'name', 'site', 'location', 'status', 'facility_id', 'tenant', 'tenant_group', 'role',
|
|
|
|
|
+ 'rack_type', 'serial', 'asset_tag', 'form_factor', 'u_height', 'starting_unit', 'width', 'outer_width',
|
|
|
|
|
+ 'outer_depth', 'mounting_depth', 'airflow', 'weight', 'max_weight', 'comments', 'device_count',
|
|
|
|
|
+ 'get_utilization', 'get_power_utilization', 'description', 'contacts', 'tags', 'created', 'last_updated',
|
|
|
)
|
|
)
|
|
|
default_columns = (
|
|
default_columns = (
|
|
|
- 'pk', 'name', 'site', 'location', 'status', 'facility_id', 'tenant', 'role', 'u_height', 'device_count',
|
|
|
|
|
- 'get_utilization',
|
|
|
|
|
|
|
+ 'pk', 'name', 'site', 'location', 'status', 'facility_id', 'tenant', 'role', 'rack_type', 'u_height',
|
|
|
|
|
+ 'device_count', 'get_utilization',
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
|
|
|