mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-13 02:58:17 -06:00
#3564 - Finalize fields, readjust order, reduce repetition
This commit is contained in:
parent
a4ff279548
commit
03350e002d
@ -647,9 +647,13 @@ class DeviceComponentDetailTable(BaseTable):
|
|||||||
component_type = ''
|
component_type = ''
|
||||||
|
|
||||||
pk = ToggleColumn()
|
pk = ToggleColumn()
|
||||||
device = tables.LinkColumn()
|
|
||||||
cable = tables.LinkColumn()
|
cable = tables.LinkColumn()
|
||||||
|
|
||||||
|
class Meta(BaseTable.Meta):
|
||||||
|
order_by = ('device', 'name')
|
||||||
|
fields = ('pk', 'device', 'name', 'type', 'description', 'cable')
|
||||||
|
sequence = ('pk', 'device', 'name', 'type', 'description', 'cable')
|
||||||
|
|
||||||
|
|
||||||
class ConsolePortTable(BaseTable):
|
class ConsolePortTable(BaseTable):
|
||||||
|
|
||||||
@ -660,10 +664,10 @@ class ConsolePortTable(BaseTable):
|
|||||||
|
|
||||||
class ConsolePortDetailTable(DeviceComponentDetailTable):
|
class ConsolePortDetailTable(DeviceComponentDetailTable):
|
||||||
component_type = 'Console Ports'
|
component_type = 'Console Ports'
|
||||||
|
device = tables.LinkColumn()
|
||||||
|
|
||||||
class Meta(ConsolePortTable.Meta):
|
class Meta(DeviceComponentDetailTable.Meta, ConsolePortTable.Meta):
|
||||||
model = ConsolePort
|
pass
|
||||||
fields = ('pk', 'name', 'type', 'connection_status', 'device', 'cable')
|
|
||||||
|
|
||||||
|
|
||||||
class ConsoleServerPortTable(BaseTable):
|
class ConsoleServerPortTable(BaseTable):
|
||||||
@ -675,10 +679,10 @@ class ConsoleServerPortTable(BaseTable):
|
|||||||
|
|
||||||
class ConsoleServerPortDetailTable(DeviceComponentDetailTable):
|
class ConsoleServerPortDetailTable(DeviceComponentDetailTable):
|
||||||
component_type = 'Console Server Ports'
|
component_type = 'Console Server Ports'
|
||||||
|
device = tables.LinkColumn()
|
||||||
|
|
||||||
class Meta(ConsoleServerPortTable.Meta):
|
class Meta(DeviceComponentDetailTable.Meta, ConsoleServerPortTable.Meta):
|
||||||
model = ConsoleServerPort
|
pass
|
||||||
fields = ('pk', 'name', 'type', 'connection_status', 'device', 'cable')
|
|
||||||
|
|
||||||
|
|
||||||
class PowerPortTable(BaseTable):
|
class PowerPortTable(BaseTable):
|
||||||
@ -690,10 +694,10 @@ class PowerPortTable(BaseTable):
|
|||||||
|
|
||||||
class PowerPortDetailTable(DeviceComponentDetailTable):
|
class PowerPortDetailTable(DeviceComponentDetailTable):
|
||||||
component_type = 'Power Ports'
|
component_type = 'Power Ports'
|
||||||
|
device = tables.LinkColumn()
|
||||||
|
|
||||||
class Meta(PowerPortTable.Meta):
|
class Meta(DeviceComponentDetailTable.Meta, PowerPortTable.Meta):
|
||||||
model = PowerPort
|
pass
|
||||||
fields = ('pk', 'name', 'type', 'connection_status', 'device', 'cable')
|
|
||||||
|
|
||||||
|
|
||||||
class PowerOutletTable(BaseTable):
|
class PowerOutletTable(BaseTable):
|
||||||
@ -705,10 +709,10 @@ class PowerOutletTable(BaseTable):
|
|||||||
|
|
||||||
class PowerOutletDetailTable(DeviceComponentDetailTable):
|
class PowerOutletDetailTable(DeviceComponentDetailTable):
|
||||||
component_type = 'Power Outlets'
|
component_type = 'Power Outlets'
|
||||||
|
device = tables.LinkColumn()
|
||||||
|
|
||||||
class Meta(PowerOutletTable.Meta):
|
class Meta(DeviceComponentDetailTable.Meta, PowerOutletTable.Meta):
|
||||||
model = PowerOutlet
|
pass
|
||||||
fields = ('pk', 'name', 'type', 'connection_status', 'device', 'cable')
|
|
||||||
|
|
||||||
|
|
||||||
class InterfaceTable(BaseTable):
|
class InterfaceTable(BaseTable):
|
||||||
@ -720,10 +724,12 @@ class InterfaceTable(BaseTable):
|
|||||||
|
|
||||||
class InterfaceDetailTable(DeviceComponentDetailTable):
|
class InterfaceDetailTable(DeviceComponentDetailTable):
|
||||||
component_type = 'Interfaces'
|
component_type = 'Interfaces'
|
||||||
|
parent = tables.LinkColumn(order_by=('device', 'virtual_machine'))
|
||||||
|
|
||||||
class Meta(InterfaceTable.Meta):
|
class Meta(InterfaceTable.Meta, DeviceComponentDetailTable.Meta):
|
||||||
model = Interface
|
order_by = ('parent', 'name')
|
||||||
fields = ('pk', 'name', 'type', 'connection_status', 'device', 'cable')
|
fields = ('pk', 'parent', 'name', 'type', 'cable', 'description')
|
||||||
|
sequence = ('pk', 'parent', 'name', 'type', 'cable', 'description')
|
||||||
|
|
||||||
|
|
||||||
class FrontPortTable(BaseTable):
|
class FrontPortTable(BaseTable):
|
||||||
@ -736,10 +742,10 @@ class FrontPortTable(BaseTable):
|
|||||||
|
|
||||||
class FrontPortDetailTable(DeviceComponentDetailTable):
|
class FrontPortDetailTable(DeviceComponentDetailTable):
|
||||||
component_type = 'Front Ports'
|
component_type = 'Front Ports'
|
||||||
|
device = tables.LinkColumn()
|
||||||
|
|
||||||
class Meta(FrontPortTable.Meta):
|
class Meta(DeviceComponentDetailTable.Meta, FrontPortTable.Meta):
|
||||||
model = FrontPort
|
pass
|
||||||
fields = ('pk', 'name', 'type', 'connection_status', 'device', 'cable')
|
|
||||||
|
|
||||||
|
|
||||||
class RearPortTable(BaseTable):
|
class RearPortTable(BaseTable):
|
||||||
@ -752,10 +758,10 @@ class RearPortTable(BaseTable):
|
|||||||
|
|
||||||
class RearPortDetailTable(DeviceComponentDetailTable):
|
class RearPortDetailTable(DeviceComponentDetailTable):
|
||||||
component_type = 'Rear Ports'
|
component_type = 'Rear Ports'
|
||||||
|
device = tables.LinkColumn()
|
||||||
|
|
||||||
class Meta(RearPortTable.Meta):
|
class Meta(DeviceComponentDetailTable.Meta, RearPortTable.Meta):
|
||||||
model = RearPort
|
pass
|
||||||
fields = ('pk', 'name', 'type', 'connection_status', 'device', 'cable')
|
|
||||||
|
|
||||||
|
|
||||||
class DeviceBayTable(BaseTable):
|
class DeviceBayTable(BaseTable):
|
||||||
@ -767,10 +773,13 @@ class DeviceBayTable(BaseTable):
|
|||||||
|
|
||||||
class DeviceBayDetailTable(DeviceComponentDetailTable):
|
class DeviceBayDetailTable(DeviceComponentDetailTable):
|
||||||
component_type = 'Device Bays'
|
component_type = 'Device Bays'
|
||||||
|
device = tables.LinkColumn()
|
||||||
|
installed_device = tables.LinkColumn()
|
||||||
|
|
||||||
class Meta(DeviceBayTable.Meta):
|
class Meta(DeviceComponentDetailTable.Meta, DeviceBayTable.Meta):
|
||||||
model = FrontPort
|
|
||||||
fields = ('pk', 'name', 'device', 'installed_device')
|
fields = ('pk', 'name', 'device', 'installed_device')
|
||||||
|
sequence = ('pk', 'name', 'device', 'installed_device')
|
||||||
|
exclude = ('cable',)
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
|
@ -200,6 +200,9 @@
|
|||||||
<li{% if not perms.dcim.view_poweroutlet %} class="disabled"{% endif %}>
|
<li{% if not perms.dcim.view_poweroutlet %} class="disabled"{% endif %}>
|
||||||
<a href="{% url 'dcim:poweroutlet_list' %}">Power Outlet</a>
|
<a href="{% url 'dcim:poweroutlet_list' %}">Power Outlet</a>
|
||||||
</li>
|
</li>
|
||||||
|
<li{% if not perms.dcim.view_devicebay %} class="disabled"{% endif %}>
|
||||||
|
<a href="{% url 'dcim:devicebay_list' %}">Device Bays</a>
|
||||||
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<li class="dropdown">
|
<li class="dropdown">
|
||||||
|
Loading…
Reference in New Issue
Block a user