Expand description
The admin dashboard: its manifest, and baking a static copy of it.
The dashboard is embedded in the binary and served live for
every app, so the common case generates nothing. build writes the same
files out as a plain directory (index.html, app.js, app.css and a
manifest) for hosting it somewhere other than the API — a CDN, a bucket,
a different origin entirely. That copy is never read back by the server:
the running dashboard always describes the running app. Everything it needs
to know about the app — which resources exist, what to call them, which
fields to show, who may see what — is resolved here, at build time, and
written into apiplant-admin.json. The shipped JavaScript is the same for
every app.
Two things are kept firmly apart, and it matters:
[permissions]/ a function’spermissiondecide what the API allows. They are enforced by the server on every request.[admin]decides what an operator is shown. It is presentation, and this generator treats it as such — hiding a resource here does not protect it, and the manifest never carries anything a signed-in caller could not already read from the API.
Structs§
Constants§
- MANIFEST_
FILE - Name of the manifest file the dashboard fetches on load.
Functions§
- asset
- One file of the embedded dashboard, ready to serve or write out.
- build
- manifest_
json - The manifest for an app already loaded by the server, as JSON.