Set default color for device and rack roles #3712

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

Originally created by @jkldgoefgkljefogeg on GitHub (May 21, 2020).

Originally assigned to: @jeremystretch on GitHub.

Environment

  • Python version: python:3.7
  • NetBox version: 2.8.4

Proposed Functionality

when adding a device role, color is currently a mandatory field. I propose making this field optional and auto assign an unused color if none specified

Use Case

When there are many device roles, it is difficult to pick a unique color.

Database Changes

N/A

External Dependencies

N/A

Originally created by @jkldgoefgkljefogeg on GitHub (May 21, 2020). Originally assigned to: @jeremystretch on GitHub. <!-- NOTE: IF YOUR ISSUE DOES NOT FOLLOW THIS TEMPLATE, IT WILL BE CLOSED. This form is only for proposing specific new features or enhancements. If you have a general idea or question, please post to our mailing list instead of opening an issue: https://groups.google.com/forum/#!forum/netbox-discuss NOTE: Due to an excessive backlog of feature requests, we are not currently accepting any proposals which significantly extend NetBox's feature scope. Please describe the environment in which you are running NetBox. Be sure that you are running an unmodified instance of the latest stable release before submitting a bug report. --> ### Environment * Python version: python:3.7 * NetBox version: 2.8.4 <!-- Describe in detail the new functionality you are proposing. Include any specific changes to work flows, data models, or the user interface. --> ### Proposed Functionality when adding a device role, color is currently a mandatory field. I propose making this field optional and auto assign an unused color if none specified <!-- 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 there are many device roles, it is difficult to pick a unique color. <!-- 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 N/A <!-- 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 N/A
adam added the status: acceptedtype: feature labels 2025-12-29 18:30:44 +01:00
adam closed this issue 2025-12-29 18:30:44 +01:00
Author
Owner

@jeremystretch commented on GitHub (May 21, 2020):

The field must remain mandatory. What we can do is set a (non-configurable) default color, but NetBox will not assign colors randomly.

@jeremystretch commented on GitHub (May 21, 2020): The field must remain mandatory. What we can do is set a (non-configurable) default color, but NetBox will not assign colors randomly.
Author
Owner

@jkldgoefgkljefogeg commented on GitHub (May 21, 2020):

That works too.
Just curious what is the history with device role label/color, I suspect some don't know what this is useful for

@jkldgoefgkljefogeg commented on GitHub (May 21, 2020): That works too. Just curious what is the history with device role label/color, I suspect some don't know what this is useful for
Author
Owner

@czarnian commented on GitHub (May 22, 2020):

Default color sounds good. Making it configurable in UserPreferences would cease discussion about what color to use.

@czarnian commented on GitHub (May 22, 2020): Default color sounds good. Making it configurable in `UserPreferences` would cease discussion about what color to use.
Author
Owner

@jeremystretch commented on GitHub (May 22, 2020):

@czarnian we won't make it configurable, foremost because it would lead to a nondeterministic condition when creating a role via the REST API with an unspecified color.

@jeremystretch commented on GitHub (May 22, 2020): @czarnian we won't make it configurable, foremost because it would lead to a nondeterministic condition when creating a role via the REST API with an unspecified color.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#3712