Skip to content

luci-mod-dashboard: add live charts and a configurable layout - #9060

Merged
hnyman merged 2 commits into
openwrt:masterfrom
eamonxg:dashboard-customize
Sep 23, 2026
Merged

hnyman merged 2 commits into
openwrt:masterfrom
eamonxg:dashboard-customize

Conversation

@eamonxg

@eamonxg eamonxg commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

Pull request details

Description

This PR adds configurable dashboard cards and tabs, along with five-minute WAN traffic, CPU and memory history charts:

  • Status cards for CPU usage, memory, load average and uptime, alongside Internet, with a consistent title, value and supporting text.
  • Live WAN traffic and CPU/memory charts covering the last five minutes.
  • A Layout tab to choose which cards, charts and detail tabs are shown, and drag entries to reorder them. Preferences are saved in dashboard.layout.
  • Wireless client connection duration in the client table and wireless data usage chart tooltips.
  • Uplink IPv4 and IPv6 addresses on separate lines in the Internet card, plus the IPv6 address in the Internet tab.
  • CPU usage breakdown tooltips on the total and each core in Resources, with percentage-only progress bar labels. Plain text replaces <code> formatting for consistent data display in tab tables, and client/lease tables no longer rely on right-aligned columns or empty footer cells.

Chart names distinguish WAN traffic from Wireless client data usage and Wireless client distribution. The WAN chart shows transfer rates; wireless data usage shows the byte totals reported for each connected wireless client.

A small rpcd ucode plugin, luci.dashboard, samples /proc/stat, /proc/meminfo and /proc/net/dev every five seconds, even when the page is closed. It keeps 60 samples with the router's monotonic clock. The page fetches new samples and calculates rates from counter differences, preserving history across reloads and avoiding dependence on browser polling timing.

Includes declare their widgets, display order and defaults. Includes with no visible widgets are not polled, and browser polling pauses while the page is hidden. While Layout is open, polling updates only the cards and charts so it does not interrupt editing. All changes stay within luci-mod-dashboard.

Screenshot or video of changes

Bootstrap

Bootstrap

Bootstrap Dark

Bootstrap Dark

Bootstrap Mobile

Bootstrap Mobile

Bootstrap Mobile

Bootstrap Mobile

Footstrap

Footstrap

Material

Material

Layout configuration

Layout configuration

All components enabled

All components enabled


Tested on

Hardware: JDCloud RE-SS-01, qualcommax/ipq60xx
OpenWrt version: SNAPSHOT r0-b88dfb6, Linux 6.18.44
LuCI version: Master 26.261.50869~aef4a82, with this dashboard branch deployed
Web browser(s): Google Chrome 153.0.8010.48; Safari 27.0 (22625.1.29.11.27)

@eamonxg
eamonxg force-pushed the dashboard-customize branch from 69291d2 to 17e3a8c Compare September 21, 2026 12:35

@openwrt-ai openwrt-ai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 1 new commit.


Generated by Claude Code

Comment thread modules/luci-mod-dashboard/root/usr/share/rpcd/ucode/luci.dashboard
@eamonxg
eamonxg force-pushed the dashboard-customize branch from 17e3a8c to 40d0dd0 Compare September 22, 2026 01:23

@openwrt-ai openwrt-ai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 1 new commit; no new issues found.


Generated by Claude Code

@openwrt-ai openwrt-ai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 1 new commit.


Generated by Claude Code

@eamonxg
eamonxg force-pushed the dashboard-customize branch 2 times, most recently from 9d20aaf to 11b8cf2 Compare September 23, 2026 02:30

@openwrt-ai openwrt-ai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commit checks

  • 11b8cf2 "luci-mod-dashboard: show IP addresses for wireless clients" — the .dashboard-donut { margin-inline: 0 } Footstrap override is unrelated to the client IP column and unmentioned in the message; fold it into the first commit or give it its own.

Generated by Claude Code

Add configurable dashboard cards and tabs, along with five-minute
WAN traffic, CPU and memory history charts. This includes:

- status cards for CPU, memory, load and uptime next to Internet, all
  of one shape: a title, a value and one line of text;
- charts of the WAN traffic and of CPU and memory usage over the last
  five minutes;
- a Layout tab to choose which cards, charts and tabs are shown and in
  what order, kept in UCI as dashboard.layout;
- the time a wireless client has been connected, in the tooltips of
  the wireless client data usage chart and in the client table;
- the IPv4 and the IPv6 address of the uplink on the Internet card,
  one line each, and the IPv6 address in the Internet tab.

The samples behind the charts are taken on the router by a small rpcd
ucode plugin, luci.dashboard, every five seconds whether or not
somebody is looking, so the charts are full whenever the page is
opened. It keeps the raw counters of /proc/stat, /proc/meminfo and
/proc/net/dev with the router's monotonic clock in a ring of 60
samples. The page fetches what is new since its last poll and takes
the differences, so a reload or a hidden tab leaves no gap and the
rates do not depend on the browser's timing. One pass takes 2 to 3 ms
on a quad-core IPQ60xx, about 0.07% of one core, and the ring about
360 kB of memory.

Includes declare their widgets with a slot, an order and whether they
show by default. An include with nothing on the page is not polled,
and polling stops while the page is hidden. The layout form is a
form.Map of three DynamicLists in the last tab; while it is open the
poll redraws the cards and charts only. ui.DynamicList greys out a
choice only once it is picked and always offers a custom value, so the
form marks the values a list starts out with and drops the custom
entry. All of it stays within luci-mod-dashboard.

Name the charts WAN traffic, Wireless client distribution and
Wireless client data usage to make their scope clear.

Remove <code> formatting for consistent data display in tab tables,
and add CPU usage breakdown tooltips to the total and per-core rows.

Signed-off-by: Eamon Xiong <eamonxiong@gmail.com>
Add an IP Address column to the wireless client table so users can
identify devices alongside their traffic without checking DHCP leases.

Match known host addresses by the client MAC and show at most one IPv4
and one IPv6 address, taking the first of each from the host hints after
excluding IPv6 link-local addresses. Show a dash when no address is known
and allow long addresses to wrap on narrow screens.

Signed-off-by: Eamon Xiong <eamonxiong@gmail.com>
@eamonxg
eamonxg force-pushed the dashboard-customize branch from 11b8cf2 to 73a06f0 Compare September 23, 2026 06:04
@eamonxg

eamonxg commented Sep 23, 2026

Copy link
Copy Markdown
Contributor Author

Hi @hnyman, I think this PR should be ready to merge now. When you have a chance, could you take a look? Thanks!

@hnyman
hnyman merged commit f4f91ae into openwrt:master Sep 23, 2026
8 checks passed
@hnyman

hnyman commented Sep 23, 2026

Copy link
Copy Markdown
Contributor

Have you tested the new dashboard with 25.12?

@eamonxg

eamonxg commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor Author

Have you tested the new dashboard with 25.12?

Yes, I built firmware from the OpenWrt 25.12 branch today, flashed it, and tested the new dashboard. It’s been running for a while, and everything seems to be working fine so far.
dashboard-25 12

Tested with:

  • LuCI openwrt-25.12 branch: 26.263.44884~0834d09
  • OpenWrt 25.12-SNAPSHOT: r0-e73b5f9

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants