-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes #14241, Fixes #13922: Update the CableRender #14750
Conversation
…e CableRender This commit updates the cable rendering logic to fix both issue netbox-community#14722 and netbox-community#13922. Before, objects, terminations and cables where drawn in the svg without context of each other. Now the following changes are applied: - Hosts and Terminations are where possible sorted alphabetically - Terminations and Cables are visually connected, and if necessary not in a vertical line - Terminations and Hosts are visually aligning - Cable Tooltips contain more information
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am going to test this and let you know if I come across anything. For now, see my comments below but you can wait until Jeremy pipes in as to whether he wants to take action on those.
This is similar to what I was going to do, but not exactly. Definintely seems like a workable solution though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Traceback (most recent call last):
File "C:\Development\netbox\venv\lib\site-packages\django\core\handlers\exception.py", line 55, in inner
response = get_response(request)
File "C:\Development\netbox\venv\lib\site-packages\django\core\handlers\base.py", line 197, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "C:\Development\netbox\venv\lib\site-packages\django\views\decorators\csrf.py", line 56, in wrapper_view
return view_func(*args, **kwargs)
File "C:\Development\netbox\venv\lib\site-packages\rest_framework\viewsets.py", line 125, in view
return self.dispatch(request, *args, **kwargs)
File "C:\Development\netbox\netbox\netbox\netbox\api\viewsets\__init__.py", line 93, in dispatch
return super().dispatch(request, *args, **kwargs)
File "C:\Development\netbox\venv\lib\site-packages\rest_framework\views.py", line 509, in dispatch
response = self.handle_exception(exc)
File "C:\Development\netbox\venv\lib\site-packages\rest_framework\views.py", line 469, in handle_exception
self.raise_uncaught_exception(exc)
File "C:\Development\netbox\venv\lib\site-packages\rest_framework\views.py", line 480, in raise_uncaught_exception
raise exc
File "C:\Development\netbox\venv\lib\site-packages\rest_framework\views.py", line 506, in dispatch
response = handler(request, *args, **kwargs)
File "C:\Development\netbox\netbox\netbox\dcim\api\views.py", line 60, in trace
return HttpResponse(drawing.render().tostring(), content_type='image/svg+xml')
File "C:\Development\netbox\netbox\netbox\dcim\svg\cables.py", line 405, in render
start = near[0].bottom_center
IndexError: list index out of range
Repro:
- Create device
- Create interfaces (2)
- Create device
- Create Rear Ports (2, 1 position)
- Create Front Ports (2)
- Connect Int1 to FP1
- Connect RP1 to RP2
- Connect FP2 to Int2
This is also reproducable with going through a "proper" panel system (Switch 1 --> Panel 1 --> Panel 2 --> Switch 2
also remove out-of-scope changes to tooltips
This happened due to a_terminations containing the far end and vice-versa. |
There might be, I will review when I have time |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All looks reasonable now to me, but I would like a second set of eyes on this.
Fixes: #14241, Fixes: #13922
This commit updates the cable rendering logic to fix both issue #14241 and #13922. Before, objects, terminations and cables where drawn in the svg without context of each other.
Now the following changes are applied:
Before:
After: