Skip to main content

Module dashboard

Module dashboard 

Source
Expand description

Serve the embedded dashboard bundle (Dioxus/WASM — #97, epic #95).

The bundle under ../dashboard/ is a build artifact committed to the repo and regenerated by scripts/build-dashboard.sh. Committing it keeps the “one binary ships the UI” property — an ordinary cargo build needs no wasm toolchain — at the cost of a build artifact in git. CI reruns the build and diffs the tree, so a stale bundle fails the build rather than shipping.

Assets are looked up in a table generated by build.rs (see that file for why the list can’t be hardcoded). The page is served at / and its files under /assets/. It became the default at / in #191, briefly aliased at /v2 because the bundle’s own asset URLs were absolute /v2/...; #197 removed the vanilla-JS page it had been sharing the server with, and the version-suffixed paths went with it — there is only one dashboard now.

Constants§

CSP
Content-Security-Policy for the dashboard page.

Statics§

ASSETS
Every file in the committed dashboard bundle, as (url_path, content_type, bytes). Generated by build.rs.

Functions§

asset
GET /assets/{*path} — any other file in the bundle (JS glue, wasm, CSS, and the wasm-bindgen snippets/ tree).
index
GET / — the dashboard page.