1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Initial work on SVG support for cable tracing

This commit is contained in:
jeremystretch
2021-07-13 15:38:34 -04:00
parent faa993acfb
commit ce7fa95546
8 changed files with 266 additions and 1 deletions

View File

@@ -53,6 +53,13 @@ class PathEndpointMixin(object):
# Initialize the path array
path = []
if request.GET.get('render', None) == 'svg':
# Render SVG
drawing = obj.get_trace_svg(
base_url=request.build_absolute_uri('/')
)
return HttpResponse(drawing.tostring(), content_type='image/svg+xml')
for near_end, cable, far_end in obj.trace():
if near_end is None:
# Split paths