Skip to content

net/vnstat: dashboard widget#5336

Open
joeroback wants to merge 1 commit intoopnsense:masterfrom
joeroback:feat/vnstat/dashboard-widget
Open

net/vnstat: dashboard widget#5336
joeroback wants to merge 1 commit intoopnsense:masterfrom
joeroback:feat/vnstat/dashboard-widget

Conversation

@joeroback
Copy link
Copy Markdown

@joeroback joeroback commented Mar 20, 2026

Important notices
Before you submit a pull request, we ask you kindly to acknowledge the following:

If AI was used, please disclose:

  • Model used: claude code (Opus 4.6 (1M context))
  • Extent of AI involvement: claude wrote the basic layout and helped with some of the date/time calculations

Related issue
If this pull request relates to an issue, link it here: closes #5353


Describe the problem
Vnstat dashboard widget


Describe the proposed solution
Adds vnstat dashboard widget. Allows you to select interface, and period (hourly, daily, monthly, yearly)
It remembers the last selected interface/period
Preferences to select the update tick interval, defaulting to 5 minutes


@joeroback joeroback force-pushed the feat/vnstat/dashboard-widget branch 2 times, most recently from c73cb32 to b73a1c0 Compare March 22, 2026 03:39
@sopex
Copy link
Copy Markdown
Member

sopex commented Apr 13, 2026

I would suggest these to be next to each other :)
image
Also, under no circumstances should a scrollbar appear. Lock the possible sizes a bit.

@joeroback joeroback force-pushed the feat/vnstat/dashboard-widget branch from b73a1c0 to bda8564 Compare April 14, 2026 17:15
@joeroback
Copy link
Copy Markdown
Author

i am trying to figure how to do that. the sizeToContent seems like its just a suggested size and almost all existing widgets have scrollbars and don't resize automatically to content, with the exception of the interface statistics widget.

there is a lot of text in this widget, so if its squashed to 1 column, it looks weird, but its not obvious how to require 2+ columns.

i've added an option to show/hide the avg rate column, which should help ppl who want a smaller widget, but still 4 columns don't really render under one column. open to suggestions, but also prefer not over engineer this simple and helpful widget

@joeroback joeroback force-pushed the feat/vnstat/dashboard-widget branch from bda8564 to 50cc26c Compare April 15, 2026 02:49
@joeroback
Copy link
Copy Markdown
Author

ok i improved the height resizing, but still limited the sizeToContent to 1000px, which is more than all the other widgets currently, which seems to be 650px max. so scrollbar can appear in edges cases.

i also added another config option to exclude selected interfaces from the widget, with the defaults of enc0, pflog0, pfsync0. not sure if there is a better way to get the list of interfaces, currently i am getting them from the vnstat database vs the system interfaces. either choose has pros and cons

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

os-vnstat: add dashboard widget

2 participants