Repository navigation
feat(admin-panel): dashboard with server statistics on the start page - #1246
Merged
Merged
Conversation
…t page The start page now shows card-styled statistics instead of only a welcome text: players online and capacity, running servers, accounts (new and banned), guilds and alliances, a chart of the players online in the last 24 hours, the server list with their load, and quick actions (global message and links). Administrators additionally see the castle siege state, system information and the available configuration updates. The online history is sampled every 5 minutes from the IServerProvider, because the PlayerCount metric is only observable in-process, while the admin panel can run in its own process in the distributed deployment. The global message form of the servers page was extracted into a component, so that the dashboard can reuse it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XowA25b3pgLghrNZSZRwTi
…ow screens Also don't show a separator before the runtime when the assembly has no informational version (local builds). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XowA25b3pgLghrNZSZRwTi
The in-memory repository provider creates repositories on first access, without synchronization. In the demo mode, the castle siege plugins of the game servers did that concurrently at startup, which failed with "An item with the same key has already been added" or corrupted the dictionary of the repositories, so that later lookups failed, e.g. the guild statistics of the dashboard. The repositories are now created under a lock, and the dictionary is a concurrent one, so that lookups are safe while a repository is added. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XowA25b3pgLghrNZSZRwTi
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.
What
The start page of the admin panel showed only a welcome text. It now shows a card-styled dashboard (only after login, as every page;
_Imports.razoralready applies[Authorize]):PropertyChanged.How
IPlayerContext.GetAccountStatisticsAsyncandIGuildServerContext.GetGuildStatisticsAsync(EF Core and in-memory) count on the database instead of loading the entities.OnlinePlayerHistoryis a hosted singleton which samples theIServerProvider. TheGameContextPlayerCountmeter was considered, but metrics are only observable in the process which records them; in the distributed deployment the admin panel runs in its own process, whileIServerProviderprovides the counts in both deployments. The history is kept in memory (starts over on restart). Sampling exceptions are logged, so they can't stop the host.GlobalMessageForm, so the dashboard reuses it instead of duplicating it.Resources.resx, with German and Simplified Chinese translations.Fix: thread-safe creation of in-memory repositories
Running the demo mode showed that
InMemoryRepositoryProvidercreates repositories on first access without synchronization. The castle siege plugins of the three demo game servers did that concurrently at startup (An item with the same key has already been added. Key: ...CastleSiegeGuildRegistration), which also corrupted the repository dictionary, so later lookups failed (the guild count of the dashboard showed "Not available", the castle siege card was missing). Repositories are now created under a lock, andBaseRepositoryProvider.Repositoriesis aConcurrentDictionary, so lookups are safe while one is added.InMemoryRepositoryProviderTestreproduces the failure without the fix. Only the in-memory persistence (demo mode, tests) registers repositories on demand; the EF Core providers register theirs during initialization.Testing
dotnet build src/MUnique.OpenMU.sln -p:ci=true: 0 errors.dotnet testwith-p:ci=true:MUnique.OpenMU.Web.Tests: 278 passed, including 15 new tests inDashboard/(statistics queries on the in-memory persistence, sampling window, chart geometry, server statistics, and a bUnit test that viewers don't see the administrator cards).MUnique.OpenMU.Tests: 1893 passed.MUnique.OpenMU.Persistence.Initialization.Tests: 643 passed, 7 skipped.LoggingConfigurationPageTests.DoesNotSaveInvalidJsonfailed once in a full run and passed on rerun; it is unrelated to this change.-demo -autostartand looked at the dashboard in a browser at desktop and phone width, including the chart after the second sample.Noticed, not changed here
CrywolfPlugInlogsCollection was modified; enumeration operation may not execute.at startup.🤖 Generated with Claude Code
https://claude.ai/code/session_01XowA25b3pgLghrNZSZRwTi