Feature request: let other packages register dashboard tiles

Open
#129 3 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
javascript
Domain
frontend

Research direction

Start with luci-static/resources/vantage/layout.js and view/vantage/overview.js to trace how built-in tiles are listed, normalized, and rendered. The issue proposes a registry or a configurable custom tile but leaves the design and scope open; first agree on which approach to pursue. Done means external tiles can be added and rendered without breaking existing layouts, or the agreed custom tile works as specified.

Written by the indexing model from the issue text.

Description

enhancement
What would you like to do?

Hi — thanks for Vantage. It's the first LuCI dashboard that actually feels
designed, and the health checks in particular save me a lot of clicking.

Context. I run it on a wired-only Airoha EPON ONT (ImmortalWrt snapshot,
LuCI 26.293, apk build), so there are no radios at all. Because layout.js has

var WIFI = { radios: true, talk: true, ssids: true };
...
available: function (id, wired) {
    return TILES.indexOf(id) >= 0 && !(wired && WIFI[id]);
}

the dashboard on a wired device is down to four tiles: hero, chart, clients,
sys. There is no way to add anything of my own — which is a shame, because the
four tiles that are left do their job well and I would happily build more.

The tile set is closed today.

  • luci-static/resources/vantage/layout.js:
    var TILES = ['hero','chart','radios','clients','sys','talk','ssids'];
  • view/vantage/overview.js → buildTiles() hardcodes the builder map and then
    renders layout.TILES.map(...).
  • layout.normalize() silently drops any id it does not know, so even a hacked-in
    tile would be discarded on the next layout pass.

Suggestion: a small registry.

Something like luci-static/resources/vantage/tiles.js:

'require baseclass';
return baseclass.extend({
    /* tile: { id, title, tier: {wide, mid, narrow}, minW: {...},
              wifiOnly: bool, build(view) -> Element,
              paint(model, state), destroy() } */
    register: function (tile) { ... },
    ids: function () { ... },
    get: function (id) { ... }
});

layout.js then reads tiles.ids() instead of the constant, keeping the built-ins
registered as defaults, and overview.js renders registry.get(id).build(view)
instead of a switch. normalize()'s existing "unknown id is dropped" behaviour
would degrade cleanly when a providing package is uninstalled.

What I'd put in it (all third-party packages, not core):

  1. smartdns / unbound — cache hit rate, upstream RTT, blocked-domain count.
  2. WireGuard — per-peer handshake age and transfer.
  3. SQM / CAKE — bufferbloat grade and per-class drops.
  4. LTE/5G backup modem — RSRP/RSRQ and band.
  5. A generic "custom" tile: the output of one shell/ucode command, refreshed on
    the poll interval.

If a full registry is too much for now, a single built-in custom tile
driven by a config custom section in /etc/config/vantage (title, icon, a
command or a small ucode view, refresh interval) would already be a big win and
would not disturb the layout code much.

I'm happy to test on LuCI 26.x (newer than the 24.10/25.12 you list) and to send
a PR for the registry if the direction sounds right to you.

Idea

No response

Area

Dashboard

Dominant language
JavaScript
Stars
776
Forks
83
Avg merge
2h 49m
Merged PRs (30d)
59

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from anothaDev/luci-theme-vantage

All issues in anothaDev/luci-theme-vantage

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.