Remember user preference to show/hide device type images in rack views #4159

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

Originally created by @hoalex on GitHub (Oct 2, 2020).

Originally assigned to: @thatmattlove on GitHub.

Environment

  • Python version: 3.6.8
  • NetBox version: 2.9.3

Proposed Functionality

It would be nice if the value of the "Show images" setting on a rack view could be persisted as a user preference (using the mechanism introduced in #3294).

Use Case

We are making use of device type front/rear images on most of our devices in Netbox. By default, Netbox will render these images in a rack view, except when the user toggles the "Show images" button.
However, this is only valid for the current view -- as soon as another rack view is opened, or the current page is refreshed, Netbox falls back to the default mode, i.e. showing images.

Some users may not see any use in the images, and prefer to always see the name and device type color instead. Having a dedicated user preference key for this setting would allow for this functionality.

Database Changes

none

External Dependencies

none

Originally created by @hoalex on GitHub (Oct 2, 2020). Originally assigned to: @thatmattlove 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: 3.6.8 * 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 It would be nice if the value of the "Show images" setting on a rack view could be persisted as a user preference (using the mechanism introduced in #3294). <!-- 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 We are making use of device type front/rear images on most of our devices in Netbox. By default, Netbox will render these images in a rack view, except when the user toggles the "Show images" button. However, this is only valid for the current view -- as soon as another rack view is opened, or the current page is refreshed, Netbox falls back to the default mode, i.e. showing images. Some users may not see any use in the images, and prefer to always see the name and device type color instead. Having a dedicated user preference key for this setting would allow for this functionality. <!-- 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 <!-- 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.) --> none ### External Dependencies none
adam added the status: acceptedtype: feature labels 2025-12-29 18:33:32 +01:00
adam closed this issue 2025-12-29 18:33:32 +01:00
Author
Owner

@jeremystretch commented on GitHub (Oct 2, 2020):

Reminder for whoever takes this on: Be sure to record the chosen preference name in docs/development/user-preferences.md.

@jeremystretch commented on GitHub (Oct 2, 2020): Reminder for whoever takes this on: Be sure to record the chosen preference name in `docs/development/user-preferences.md`.
Author
Owner

@stale[bot] commented on GitHub (Nov 16, 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 16, 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

@ogorov commented on GitHub (Nov 17, 2020):

I could try to solve this issue.

@ogorov commented on GitHub (Nov 17, 2020): I could try to solve this issue.
Author
Owner

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

@ogorov but will you? If you're willing to commit to the work, I'll assign this to you. Otherwise, I'm going to re-apply the "pending closure" label.

@jeremystretch commented on GitHub (Nov 17, 2020): @ogorov but _will_ you? If you're willing to commit to the work, I'll assign this to you. Otherwise, I'm going to re-apply the "pending closure" label.
Author
Owner

@ogorov commented on GitHub (Nov 17, 2020):

@jeremystretch yes, i'll try. I'll do it if my skills are enough.

@ogorov commented on GitHub (Nov 17, 2020): @jeremystretch yes, i'll try. I'll do it if my skills are enough.
Author
Owner

@proudbro commented on GitHub (May 7, 2021):

When it will be implemented? Really looking forward for it

@proudbro commented on GitHub (May 7, 2021): When it will be implemented? Really looking forward for it
Author
Owner

@thatmattlove commented on GitHub (Jul 7, 2021):

@hoalex, @proudbro, @jeremystretch:

This is now implemented in the feature branch, at least as originally phrased. However, I haven't closed this yet as I wanted to get some further input. In feature, the new behavior is that the state of the "Show Images"/"Hide Images" button is persisted locally. This means once you toggle the button so that the images are hidden (which would display "Show Images" in the button), this is remembered in the browser for all rack views until the browser's localStorage is cleared.

However, we could take this a step further and make this configurable via the user profile in addition to the current behavior. This would guarantee that the setting is always persisted for the user, regardless of browser. I don't think it would be a ton of work to implement this, but I didn't want to go forward with it if all the interested parties were happy with the new behavior as-is.

@thatmattlove commented on GitHub (Jul 7, 2021): @hoalex, @proudbro, @jeremystretch: This is now implemented in the `feature` branch, at least as originally phrased. However, I haven't closed this yet as I wanted to get some further input. In `feature`, the new behavior is that the state of the "Show Images"/"Hide Images" button is persisted _locally_. This means once you toggle the button so that the images are hidden (which would display "Show Images" in the button), this is remembered in the browser for all rack views until the browser's localStorage is cleared. However, we _could_ take this a step further and make this configurable via the user profile in addition to the current behavior. This would guarantee that the setting is _always_ persisted for the user, regardless of browser. I don't think it would be a ton of work to implement this, but I didn't want to go forward with it if all the interested parties were happy with the new behavior as-is.
Author
Owner

@jeremystretch commented on GitHub (Jul 7, 2021):

I think it's fine to keep this in local storage for now. We need to spend some time thinking about how best to scale the user preferences framework before we add any more to it.

@jeremystretch commented on GitHub (Jul 7, 2021): I think it's fine to keep this in local storage for now. We need to spend some time thinking about how best to scale the [user preferences framework](https://netbox.readthedocs.io/en/stable/development/user-preferences/) before we add any more to it.
Author
Owner

@thatmattlove commented on GitHub (Jul 7, 2021):

Agreed. I do have some thoughts there, and I think it will become more relevant as we move to an SPA model. For the time being, I think we can consider this issue closed as part of 3.0.

@thatmattlove commented on GitHub (Jul 7, 2021): Agreed. I do have some thoughts there, and I think it will become more relevant as we move to an SPA model. For the time being, I think we can consider this issue closed as part of 3.0.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#4159