|
22 | 22 | 'RackElevationSVG', |
23 | 23 | ) |
24 | 24 |
|
| 25 | +GRADIENT_RESERVED = '#b0b0ff' |
| 26 | +GRADIENT_OCCUPIED = '#d7d7d7' |
| 27 | +GRADIENT_BLOCKED = '#ffc0c0' |
| 28 | +STROKE_RESERVED = '#4d4dff' |
| 29 | + |
25 | 30 |
|
26 | 31 | def get_device_name(device): |
27 | 32 | if device.virtual_chassis: |
@@ -132,9 +137,9 @@ def _setup_drawing(self): |
132 | 137 | drawing.defs.add(drawing.style(css_file.read())) |
133 | 138 |
|
134 | 139 | # Add gradients |
135 | | - RackElevationSVG._add_gradient(drawing, 'reserved', '#b0b0ff') |
136 | | - RackElevationSVG._add_gradient(drawing, 'occupied', '#d7d7d7') |
137 | | - RackElevationSVG._add_gradient(drawing, 'blocked', '#ffc0c0') |
| 140 | + RackElevationSVG._add_gradient(drawing, 'reserved', GRADIENT_RESERVED) |
| 141 | + RackElevationSVG._add_gradient(drawing, 'occupied', GRADIENT_OCCUPIED) |
| 142 | + RackElevationSVG._add_gradient(drawing, 'blocked', GRADIENT_BLOCKED) |
138 | 143 |
|
139 | 144 | return drawing |
140 | 145 |
|
@@ -246,13 +251,13 @@ def draw_margin(self): |
246 | 251 | coords = self._get_device_coords(segment[0], u_height) |
247 | 252 | coords = (coords[0] + self.unit_width + RACK_ELEVATION_BORDER_WIDTH * 2, coords[1]) |
248 | 253 | size = ( |
249 | | - self.margin_width, |
| 254 | + self.margin_width - 3, |
250 | 255 | u_height * self.unit_height |
251 | 256 | ) |
252 | 257 | link = Hyperlink(href=f'{self.base_url}{reservation.get_absolute_url()}', target='_parent') |
253 | 258 | link.set_desc(f'Reservation #{reservation.pk}: {reservation.description}') |
254 | 259 | link.add( |
255 | | - Rect(coords, size, class_='reservation') |
| 260 | + Rect(coords, size, class_='reservation', stroke=STROKE_RESERVED, stroke_width=2) |
256 | 261 | ) |
257 | 262 | self.drawing.add(link) |
258 | 263 |
|
|
0 commit comments