fix: show wireless links between devices only reachable via other cables
WirelessLink lookups only matched devices already in the selected racks (device_ids), so a link between two purely external devices that were pulled into the topology only as endpoints of unrelated cables (e.g. two outdoor radios each cabled to something inside the selected racks) never showed up, even though both endpoint nodes were already rendered. Now the wireless query also matches devices discovered via the cable pass (topology_nodes), so links between already-visible external nodes are drawn too. Co-Authored-By: Claude Sonnet 5 <[email protected]>
This commit is contained in:
1 parent
f08df4fd52
commit
4a12037ac4
1 file changed
+5
-2
@@ -1044,9 +1044,12 @@ class RackElevationView(PermissionRequiredMixin, View):
|
||||
"kind": "power" if is_power_cable else "cable",
|
||||
})
|
||||
|
||||
wireless_device_ids = set(device_ids) | {
|
||||
node["device_id"] for node in topology_nodes.values() if node.get("device_id")
|
||||
}
|
||||
wireless_links = WirelessLink.objects.restrict(request.user, "view").filter(
|
||||
Q(interface_a__device_id__in=device_ids) |
|
||||
Q(interface_b__device_id__in=device_ids)
|
||||
Q(interface_a__device_id__in=wireless_device_ids) |
|
||||
Q(interface_b__device_id__in=wireless_device_ids)
|
||||
).select_related(
|
||||
"interface_a__device__rack", "interface_a__device__role", "interface_a__device__device_type",
|
||||
"interface_b__device__rack", "interface_b__device__role", "interface_b__device__device_type",
|
||||
|
||||
Reference in new issue
Block a user