Changes to interface/console/power port/etc connection template #4111

Closed
opened 2025-12-29 18:33:12 +01:00 by adam · 4 comments
Owner

Originally created by @cpmills1975 on GitHub (Sep 17, 2020).

Originally assigned to: @jeremystretch on GitHub.

Environment

  • Python version: 3.6
  • NetBox version: 2.9.3

Proposed Functionality

I'd like to propose that the "Name" label in the new connection templates (/dcim/interfaces/n/connect/*) read "Name (Label)" and the drop down list of interfaces/ports showed entries in this format (e.g "ge-1/0/23 (23)" or "eth0 (port 1)")

In a similar vein, I'd like to propose the Device field is shown as "Device (Asset Tag)" and the drop down list showed entries in this format as well (e.g. "mgmt-sw-01 (A12345)") however I appreciate that while Asset Tag is helpful to me, others may prefer a different field so this could perhaps be open to more discussion.

I am not proposing any changes to the existing functionality of these forms, just what and how information is displayed.

Use Case

When connecting interfaces between devices, we have discovered that it is possible to search for interfaces/ports by typing the label in to the name box and devices by typing the asset tag or serial number in to the device field. This is beneficial as my users who are typically tasked with connecting devices and recording the connections in NetBox are often more used to dealing with the physical rather than the logical side of devices and therefore typically see ports as the names stamped on them and devices by the prominently displayed asset tag rather than the names given to them in config.

Database Changes

None

External Dependencies

None

Originally created by @cpmills1975 on GitHub (Sep 17, 2020). Originally assigned to: @jeremystretch on GitHub. ### Environment * Python version: 3.6 * NetBox version: 2.9.3 <!-- Describe in detail the new functionality you are proposing. Include any specific changes to work flows, data models, or the user interface. --> ### Proposed Functionality I'd like to propose that the "Name" label in the new connection templates (/dcim/interfaces/n/connect/*) read "Name (Label)" and the drop down list of interfaces/ports showed entries in this format (e.g "ge-1/0/23 (23)" or "eth0 (port 1)") In a similar vein, I'd like to propose the Device field is shown as "Device (Asset Tag)" and the drop down list showed entries in this format as well (e.g. "mgmt-sw-01 (A12345)") however I appreciate that while Asset Tag is helpful to me, others may prefer a different field so this could perhaps be open to more discussion. I am not proposing any changes to the existing functionality of these forms, just what and how information is displayed. <!-- Convey an example use case for your proposed feature. Write from the perspective of a NetBox user who would benefit from the proposed functionality and describe how. ---> ### Use Case When connecting interfaces between devices, we have discovered that it is possible to search for interfaces/ports by typing the label in to the name box and devices by typing the asset tag or serial number in to the device field. This is beneficial as my users who are typically tasked with connecting devices and recording the connections in NetBox are often more used to dealing with the physical rather than the logical side of devices and therefore typically see ports as the names stamped on them and devices by the prominently displayed asset tag rather than the names given to them in config. <!-- Note any changes to the database schema necessary to support the new feature. For example, does the proposal require adding a new model or field? (Not all new features require database changes.) ---> ### Database Changes None <!-- List any new dependencies on external libraries or services that this new feature would introduce. For example, does the proposal require the installation of a new Python package? (Not all new features introduce new dependencies.) --> ### External Dependencies None
adam added the status: acceptedtype: feature labels 2025-12-29 18:33:12 +01:00
adam closed this issue 2025-12-29 18:33:12 +01:00
Author
Owner

@jeremystretch commented on GitHub (Sep 23, 2020):

We do something like this in a few places by including a property called display_name which contains some combination of an object's name and other attributes. For example, the display_name of an unnamed device will be its device type and primary key. It might make sense to take a more general approach to this, and simply include a standardized field (e.g. string or repr) with every object to readily convey how it should render in a dropdown list or similar invocation. This could just be the result of calling str() on the Python object.

@jeremystretch commented on GitHub (Sep 23, 2020): We do something like this in a few places by including a property called `display_name` which contains some combination of an object's name and other attributes. For example, the `display_name` of an unnamed device will be its device type and primary key. It might make sense to take a more general approach to this, and simply include a standardized field (e.g. `string` or `repr`) with _every_ object to readily convey how it should render in a dropdown list or similar invocation. This could just be the result of calling `str()` on the Python object.
Author
Owner

@stale[bot] commented on GitHub (Nov 7, 2020):

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. Please see our contributing guide.

@stale[bot] commented on GitHub (Nov 7, 2020): This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. Please see our [contributing guide](https://github.com/netbox-community/netbox/blob/develop/CONTRIBUTING.md).
Author
Owner

@jeremystretch commented on GitHub (Oct 19, 2021):

A standard display field was added for every model in v3.0, which now includes the label for device components which have it set. I believe this addresses the first part of the proposed change.

No further API changes should be required to implement the second part, so I'm tagging this as needs owner.

@jeremystretch commented on GitHub (Oct 19, 2021): A standard `display` field was added for every model in v3.0, which now includes the label for device components which have it set. I believe this addresses the first part of the proposed change. No further API changes should be required to implement the second part, so I'm tagging this as `needs owner`.
Author
Owner

@jeremystretch commented on GitHub (Nov 17, 2021):

In a similar vein, I'd like to propose the Device field is shown as "Device (Asset Tag)" and the drop down list showed entries in this format as well (e.g. "mgmt-sw-01 (A12345)")

This has been implemented for v3.1.

@jeremystretch commented on GitHub (Nov 17, 2021): > In a similar vein, I'd like to propose the Device field is shown as "Device (Asset Tag)" and the drop down list showed entries in this format as well (e.g. "mgmt-sw-01 (A12345)") This has been implemented for v3.1.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#4111