mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
Added ability to search for cables in global search
This commit is contained in:
@@ -15,6 +15,7 @@ OBJ_TYPE_CHOICES = (
|
|||||||
('devicetype', 'Device types'),
|
('devicetype', 'Device types'),
|
||||||
('device', 'Devices'),
|
('device', 'Devices'),
|
||||||
('virtualchassis', 'Virtual Chassis'),
|
('virtualchassis', 'Virtual Chassis'),
|
||||||
|
('cable', 'Cables'),
|
||||||
)),
|
)),
|
||||||
('IPAM', (
|
('IPAM', (
|
||||||
('vrf', 'VRFs'),
|
('vrf', 'VRFs'),
|
||||||
|
@@ -11,13 +11,13 @@ from circuits.filters import CircuitFilter, ProviderFilter
|
|||||||
from circuits.models import Circuit, Provider
|
from circuits.models import Circuit, Provider
|
||||||
from circuits.tables import CircuitTable, ProviderTable
|
from circuits.tables import CircuitTable, ProviderTable
|
||||||
from dcim.filters import (
|
from dcim.filters import (
|
||||||
DeviceFilter, DeviceTypeFilter, RackFilter, RackGroupFilter, SiteFilter, VirtualChassisFilter
|
DeviceFilter, DeviceTypeFilter, RackFilter, RackGroupFilter, SiteFilter, VirtualChassisFilter, CableFilter
|
||||||
)
|
)
|
||||||
from dcim.models import (
|
from dcim.models import (
|
||||||
Cable, ConsolePort, Device, DeviceType, Interface, PowerPort, Rack, RackGroup, Site, VirtualChassis
|
Cable, ConsolePort, Device, DeviceType, Interface, PowerPort, Rack, RackGroup, Site, VirtualChassis, Cable
|
||||||
)
|
)
|
||||||
from dcim.tables import (
|
from dcim.tables import (
|
||||||
DeviceDetailTable, DeviceTypeTable, RackTable, RackGroupTable, SiteTable, VirtualChassisTable
|
DeviceDetailTable, DeviceTypeTable, RackTable, RackGroupTable, SiteTable, VirtualChassisTable, CableTable
|
||||||
)
|
)
|
||||||
from extras.models import ObjectChange, ReportResult, TopologyMap
|
from extras.models import ObjectChange, ReportResult, TopologyMap
|
||||||
from ipam.filters import AggregateFilter, IPAddressFilter, PrefixFilter, VLANFilter, VRFFilter
|
from ipam.filters import AggregateFilter, IPAddressFilter, PrefixFilter, VLANFilter, VRFFilter
|
||||||
@@ -88,6 +88,12 @@ SEARCH_TYPES = OrderedDict((
|
|||||||
'table': VirtualChassisTable,
|
'table': VirtualChassisTable,
|
||||||
'url': 'dcim:virtualchassis_list',
|
'url': 'dcim:virtualchassis_list',
|
||||||
}),
|
}),
|
||||||
|
('cable', {
|
||||||
|
'queryset': Cable.objects.all(),
|
||||||
|
'filter': CableFilter,
|
||||||
|
'table': CableTable,
|
||||||
|
'url': 'dcim:cable_list',
|
||||||
|
}),
|
||||||
# IPAM
|
# IPAM
|
||||||
('vrf', {
|
('vrf', {
|
||||||
'queryset': VRF.objects.select_related('tenant'),
|
'queryset': VRF.objects.select_related('tenant'),
|
||||||
|
Reference in New Issue
Block a user