Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dashboard widgets #9416

Closed
jeremystretch opened this issue May 24, 2022 · 6 comments
Closed

Dashboard widgets #9416

jeremystretch opened this issue May 24, 2022 · 6 comments
Assignees
Labels
status: accepted This issue has been accepted for implementation type: feature Introduction of new functionality to the application
Milestone

Comments

@jeremystretch
Copy link
Member

NetBox version

v3.2.3

Feature type

New functionality

Proposed functionality

Allow customization of the NetBox dashboard (the default view) using content widgets that can be toggled and rearranged per the user's preferences. Some example widgets might include:

A widget would take the form of a Python class inheriting from some base class provided by NetBox, and would have its own rendering logic and HTML template (similar to a view). It might make sense to have different sizes of widget (e.g. small, medium, large) to enable some control over screen space utilization without getting too granular (perhaps by leveraging Bootstrap's 12-column layout).

Dashboard layout would be tracked as a per-user preference, and administrators can define a default layout.

Use case

The NetBox homepage currently lists only some statistics for hard-coded objects and the most recent entries from the change log. Moving to a customizable widget-based display affords users the opportunity to customize this view to include only the information most relevant to them.

Database changes

No response

External dependencies

No response

@jeremystretch jeremystretch added type: feature Introduction of new functionality to the application status: under review Further discussion is needed to determine this issue's scope and/or implementation labels May 24, 2022
@matejv
Copy link
Contributor

matejv commented Jun 1, 2022

It would be nice to have a way to "save" some list views with filters applied. For example I often found myself working on a set of devices, where I could filter a device list by some criteria. Getting back to that same filtered list is often more time consuming than it should be. (Yes I know multiple browser tabs and bookmarks exist, but... :)

I'm thinking if you could turn a list view into a widget (with one click) that had the same filters applied (essentially used the same URL) and it would show a count of matching objects with a link to that same view. Or even better, display a list of matching objects with perhaps action icons for each or something like that.

@jeremystretch jeremystretch added needs milestone Awaiting prioritization for inclusion with a future NetBox release and removed status: under review Further discussion is needed to determine this issue's scope and/or implementation labels Jun 28, 2022
@jeremystretch jeremystretch added status: accepted This issue has been accepted for implementation and removed needs milestone Awaiting prioritization for inclusion with a future NetBox release labels Jul 27, 2022
@jeremystretch jeremystretch added this to the v3.4 milestone Jul 27, 2022
@arthanson
Copy link
Collaborator

Possible suggestion: For re-arrangeable widgets: https://jsfiddle.net/xlaptop2001/of7syvwx/ uses gridstack (pure javascript) and compatible with bootstrap.

@jeremystretch jeremystretch self-assigned this Sep 27, 2022
@jeremystretch jeremystretch removed their assignment Oct 19, 2022
@jeremystretch
Copy link
Member Author

Unfortunately it doesn't look like we'll be able to squeeze this into v3.4, but hopefully we can tackle it in v3.5.

@jeremystretch jeremystretch removed this from the v3.4 milestone Oct 27, 2022
@jeremystretch jeremystretch added needs milestone Awaiting prioritization for inclusion with a future NetBox release and removed status: accepted This issue has been accepted for implementation labels Oct 27, 2022
@jeremystretch jeremystretch added status: accepted This issue has been accepted for implementation and removed needs milestone Awaiting prioritization for inclusion with a future NetBox release labels Jan 5, 2023
@jeremystretch jeremystretch added this to the v3.5 milestone Jan 5, 2023
@jeremystretch jeremystretch self-assigned this Jan 13, 2023
@jeremystretch
Copy link
Member Author

Mostly there. Still have some cleanup to do and more widgets to add.

Screen recording of dashboard widgets prototype

jeremystretch added a commit that referenced this issue Feb 24, 2023
* Replace masonry with gridstack

* Initial work on dashboard widgets

* Implement function to save dashboard layout

* Define a default dashboard

* Clean up widgets

* Implement widget configuration views & forms

* Permit merging dict value with existing dict in user config

* Add widget deletion view

* Enable HTMX for widget configuration

* Implement view to add dashboard widgets

* ObjectCountsWidget: Identify models by app_label & name

* Add color customization to dashboard widgets

* Introduce Dashboard model to store user dashboard layout & config

* Clean up utility functions

* Remove hard-coded API URL

* Use fixed grid cell height

* Add modal close button

* Clean up dashboard views

* Rebuild JS
@julianstolp
Copy link

julianstolp commented Mar 31, 2023

Not sure if its my chrome browser, but the headlines look much different from your gif.
Are there some fonts missing? I like the look from your post much more. My screenshot is from https://beta-demo.netbox.dev/

image

Mostly there. Still have some cleanup to do and more widgets to add.

Screen recording of dashboard widgets prototype

@jeremystretch
Copy link
Member Author

They look the same to me. No substantial design changes have been made since I posted that GIF. It's likely your system is using different fonts, but I don't believe that's specific to the widgets.

Happy to consider any design changes, but please open a new issue for any proposals as this one was solely to track the feature implementation and has been closed.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 30, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: accepted This issue has been accepted for implementation type: feature Introduction of new functionality to the application
Projects
None yet
Development

No branches or pull requests

4 participants