From a49521d6838c0ea47f8f1b8b908ee8b028fbc6cd Mon Sep 17 00:00:00 2001 From: Jeremy Stretch Date: Mon, 15 May 2017 13:11:20 -0400 Subject: [PATCH] #1177: Render planned connections as dashed lines on topology maps --- netbox/extras/models.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/netbox/extras/models.py b/netbox/extras/models.py index 47dd91243..66d44d8a5 100644 --- a/netbox/extras/models.py +++ b/netbox/extras/models.py @@ -318,7 +318,7 @@ class TopologyMap(models.Model): def render(self, img_format='png'): from circuits.models import CircuitTermination - from dcim.models import Device, InterfaceConnection + from dcim.models import CONNECTION_STATUS_CONNECTED, Device, InterfaceConnection # Construct the graph graph = graphviz.Graph() @@ -360,7 +360,8 @@ class TopologyMap(models.Model): interface_a__device__in=devices, interface_b__device__in=devices ) for c in connections: - graph.edge(c.interface_a.device.name, c.interface_b.device.name) + style = 'solid' if c.connection_status == CONNECTION_STATUS_CONNECTED else 'dashed' + graph.edge(c.interface_a.device.name, c.interface_b.device.name, style=style) # Add all circuits to the graph for termination in CircuitTermination.objects.filter(term_side='A', interface__device__in=devices):