Closes #4147: Use absolute URLs in rack elevation SVG renderings

This commit is contained in:
Jeremy Stretch
2020-04-03 13:16:35 -04:00
parent 85dff7ece4
commit 7af91e2409
4 changed files with 15 additions and 6 deletions

View File

@@ -682,7 +682,8 @@ class Rack(ChangeLoggedModel, CustomFieldModel):
unit_width=RACK_ELEVATION_UNIT_WIDTH_DEFAULT,
unit_height=RACK_ELEVATION_UNIT_HEIGHT_DEFAULT,
legend_width=RACK_ELEVATION_LEGEND_WIDTH_DEFAULT,
include_images=True
include_images=True,
base_url=None
):
"""
Return an SVG of the rack elevation
@@ -693,8 +694,9 @@ class Rack(ChangeLoggedModel, CustomFieldModel):
height of the elevation
:param legend_width: Width of the unit legend, in pixels
:param include_images: Embed front/rear device images where available
:param base_url: Base URL for links and images. If none, URLs will be relative.
"""
elevation = RackElevationSVG(self, include_images=include_images)
elevation = RackElevationSVG(self, include_images=include_images, base_url=base_url)
return elevation.render(face, unit_width, unit_height, legend_width)