|
@@ -11,8 +11,9 @@ from utilities.tables import (
|
|
|
TagColumn, ToggleColumn,
|
|
TagColumn, ToggleColumn,
|
|
|
)
|
|
)
|
|
|
from .template_code import (
|
|
from .template_code import (
|
|
|
- CABLETERMINATION, CONSOLEPORT_BUTTONS, CONSOLESERVERPORT_BUTTONS, DEVICE_LINK, FRONTPORT_BUTTONS, INTERFACE_BUTTONS,
|
|
|
|
|
- INTERFACE_IPADDRESSES, INTERFACE_TAGGED_VLANS, POWEROUTLET_BUTTONS, POWERPORT_BUTTONS, REARPORT_BUTTONS,
|
|
|
|
|
|
|
+ CABLETERMINATION, CONSOLEPORT_BUTTONS, CONSOLESERVERPORT_BUTTONS, DEVICE_LINK, DEVICEBAY_BUTTONS, FRONTPORT_BUTTONS,
|
|
|
|
|
+ INTERFACE_BUTTONS, INTERFACE_IPADDRESSES, INTERFACE_TAGGED_VLANS, POWEROUTLET_BUTTONS, POWERPORT_BUTTONS,
|
|
|
|
|
+ REARPORT_BUTTONS,
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
__all__ = (
|
|
__all__ = (
|
|
@@ -21,6 +22,7 @@ __all__ = (
|
|
|
'DeviceBayTable',
|
|
'DeviceBayTable',
|
|
|
'DeviceConsolePortTable',
|
|
'DeviceConsolePortTable',
|
|
|
'DeviceConsoleServerPortTable',
|
|
'DeviceConsoleServerPortTable',
|
|
|
|
|
+ 'DeviceDeviceBayTable',
|
|
|
'DeviceFrontPortTable',
|
|
'DeviceFrontPortTable',
|
|
|
'DeviceImportTable',
|
|
'DeviceImportTable',
|
|
|
'DeviceInterfaceTable',
|
|
'DeviceInterfaceTable',
|
|
@@ -464,7 +466,7 @@ class DeviceFrontPortTable(FrontPortTable):
|
|
|
model = FrontPort
|
|
model = FrontPort
|
|
|
fields = (
|
|
fields = (
|
|
|
'pk', 'name', 'label', 'type', 'rear_port', 'rear_port_position', 'description', 'cable', 'cable_peer',
|
|
'pk', 'name', 'label', 'type', 'rear_port', 'rear_port_position', 'description', 'cable', 'cable_peer',
|
|
|
- 'connection', 'tags', 'actions',
|
|
|
|
|
|
|
+ 'tags', 'actions',
|
|
|
)
|
|
)
|
|
|
default_columns = (
|
|
default_columns = (
|
|
|
'pk', 'name', 'label', 'type', 'rear_port', 'rear_port_position', 'description', 'cable', 'cable_peer',
|
|
'pk', 'name', 'label', 'type', 'rear_port', 'rear_port_position', 'description', 'cable', 'cable_peer',
|
|
@@ -500,8 +502,7 @@ class DeviceRearPortTable(RearPortTable):
|
|
|
class Meta(DeviceComponentTable.Meta):
|
|
class Meta(DeviceComponentTable.Meta):
|
|
|
model = RearPort
|
|
model = RearPort
|
|
|
fields = (
|
|
fields = (
|
|
|
- 'pk', 'name', 'label', 'type', 'positions', 'description', 'cable', 'cable_peer', 'connection', 'tags',
|
|
|
|
|
- 'actions',
|
|
|
|
|
|
|
+ 'pk', 'name', 'label', 'type', 'positions', 'description', 'cable', 'cable_peer', 'tags', 'actions',
|
|
|
)
|
|
)
|
|
|
default_columns = (
|
|
default_columns = (
|
|
|
'pk', 'name', 'label', 'type', 'positions', 'description', 'cable', 'cable_peer', 'actions',
|
|
'pk', 'name', 'label', 'type', 'positions', 'description', 'cable', 'cable_peer', 'actions',
|
|
@@ -525,6 +526,27 @@ class DeviceBayTable(DeviceComponentTable):
|
|
|
default_columns = ('pk', 'device', 'name', 'label', 'installed_device', 'description')
|
|
default_columns = ('pk', 'device', 'name', 'label', 'installed_device', 'description')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+class DeviceDeviceBayTable(DeviceBayTable):
|
|
|
|
|
+ name = tables.TemplateColumn(
|
|
|
|
|
+ template_code='<i class="fa fa-square{% if record.installed_device %}dot-circle-o{% else %}circle-o{% endif %}'
|
|
|
|
|
+ '"></i> <a href="{{ record.get_absolute_url }}">{{ value }}</a>'
|
|
|
|
|
+ )
|
|
|
|
|
+ actions = ButtonsColumn(
|
|
|
|
|
+ model=DeviceBay,
|
|
|
|
|
+ buttons=('edit', 'delete'),
|
|
|
|
|
+ prepend_template=DEVICEBAY_BUTTONS
|
|
|
|
|
+ )
|
|
|
|
|
+
|
|
|
|
|
+ class Meta(DeviceComponentTable.Meta):
|
|
|
|
|
+ model = DeviceBay
|
|
|
|
|
+ fields = (
|
|
|
|
|
+ 'pk', 'name', 'label', 'installed_device', 'description', 'tags', 'actions',
|
|
|
|
|
+ )
|
|
|
|
|
+ default_columns = (
|
|
|
|
|
+ 'pk', 'name', 'label', 'installed_device', 'description', 'actions',
|
|
|
|
|
+ )
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
class InventoryItemTable(DeviceComponentTable):
|
|
class InventoryItemTable(DeviceComponentTable):
|
|
|
manufacturer = tables.Column(
|
|
manufacturer = tables.Column(
|
|
|
linkify=True
|
|
linkify=True
|