mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-15 03:32:53 -06:00
Merge pull request #8963 from minitriga/issue_8926
Closes #8926: Implement type and roll to device bay table
This commit is contained in:
commit
421f5a03aa
@ -680,6 +680,15 @@ class DeviceBayTable(DeviceComponentTable):
|
|||||||
'args': [Accessor('device_id')],
|
'args': [Accessor('device_id')],
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
device_role = ColoredLabelColumn(
|
||||||
|
accessor=Accessor('installed_device__device_role'),
|
||||||
|
verbose_name='Role'
|
||||||
|
)
|
||||||
|
device_type = tables.Column(
|
||||||
|
accessor=Accessor('installed_device__device_type'),
|
||||||
|
linkify=True,
|
||||||
|
verbose_name='Type'
|
||||||
|
)
|
||||||
status = tables.TemplateColumn(
|
status = tables.TemplateColumn(
|
||||||
template_code=DEVICEBAY_STATUS,
|
template_code=DEVICEBAY_STATUS,
|
||||||
order_by=Accessor('installed_device__status')
|
order_by=Accessor('installed_device__status')
|
||||||
@ -694,7 +703,7 @@ class DeviceBayTable(DeviceComponentTable):
|
|||||||
class Meta(DeviceComponentTable.Meta):
|
class Meta(DeviceComponentTable.Meta):
|
||||||
model = DeviceBay
|
model = DeviceBay
|
||||||
fields = (
|
fields = (
|
||||||
'pk', 'id', 'name', 'device', 'label', 'status', 'installed_device', 'description', 'tags',
|
'pk', 'id', 'name', 'device', 'label', 'status', 'device_role', 'device_type', 'installed_device', 'description', 'tags',
|
||||||
'created', 'last_updated',
|
'created', 'last_updated',
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user