- Rust 94.1%
- JavaScript 5.7%
- Makefile 0.2%
|
All checks were successful
lab release / release (push) Successful in 14m34s
Reviewed-on: #17 |
||
|---|---|---|
| .forgejo/workflows | ||
| crates | ||
| tools | ||
| .gitignore | ||
| Makefile | ||
| README.md | ||
| rust-toolchain.toml | ||
hero_components
The Hero admin UI — one service-parameterized Dioxus SPA that administers
every Hero service. Reachable through hero_router at
/hero_components/admin/?service=<name>; it discovers services from the router
and calls each one same-origin, so there is no per-service UI code.
Layout (two crates)
| Crate | Path | Role |
|---|---|---|
hero_components_app |
crates/hero_components_app |
The Dioxus project. A lib (the reusable admin shell + components — shell, tabs, the proc/router views, diagnostics) plus a main.rs bundled binary (the ?service=<name> app). Built to wasm with dx. Marked [package.metadata.hero] service = false so lab doesn't try to run it as a native service. |
hero_components |
crates/hero_components |
The service. A hero_lifecycle admin server that runs dx build on the app, embeds app_dist/ via rust-embed, and serves it on the hero_components/admin.sock admin socket. Registered with hero_proc via service.toml. |
Both are isolated crates (each its own [workspace]): the app is wasm-only,
the server is native. There is no root workspace — build each independently.
Prerequisites
- Rust (see the
rust_toolchainskill). - Dioxus CLI:
cargo install dioxus-cli(dx0.7+). Required — the server'sbuild.rsrunsdx buildto produce the wasm bundle.
Build & run
Canonical (build + install + (re)start via hero_proc):
lab build hero_components --restart --install
Local dev without lab:
make build # dx build the app + release-build the server (embeds the wasm)
make install # copy to ~/hero/bin (+ ad-hoc re-sign on macOS)
The admin needs hero_proc (supervisor) and hero_router running. Then open
http://127.0.0.1:9988/hero_components/admin/?service=hero_proc (swap
?service= for any discovered service).
macOS note
After copying a freshly built binary, macOS may SIGKILL it for an invalid
ad-hoc signature. make install re-signs it; if you copy by hand, run
codesign --force --sign - ~/hero/bin/hero_components.