mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-13 02:58:17 -06:00
#3564 - Minor cleanup
This commit is contained in:
parent
fa64cc09fe
commit
e5da7ac2a4
@ -644,8 +644,6 @@ class DeviceImportTable(BaseTable):
|
||||
#
|
||||
|
||||
class DeviceComponentDetailTable(BaseTable):
|
||||
component_type = ''
|
||||
|
||||
pk = ToggleColumn()
|
||||
cable = tables.LinkColumn()
|
||||
|
||||
@ -663,7 +661,6 @@ class ConsolePortTable(BaseTable):
|
||||
|
||||
|
||||
class ConsolePortDetailTable(DeviceComponentDetailTable):
|
||||
component_type = 'Console Ports'
|
||||
device = tables.LinkColumn()
|
||||
|
||||
class Meta(DeviceComponentDetailTable.Meta, ConsolePortTable.Meta):
|
||||
@ -678,7 +675,6 @@ class ConsoleServerPortTable(BaseTable):
|
||||
|
||||
|
||||
class ConsoleServerPortDetailTable(DeviceComponentDetailTable):
|
||||
component_type = 'Console Server Ports'
|
||||
device = tables.LinkColumn()
|
||||
|
||||
class Meta(DeviceComponentDetailTable.Meta, ConsoleServerPortTable.Meta):
|
||||
@ -693,7 +689,6 @@ class PowerPortTable(BaseTable):
|
||||
|
||||
|
||||
class PowerPortDetailTable(DeviceComponentDetailTable):
|
||||
component_type = 'Power Ports'
|
||||
device = tables.LinkColumn()
|
||||
|
||||
class Meta(DeviceComponentDetailTable.Meta, PowerPortTable.Meta):
|
||||
@ -708,7 +703,6 @@ class PowerOutletTable(BaseTable):
|
||||
|
||||
|
||||
class PowerOutletDetailTable(DeviceComponentDetailTable):
|
||||
component_type = 'Power Outlets'
|
||||
device = tables.LinkColumn()
|
||||
|
||||
class Meta(DeviceComponentDetailTable.Meta, PowerOutletTable.Meta):
|
||||
@ -723,10 +717,9 @@ class InterfaceTable(BaseTable):
|
||||
|
||||
|
||||
class InterfaceDetailTable(DeviceComponentDetailTable):
|
||||
component_type = 'Interfaces'
|
||||
parent = tables.LinkColumn(order_by=('device', 'virtual_machine'))
|
||||
|
||||
class Meta(InterfaceTable.Meta, DeviceComponentDetailTable.Meta):
|
||||
class Meta(InterfaceTable.Meta):
|
||||
order_by = ('parent', 'name')
|
||||
fields = ('pk', 'parent', 'name', 'type', 'description', 'cable')
|
||||
sequence = ('pk', 'parent', 'name', 'type', 'description', 'cable')
|
||||
@ -741,7 +734,6 @@ class FrontPortTable(BaseTable):
|
||||
|
||||
|
||||
class FrontPortDetailTable(DeviceComponentDetailTable):
|
||||
component_type = 'Front Ports'
|
||||
device = tables.LinkColumn()
|
||||
|
||||
class Meta(DeviceComponentDetailTable.Meta, FrontPortTable.Meta):
|
||||
@ -757,7 +749,6 @@ class RearPortTable(BaseTable):
|
||||
|
||||
|
||||
class RearPortDetailTable(DeviceComponentDetailTable):
|
||||
component_type = 'Rear Ports'
|
||||
device = tables.LinkColumn()
|
||||
|
||||
class Meta(DeviceComponentDetailTable.Meta, RearPortTable.Meta):
|
||||
@ -772,11 +763,10 @@ class DeviceBayTable(BaseTable):
|
||||
|
||||
|
||||
class DeviceBayDetailTable(DeviceComponentDetailTable):
|
||||
component_type = 'Device Bays'
|
||||
device = tables.LinkColumn()
|
||||
installed_device = tables.LinkColumn()
|
||||
|
||||
class Meta(DeviceComponentDetailTable.Meta, DeviceBayTable.Meta):
|
||||
class Meta(DeviceBayTable.Meta):
|
||||
fields = ('pk', 'name', 'device', 'installed_device')
|
||||
sequence = ('pk', 'name', 'device', 'installed_device')
|
||||
exclude = ('cable',)
|
||||
|
@ -1402,7 +1402,6 @@ class PowerOutletBulkDeleteView(PermissionRequiredMixin, BulkDeleteView):
|
||||
#
|
||||
|
||||
class InterfaceListView(PermissionRequiredMixin, ObjectListView):
|
||||
type = 'Interface'
|
||||
permission_required = 'dcim.view_interface'
|
||||
queryset = Interface.objects.prefetch_related('device', 'device__tenant', 'device__site', 'cable')
|
||||
filter = filters.InterfaceFilter
|
||||
|
@ -1,11 +1,12 @@
|
||||
{% extends '_base.html' %}
|
||||
{% load buttons %}
|
||||
{% load helpers %}
|
||||
|
||||
{% block content %}
|
||||
<div class="pull-right noprint">
|
||||
{% export_button content_type %}
|
||||
</div>
|
||||
<h1>{% block title %}{{ table.component_type }}{% endblock %}</h1>
|
||||
<h1>{% block title %}{{ table.Meta.model|model_name|capfirst }}s{% endblock %}</h1>
|
||||
<div class="row">
|
||||
<div class="col-md-9">
|
||||
{% include 'responsive_table.html' %}
|
||||
|
@ -194,6 +194,12 @@
|
||||
<li{% if not perms.dcim.view_rearport %} class="disabled"{% endif %}>
|
||||
<a href="{% url 'dcim:rearport_list' %}">Rear Ports</a>
|
||||
</li>
|
||||
<li{% if not perms.dcim.view_consoleport %} class="disabled"{% endif %}>
|
||||
<a href="{% url 'dcim:consoleport_list' %}">Console Ports</a>
|
||||
</li>
|
||||
<li{% if not perms.dcim.view_consoleport %} class="disabled"{% endif %}>
|
||||
<a href="{% url 'dcim:consoleserverport_list' %}">Console Server Ports</a>
|
||||
</li>
|
||||
<li{% if not perms.dcim.view_powerport %} class="disabled"{% endif %}>
|
||||
<a href="{% url 'dcim:powerport_list' %}">Power Ports</a>
|
||||
</li>
|
||||
|
Loading…
Reference in New Issue
Block a user