feat: add the initial administration panel #156
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As Wasm Workers Server is evolving, we want to start adding an UI to start managing it. I'm really happy to open this PR as an initial version of that UI 😄. This admin panel is enabled via the
--enable-panel
flag and the UI looks like this:In the future, we will start adding more features to it.
Development
Currently, the UI is shipped as a crate (panel) and integrated in the main project. The client uses React, Clarity Core and Vite. To develop this UI you need to install NodeJS and NPM in your environment.
Cargo automatically builds the UI based from the build.rs file. If
npm
is not available, the build pipeline will success, although the panel won't be available. We designed this way to avoid breaking build pipelines that don't relate to the client whennode
/npm
is not available.Integration
To integrate the compiled admin panel into the project, I used the rust-embed project. It automatically picks the files in a folder, embed them in the binary and provide an API to get the file content. With this approach we keep the server as a single-binary that it's easier to distribute.
It closes #153