Label unnamed devices uniquely in drop-down lists #2166

Closed
opened 2025-12-29 17:22:56 +01:00 by adam · 5 comments
Owner

Originally created by @candlerb on GitHub (Nov 30, 2018).

Environment

  • Python version: 3.5.2
  • NetBox version: 2.4.8

Proposed Functionality

When you have unnamed devices in drop-down lists, Netbox shows the model number (#604). This is fine until there is more than one; you can't distinguish them.

At this point you've normally already selected the site and rack, so it would only be necessary to display the rack position in addition to the model to make them distinguishable. For unracked devices, you can show the device ID instead.

Use Case

You have two PDUs in a rack. You don't want to go to the trouble of naming them - because if you do, the names have to be globally unique, which means you have to use tedious names like "site1-408-pdu-a" and "site1-408-pdu-b"

But if you don't name them, then when selecting from a drop-down (e.g. to connect a power port) you only see:

  • VendorPDU
  • VendorPDU

and there's no way to know which one to select. I would like to see:

  • VendorPDU (U47)
  • VendorPDU (U48)

If they are unracked, then show the raw ID:

  • VendorPDU (34)
  • VendorPDU (97)

Database Changes

None

External Dependencies

None

Implementation options

It's open to debate whether display_name should always show the rack position/ID, or a new function is required. In the rack layout display it would be superfluous to show the rack position; but there are other places this would be useful, e.g.

  • in the "Unracked devices" panel of /dcim/racks/X/
  • in the top-level /dcim/devices/ list (which shows only "Unnamed device", and doesn't display rack position)

In both those cases though, if you hover you can see the device ID in the target URL.

Originally created by @candlerb on GitHub (Nov 30, 2018). ### Environment * Python version: 3.5.2 * NetBox version: 2.4.8 ### Proposed Functionality When you have unnamed devices in drop-down lists, Netbox shows the model number (#604). This is fine until there is more than one; you can't distinguish them. At this point you've normally already selected the site and rack, so it would only be necessary to display the rack position in addition to the model to make them distinguishable. For unracked devices, you can show the device ID instead. ### Use Case You have two PDUs in a rack. You don't want to go to the trouble of naming them - because if you do, the names have to be globally unique, which means you have to use tedious names like "site1-408-pdu-a" and "site1-408-pdu-b" But if you don't name them, then when selecting from a drop-down (e.g. to connect a power port) you only see: * VendorPDU * VendorPDU and there's no way to know which one to select. I would like to see: * VendorPDU (U47) * VendorPDU (U48) If they are unracked, then show the raw ID: * VendorPDU (34) * VendorPDU (97) ### Database Changes None ### External Dependencies None ### Implementation options It's open to debate whether `display_name` should always show the rack position/ID, or a new function is required. In the rack layout display it would be superfluous to show the rack position; but there are other places this would be useful, e.g. * in the "Unracked devices" panel of `/dcim/racks/X/` * in the top-level `/dcim/devices/` list (which shows only "Unnamed device", and doesn't display rack position) In both those cases though, if you hover you can see the device ID in the target URL.
adam added the type: feature label 2025-12-29 17:22:56 +01:00
adam closed this issue 2025-12-29 17:22:56 +01:00
Author
Owner

@tb-killa commented on GitHub (Jan 27, 2019):

I think what could also help is some kind of hover information (popup) that displays additional information.

Since a device is usually bound to a site, this information should be included, e.g. SITE:A>RAWID.

@tb-killa commented on GitHub (Jan 27, 2019): I think what could also help is some kind of hover information (popup) that displays additional information. Since a device is usually bound to a site, this information should be included, e.g. SITE:A>RAWID.
Author
Owner

@candlerb commented on GitHub (Jan 30, 2019):

This PR is specifically about drop-down lists. Can you do hover tooltips in a drop-down list? Is it widely supported in browsers?

@candlerb commented on GitHub (Jan 30, 2019): This PR is specifically about drop-down lists. Can you do hover tooltips in a drop-down list? Is it widely supported in browsers?
Author
Owner

@tb-killa commented on GitHub (Jan 30, 2019):

@candlerb I will check but i´m shure that bootstrap allow this. Will do simple Test with the new Select2 Implementation. For ToolTip themselve this need some rework to get the needing Informations too.

For First i think the Named Situation like "SITE:$SiteName>$RAWID" would be great.

@tb-killa commented on GitHub (Jan 30, 2019): @candlerb I will check but i´m shure that bootstrap allow this. Will do simple Test with the new Select2 Implementation. For ToolTip themselve this need some rework to get the needing Informations too. For First i think the Named Situation like "SITE:$SiteName>$RAWID" would be great.
Author
Owner

@jeremystretch commented on GitHub (Jul 24, 2020):

This almost certainly ties in with other work needed around the APISelect form widget, but I don't think we've formally captured that in an issue yet.

@jeremystretch commented on GitHub (Jul 24, 2020): This almost certainly ties in with other work needed around the APISelect form widget, but I don't think we've formally captured that in an issue yet.
Author
Owner

@jeremystretch commented on GitHub (Aug 14, 2020):

I believe this is addressed by 66c91484 in develop-2.9. There is no mechanism for conveying the assigned rack unit (because that's not always going to be contextually relevant) but each device is guaranteed to be uniquely identified.

Given the recent work in #4982, it may be possible in the future to specify a templatized representation of objects in an API-backed dropdown widget, though that would need to be a new feature request and probably isn't going to be a high priority.

@jeremystretch commented on GitHub (Aug 14, 2020): I believe this is addressed by 66c91484 in `develop-2.9`. There is no mechanism for conveying the assigned rack unit (because that's not always going to be contextually relevant) but each device is guaranteed to be uniquely identified. Given the recent work in #4982, it may be possible in the future to specify a templatized representation of objects in an API-backed dropdown widget, though that would need to be a new feature request and probably isn't going to be a high priority.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#2166