[PR #6891] [CLOSED] feat: add cable reconnection #13183

Closed
opened 2025-12-29 22:25:51 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/6891
Author: @hellerve
Created: 8/5/2021
Status: Closed

Base: developHead: feat/cable-move


📝 Commits (1)

  • f8d7c02 feat: add cable reconnection

📊 Changes

5 files changed (+811 additions, -0 deletions)

View changed files

📝 netbox/dcim/forms.py (+568 -0)
📝 netbox/dcim/urls.py (+1 -0)
📝 netbox/dcim/views.py (+98 -0)
📝 netbox/templates/dcim/cable.html (+4 -0)
netbox/templates/dcim/cable_reconnect.html (+140 -0)

📄 Description

Fixes: #4881

Note: This is marked as a draft PR, since it is rather big and makes some tradeoffs that we might have to talk about and reconsider. It also has no automated tests, since there are no cable form test cases. Should I try to add them anyway? My guess is “yes”, but I’d like to verify before doing that work :)

This PR adds, on the face of it, a button labelled Reconnect to a cable detail. The form that it leads to allows for both sides of the cable to move. As such, we needed to implement all the missing forms—18 in total. Another option would be to be able to edit just one side at a time, and do that from the device component table. This would possibly allow us to reuse the forms we already have. Since this is the implementation I had at hand (in a plugin, I can’t really edit the table), I stuck with this solution for now. Happy to change it.

It also, under the hood, deletes the cable and recreates it. This means that the PK changes on reconnection, which should be a non-issue in most cases. Otherwise we’d have to touch the cable model, which I refrained from doing for now. Again, happy to change that.

The use case of moving ends of a cable seems to work, though, so that’s good :)

Cheers


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/netbox-community/netbox/pull/6891 **Author:** [@hellerve](https://github.com/hellerve) **Created:** 8/5/2021 **Status:** ❌ Closed **Base:** `develop` ← **Head:** `feat/cable-move` --- ### 📝 Commits (1) - [`f8d7c02`](https://github.com/netbox-community/netbox/commit/f8d7c024e7696b4d0dbb27ed685faf7efc21cdac) feat: add cable reconnection ### 📊 Changes **5 files changed** (+811 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `netbox/dcim/forms.py` (+568 -0) 📝 `netbox/dcim/urls.py` (+1 -0) 📝 `netbox/dcim/views.py` (+98 -0) 📝 `netbox/templates/dcim/cable.html` (+4 -0) ➕ `netbox/templates/dcim/cable_reconnect.html` (+140 -0) </details> ### 📄 Description ### Fixes: #4881 **Note:** This is marked as a draft PR, since it is rather big and makes some tradeoffs that we might have to talk about and reconsider. It also has no automated tests, since there are no cable form test cases. Should I try to add them anyway? My guess is “yes”, but I’d like to verify before doing that work :) This PR adds, on the face of it, a button labelled `Reconnect` to a cable detail. The form that it leads to allows for both sides of the cable to move. As such, we needed to implement all the missing forms—18 in total. Another option would be to be able to edit just one side at a time, and do that from the device component table. This would possibly allow us to reuse the forms we already have. Since this is the implementation I had at hand (in a plugin, I can’t really edit the table), I stuck with this solution for now. Happy to change it. It also, under the hood, deletes the cable and recreates it. This means that the PK changes on reconnection, which should be a non-issue in most cases. Otherwise we’d have to touch the cable model, which I refrained from doing for now. Again, happy to change that. The use case of moving ends of a cable seems to work, though, so that’s good :) Cheers --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2025-12-29 22:25:51 +01:00
adam closed this issue 2025-12-29 22:25:51 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#13183