Repository navigation
Feature/admin panel - #54
Merged
Merged
Conversation
The game server serves /admin/: a sidebar layout behind the admin login (admin token as the Basic password or Bearer token, plus logins plugins add). The engine adds Overview, Routes and Plugins pages; plugins add theirs with ctx.admin.page(), with sub links and sub pages in the sidebar. http-monitoring becomes a page of the panel at /admin/monitoring/, its tabs in the sidebar and its htpasswd users logging in to the panel. /monitoring/ redirects there; standalone: true or an older core keeps the standalone page.
@mavonengine/auth registers an Accounts page in the admin panel, with Guests and Disabled sub pages: totals, search by name, email, username or id, a paged table of accounts with their logins, email, sessions and whether they are online, and buttons to disable, enable and log out. Its form posts are refused when the browser says they come from another site, and only redirect back to the plugin's own pages. The store's account list takes a search and a filter and returns the username, and gains stats(). Core's admin stylesheet moves into code, since game servers bundle the engine and a .css file read next to the module isn't there, and gains button, input, notice and pager helpers.
In development, while no SMTP server or transport is set up, the mail plugin runs MailDev 3 in the game server on local ports and sends mail into it. Its UI is proxied from /admin/mail/inbox/ behind the admin login and shown on a Mail page in the panel, dark by default. MailDev can't be mounted into Express (its web server is Fastify), so it is proxied, as its docs describe; WebSocket upgrades are turned away so live updates poll through the login. maildev is an optional peer dependency, never started in production or tests; without it mail goes to the log as before. devInbox: false turns it off. Core's admin stylesheet gains .adm-frame for embedded tools.
The http-monitoring page now has what mavonengine dashboard got with the queue and accounts: a Queue panel next to World on the Overview, graphing queued, processed and failed jobs with the queued and running jobs and the totals over the graph's window, and an Account column on the player tables, guests marked, with the account in the player details. A server without a queue keeps the two-column overview, and the column only shows when some player has an account. Panel headings wrap on narrow screens.
Fixes the jsonc/sort-keys lint error CI reported.
…rview The Overview gets a Runtime card with the engine, Three.js and Rapier versions (Rapier only when the server has a physics world), Node.js, the mode and the platform; a Server scene graph card with what the headless three.js scene holds by type, with meshes, triangles and lights; and a Physics card with the Rapier world's bodies by kind, sleeping ones, colliders, gravity and timestep. WorldInspector gains sceneGraph() and physics() for them. Rapier's version is read only once its WebAssembly module is there. The Engine stat card goes, as Runtime has it. The admin stylesheet gains .adm-values and .adm-sections, fits two stat cards in a row on a phone, and wraps long text in cards.
ClientPlugin gets onConnectError(error, ctx), called on every client plugin with the message and the HTTP status the server turned the client away with, before the NetworkManager's own onConnectError. An auth plugin can use it to forget a session the server no longer takes, so the next connection goes without it instead of failing the same way.
The dashboard is a page of the admin panel now, at /admin/monitoring/ behind the panel's login. The test checks that login with the htpasswd user, that /monitoring/ leads there and its data endpoints still answer, and that the page opens in the panel's layout with its tabs in the sidebar. MAVONENGINE_E2E_CHROME picks the browser, like in the auth e2e.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.