Presentation Dashboard¶
Host developer dashboard pages as a modular shell with pluggable RazorSlice pages, grouped navigation, and live-updating dashboard cards.
- Existing app
- Dashboard recipe
- Presentation Dashboard
- Overview
- Challenges
- Solution
- Key Features
- Architecture
- Use Cases
- Basic Usage
- Core contracts
- Architecture details
- Getting started
- Browser state
- Built-in pages
- Adding project-specific dashboard pages
- Dashboard index cards
- Sidebar grouping
- Refresh strategy
- External plugin assemblies
- Troubleshooting
- Appendix A: minimal plugin
- Consistent page controls
Overview¶
The Dashboard feature provides a server-rendered developer dashboard under a configurable route, by default /_bdk/dashboard. The shell owns the layout, sidebar, grouping, card index, and common styling. Feature packages and application projects contribute their own pages through small plugin contracts.
Dashboard pages are Minimal API endpoints that render RazorSlices. Pages can also publish navigation metadata and an optional compact card for the dashboard index page. Cards are refreshed in-place by a dashboard HTML fragment endpoint, so the index can show current plugin state without reloading the full shell.
Challenges¶
- Extensibility: Let bITdevKit packages and application projects add dashboard pages without editing the dashboard shell.
- Navigation: Keep the sidebar aware of plugged-in pages and group pages by feature area.
- Server rendering: Render pages directly from in-process services instead of routing through HTTP JSON APIs.
- Live overview: Let plugin cards update on the dashboard index without a full page reload.
- External assemblies: Support dashboard plugins that live outside
Presentation.Web.
Solution¶
- Shell:
AddDashboard(...)registers the dashboard shell and discovers dashboard plugins. - Endpoints:
IDashboardEndpointsmarks endpoint classes that map dashboard routes. - Pages: RazorSlice pages render dashboard content using normal Razor syntax and optional layout models.
- Navigation and cards:
IDashboardPageProvidercontributes sidebar items and optional dashboard index cards. - Page sets:
DashboardPageSetlets modules define multiple pages, content fragments, page-local actions, navigation, and cards from one builder. - Helpers:
MapDashboardPage(...),DashboardPath.Combine(...), andResults.Extensions.DashboardRazorSlice(...)simplify plugin page mapping.
Key Features¶
- server-rendered dashboard shell with grouped sidebar navigation
- automatic discovery of built-in and application-owned page plugins
- page-set API for pages, fragments, cards, badges, and local actions
- configurable automatic, anonymous, existing-scheme, cookie, or OIDC authorization
- in-process health, metrics, identity, storage, jobs, messaging, and other feature pages
- fragment refresh without full-page reloads
- stable page keys for selectively hiding navigation and cards
- Several colour palettes shared by the shell, controls, dialogs, and charts
The selected palette supplies separate page, card, header, and filter surfaces. Accent fills and edges identify active navigation and tabs. Navigation icons use a separate palette colour from their text. Overview cards use consistent feature accents, while summary cards use status colours for positive counts and keep zero problem counts neutral. Comparison and analysis actions use a separate accent from primary actions. Profiling groups, kind labels, execution details, and timeline lanes share a stable colour assignment; timeline boxes and runtime markers also follow the palette. Text tones are adjusted for contrast, and monochrome palettes remain monochrome.
Architecture¶
AddDashboard(...) registers the shell and discovers dashboard endpoint and page-provider contracts. app.MapEndpoints() maps the shell and plugin routes. Page providers supply navigation and card metadata, while RazorSlice pages render full pages or HTML fragments directly from in-process services.
Use Cases¶
- inspect application health, metrics, logs, jobs, and storage from one local operations UI
- add a module-specific diagnostics or management page
- expose lightweight live cards without building a separate SPA
- package dashboard pages with a reusable feature assembly
- reuse host authentication or configure a dashboard-specific interactive OIDC flow
Basic Usage¶
Register the dashboard shell, build the application, and map the shared endpoint pipeline:
using BridgingIT.DevKit.Presentation.Web.Dashboard;
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddDashboard(options => options
.WithGroupPath("/_bdk/dashboard"));
var app = builder.Build();
app.MapEndpoints();
app.Run();
GET /_bdk/dashboard renders the dashboard index. The default Auto authorization mode allows anonymous access only when the host has no authentication schemes; when schemes exist, dashboard routes require authorization. Configure an explicit authorization mode for production hosts.
Core contracts¶
DashboardEndpointsOptions(src/Presentation.Web/Dashboard/DashboardEndpointsOptions.cs)Enabled: Enables or disables the dashboard.GroupPath: Base dashboard path. Defaults to/_bdk/dashboard.GroupTag: Endpoint group tag.AuthorizationMode: Controls dashboard authorization behavior. Defaults toAuto.RequireRoles,RequirePolicy,RequireAuthenticationSchemes: Inherited endpoint authorization requirements that can be configured throughAuthorize(...).SignOutAuthenticationSchemes: Authentication schemes used by the dashboard sign-out route. If empty, sign-out uses the dashboard authentication schemes.DisabledPageKeys: Stable page keys hidden from sidebar navigation and dashboard index cards.PluginAssemblies: Additional assemblies to scan for dashboard plugins.DashboardAuthorizationOptionsBuilder(src/Presentation.Web/Dashboard/DashboardEndpointsOptionsBuilder.cs)UseCookie(...): Reuses an existing host cookie scheme for dashboard access.UseExistingScheme(...): Reuses another host-owned authentication scheme.UseOpenIdConnect(authority, ...): Registers dashboard-owned cookie and OIDC schemes with dashboard conventions.UseOpenIdConnect(Action<OpenIdConnectOptions>, ...): Registers dashboard-owned cookie and OIDC schemes with raw ASP.NET Core handler configuration.DashboardOpenIdConnectOptionsBuilder(src/Presentation.Web/Dashboard/DashboardEndpointsOptionsBuilder.cs)WithClientId(...): Overrides the default dashboard client id.WithMetadataAddress(...): Overrides the default discovery document address.RequireHttpsMetadata(...): Controls whether OIDC metadata must be loaded over HTTPS.RequireSignedTokens(): Enables signed-token and issuer-signing-key validation.Configure(...): Applies low-levelOpenIdConnectOptionscustomization after dashboard conventions.DashboardAuthenticationDefaults(src/Presentation.Web/Dashboard/DashboardAuthenticationDefaults.cs)- Provides the dashboard-owned authentication scheme names and the default OIDC client id
dashboard. IDashboardEndpoints(src/Presentation.Web/Dashboard/IDashboardEndpoints.cs)- Marker contract for dashboard-specific endpoint sets.
- Extends the regular presentation
IEndpointscontract. IDashboardPageProvider(src/Presentation.Web/Dashboard/IDashboardPageProvider.cs)- Provides
DashboardPagedescriptors for sidebar navigation and optional index cards. DashboardPageSet(src/Presentation.Web/Dashboard/DashboardPageSet.cs)- Recommended base for module dashboards that own one or more pages.
- Implements endpoint mapping and page metadata from a single
DashboardPageSetBuilderdeclaration. DashboardPage(src/Presentation.Web/Dashboard/DashboardPage.cs)- Defines title, icon, URL, group, ordering, sidebar visibility, optional badge, and optional card provider.
DashboardPageCard(src/Presentation.Web/Dashboard/DashboardPage.cs)- Defines compact card content for the dashboard index.
- Route helpers (src/Presentation.Web/Dashboard/DashboardRouteBuilderExtensions.cs)
MapDashboardPage<TPage>(...): Maps a typed RazorSlice page.MapDashboardPage(..., razorIdentifier, assembly, ...): Maps a compiled RazorSlice by identifier from a plugin assembly.- Path helper (src/Presentation.Web/Dashboard/DashboardPath.cs)
DashboardPath.Combine(...): Combines route segments with one slash.
Architecture details¶
Class diagram¶
classDiagram
class DashboardEndpointsOptions {
+string GroupPath
+List~Assembly~ PluginAssemblies
}
class IDashboardEndpoints {
+Map(IEndpointRouteBuilder)
}
class IDashboardPageProvider {
+GetPages(HttpContext)
}
class DashboardPage {
+string Title
+string Icon
+string Url
+string Group
+bool ShowInSidebar
+bool ShowOnIndex
+Func Badge
+Func Card
}
class DashboardPageCard {
+string Title
+string Subtitle
+string Value
+string Detail
+string Url
}
class DashboardShell
class DashboardPlugin
IDashboardEndpoints <|.. DashboardPlugin
IDashboardPageProvider <|.. DashboardPlugin
DashboardPlugin ..> DashboardPage
DashboardPage ..> DashboardPageCard
DashboardShell ..> IDashboardEndpoints : maps
DashboardShell ..> IDashboardPageProvider : navigation/cards
DashboardShell ..> DashboardEndpointsOptions
Registration and render sequence¶
sequenceDiagram
participant Startup as Program.cs
participant DI as IServiceCollection
participant App as WebApplication
participant Shell as Dashboard shell
participant Plugin as Dashboard plugin
participant Browser as Browser
Startup->>DI: AddDashboard(options)
DI->>DI: Scan dashboard plugin assemblies
DI->>DI: Register IDashboardEndpoints
DI->>DI: Register IDashboardPageProvider
Startup->>App: app.MapEndpoints()
App->>Plugin: Map dashboard plugin routes
Browser->>Shell: GET /_bdk/dashboard
Shell->>Plugin: GetPages(HttpContext)
Plugin-->>Shell: DashboardPage + card providers
Shell-->>Browser: dashboard shell + cards
Browser->>Shell: GET /_bdk/dashboard/content
Shell->>Plugin: refresh card providers
Shell-->>Browser: card HTML fragment
Getting started¶
Register the dashboard¶
Register the dashboard during service configuration.
builder.Services.AddDashboard(options =>
{
options.WithGroupPath("/_bdk/dashboard");
});
Hide auto-discovered feature pages by stable page key when a host wants to keep the feature registered but remove its dashboard navigation and index card:
builder.Services.AddDashboard(options => options
.DisablePages("metrics", "storage.documents"));
The final argument may be a boolean switch, which is useful for environment-specific setup:
builder.Services.AddDashboard(options => options
.DisablePages("metrics", "storage.documents", !builder.Environment.IsDevelopment()));
Built-in page keys:
| Page | Key | Guide | Screenshot |
|---|---|---|---|
| Overview | dashboard.overview |
Overview | Overview |
| System | dashboard.system |
System | System |
| Health | health |
Health | Health |
| Metrics | metrics |
Metrics | Metrics |
| Profiling | profiling |
Profiling | Runtime, Operations, Requests |
| Identity | identity |
Authentication | Identity |
| Console | console |
Console commands | Console |
| MCP | mcp |
MCP (opened from the robot icon in the header) | MCP |
| Logs | logging.logs |
Log Entries | Logs |
| Errors | logging.errors |
Log Entries | Errors |
| Logs Stream | logging.stream |
Log Entries | Logs Stream |
| Jobs | jobs |
Jobs | Jobs |
| Messaging | messaging |
Messaging | Messaging |
| Queueing | queueing |
Queueing | Queueing |
| Broadcasting | broadcasting |
Broadcasting | Broadcasting |
| Orchestrations | orchestrations |
Orchestrations | Orchestrations |
| Files | storage.files |
File Storage | Files |
| Documents | storage.documents |
Document Storage | Documents |
| Blobs | storage.blobs |
Blob Storage | Blobs |
| Permalinks | storage.permalinks |
Storage Permalinks | Permalinks |
| Change History | change-history |
Change History | Unconfigured state |
| Entities | entities |
Entities dashboard | – |
Project-specific pages declared with DashboardPageSet use the key passed to .Page(...). For example, a page declared as .Page("customer-management", "/app/core/customers") can be hidden with:
builder.Services.AddDashboard(options => options
.DisablePages("customer-management"));
Map registered endpoints once during application startup.
var app = builder.Build();
app.MapEndpoints();
The dashboard uses the existing endpoint registration pipeline. AddDashboard(...) registers dashboard endpoint classes with AddEndpoints(...); app.MapEndpoints() maps them.
Authentication and authorization¶
Dashboard routes use the same endpoint authorization pipeline as other bITdevKit endpoints. By default, the dashboard runs in Auto authorization mode:
- if the application has no authentication schemes registered, the dashboard remains anonymous
- if the application has authentication schemes registered, dashboard routes require authorization
Use Authorize(...) to require a dashboard role, policy, or authentication mode. This keeps the dashboard generic: a host application can reuse an existing cookie login, let the dashboard register its own OIDC flow, or explicitly reference another ASP.NET Core authentication scheme.
builder.Services.AddDashboard(options => options
.Enabled(true)
.Authorize(authorization => authorization
.Auto()
.RequireRole(Role.Administrators)));
Use RequireAuthenticated() when the dashboard must always require authentication after registration, even if the application has not configured authentication yet.
builder.Services.AddDashboard(options => options
.Authorize(authorization => authorization.RequireAuthenticated()));
Use AllowAnonymous() only for hosts that intentionally expose the dashboard without authentication.
builder.Services.AddDashboard(options => options.AllowAnonymous());
If the host application already has an interactive cookie login, reuse that cookie scheme. This is common when the Web API is hosted together with a Blazor, Angular, or other SPA shell.
builder.Services.AddDashboard(options => options
.Authorize(authorization => authorization
.UseCookie("ApplicationCookie", signOut: true) // use an existing cookie scheme by name
// .UseCookie(CookieAuthenticationDefaults.AuthenticationScheme, signOut: true) // use default asp.net cookie scheme
//.UseCookie(signOut: true) // use default asp.net cookie scheme
.RequireRole(Role.Administrators)));
When a reused cookie principal is authenticated but misses the required dashboard role or policy, the dashboard handles the forbid result for dashboard paths and redirects to the built-in dashboard access-denied page. Other application routes continue to use the host application's normal authorization behavior.
For server-rendered dashboards that should trigger an interactive login but the host API only has JWT bearer authentication, let the dashboard register its own cookie, OIDC, and policy schemes. The dashboard does not perform client-credentials login for page access; browser access uses an interactive authorization-code flow. The default dashboard client id is dashboard.
builder.Services.AddDashboard(options => options
.Authorize(authorization => authorization
.UseOpenIdConnect("https://idp.example")
.RequireRole(Role.Administrators)));
The fluent OIDC overload sets these values by convention:
- metadata address:
{authority}/.well-known/openid-configuration - client id:
dashboard - response type: authorization code
- callback path:
/_bdk/dashboard/signin-oidc - sign-out callback path:
/_bdk/dashboard/signout-callback-oidc - scopes:
openid,profile,email,roles - issuer validation, audience validation, lifetime validation, and dashboard role claim mapping
Token signature checks are relaxed by default so development and lightweight identity providers can be used without extra setup. Use RequireSignedTokens() when the dashboard should require signed tokens and issuer signing key validation.
Register the dashboard as an OIDC client at the identity provider. With the default dashboard path and client id, the redirect URI is:
https://localhost:5001/_bdk/dashboard/signin-oidc
Use WithClientId(...) when the identity provider uses a client id other than dashboard.
builder.Services.AddDashboard(options => options
.Authorize(authorization => authorization
.UseOpenIdConnect(
"https://idp.example",
oidc => oidc.WithClientId("operations-dashboard"))
.RequireRole(Role.Administrators)));
For providers where the dashboard should require signed tokens and issuer signing key validation, opt in explicitly.
builder.Services.AddDashboard(options => options
.Authorize(authorization => authorization
.UseOpenIdConnect(
"https://idp.example",
oidc => oidc.RequireSignedTokens())
.RequireRole(Role.Administrators)));
For HTTP-only local identity providers, disable the metadata HTTPS requirement.
builder.Services.AddDashboard(options => options
.Authorize(authorization => authorization
.UseOpenIdConnect(
"http://localhost:8080",
oidc => oidc.RequireHttpsMetadata(false))
.RequireRole(Role.Administrators)));
Use the raw OpenIdConnectOptions overload when a provider needs handler-specific settings that are not covered by the dashboard fluent builder.
builder.Services.AddDashboard(options => options
.Authorize(authorization => authorization
.UseOpenIdConnect(oidc =>
{
oidc.Authority = "https://idp.example";
oidc.ClientId = "dashboard";
oidc.ResponseMode = "form_post";
})
.RequireRole(Role.Administrators)));
Use UseExistingScheme(...) for advanced host-owned schemes that are not cookies.
builder.Services.AddDashboard(options => options
.Authorize(authorization => authorization
.UseExistingScheme("MyScheme", signOut: false)
.RequirePolicy("DashboardAccess")));
When the dashboard registers its own OIDC flow, it automatically uses the built-in access-denied page and sign-out route. When the current dashboard principal is authenticated, the dashboard shell shows a sign-out action in the header. The action posts to the built-in dashboard sign-out route and redirects back to the current dashboard URL, which triggers the configured authentication challenge again. Configure .SignOutAuthenticationScheme(...) manually only when using a custom scheme that needs separate sign-out behavior.
Include plugin assemblies¶
The dashboard scans the core dashboard assembly, explicitly configured plugin assemblies, and currently loaded assemblies containing dashboard contracts. For application plugins, prefer explicit registration so discovery does not depend on load order.
builder.Services.AddDashboard(options =>
{
options.WithPluginAssemblyContaining<CatalogDashboardEndpoints>();
});
For multiple assemblies:
builder.Services.AddDashboard(options =>
{
options.WithPluginAssemblies(
typeof(CatalogDashboardEndpoints).Assembly,
typeof(ReportingDashboardEndpoints).Assembly);
});
Built-in routes¶
The dashboard shell uses fixed built-in routes below the configured GroupPath. Plugin pages own and map their own route segments; the shell does not maintain a central list of plugin paths.
| Path | Default |
|---|---|
| Dashboard index | /_bdk/dashboard |
| Dashboard index content fragment | /_bdk/dashboard/content |
| Dashboard access denied | /_bdk/dashboard/access-denied |
| Dashboard sign-out | POST /_bdk/dashboard/signout |
| Health page | /_bdk/dashboard/health |
| Health content fragment | /_bdk/dashboard/health/content |
| Metrics page | /_bdk/dashboard/metrics |
| Metrics content fragment | /_bdk/dashboard/metrics/content |
| Identity page | /_bdk/dashboard/identity |
| Identity client credentials login | /_bdk/dashboard/identity/client-credentials/login |
| File storage explorer | /_bdk/dashboard/storage/files |
| Document storage explorer | /_bdk/dashboard/storage/documents |
| Blob storage explorer | /_bdk/dashboard/storage/blobs |
Browser state¶
Dashboard pages use window.bdkDashboard.state to save UI preferences. The shared helper is available before page scripts run. It preserves existing storage keys and formats and falls back to document-local memory when browser storage is unavailable or full.
| API | Behavior |
|---|---|
get(key, fallback = null, validate?) |
Reads a string; returns the fallback when missing or rejected by the validator. |
set(key, value) / remove(key) |
Writes a string or removes the preference. |
getJson(key, fallback = null, validate?) |
Reads JSON; returns the fallback for missing, malformed or rejected values. |
setJson(key, value) |
Serializes and saves a JSON value. |
session |
Provides the same read/write methods using session storage for tab-local state. |
key(feature, preference, route = '') |
Builds a key containing the feature, preference, configured dashboard root and optional view route. |
reset() |
Clears dashboard preferences from local and session storage; returns whether both stores were cleared. Suppresses further writes in this document after success. |
Use the helper for page preferences instead of accessing browser storage directly. Keep query parameters for shareable selections and prefer existing helpers such as createRefresher and DashboardPage.RememberedViews for their specific controls.
const state = window.bdkDashboard.state;
const key = state.key('orders', 'columns', '/recent');
const columns = state.getJson(key, ['number', 'status'], value =>
Array.isArray(value) && value.every(column => ['number', 'status', 'total'].includes(column)));
state.setJson(key, columns);
The header's Reset dashboard state button asks for confirmation, clears saved dashboard preferences and returns to the configured dashboard home without the current query parameters. Reset includes theme, texture, sidebar groups, remembered views, page sizes, saved filters and column choices, storage search history, refresh intervals and session list restoration. It applies to dashboards on the same browser origin, including legacy keys. Other application storage, authentication and server data remain intact. The legacy theme and sidebarCollapsed keys are shared with the general web layout, so resetting them also resets those shared preferences there.
Reset recognizes the existing dashboard key families (bdk.dashboard., bdk.profiling., bdk.documentStorage., bdk.blobStorage., bdk.storage.diagnostics., bdk:storage:throughput-test:), remembered-view keys (bdk.<page-key>.view:<path>) and the shell keys theme, dashboardTexture, sidebarCollapsed and dashboardSidebarGroups. Use state.key(...) for new preferences so reset includes them. If storage cannot be cleared completely, the dashboard displays an error and stays on the current page.
This browser helper serves RazorSlice dashboard pages. Blazor applications use the separate AppState services for typed state, notifications and undo/redo history.
Built-in pages¶
Dashboard index¶
The dashboard index shows cards contributed by dashboard page providers. It includes a refresh interval dropdown with fixed intervals:
Off1 sec5 sec15 sec30 sec
The selected interval is stored in localStorage. Refresh uses a recursive setTimeout loop and an AbortController, so refreshes do not overlap and an in-flight request is cancelled when the interval changes. The page pauses automatic refresh while the browser tab is hidden and refreshes once when the tab becomes visible again.
The index refresh endpoint returns only card HTML. It does not render the full dashboard layout.
Profiling adds Operations and Requests cards beside its Profiling status card. Each shows retained execution counts for the last 15 minutes, with matching group and node counts. Operations includes all execution kinds; Requests counts HTTP captures. Both include all recorded outcomes and open their named profiling view. These are retained observations, including any sampling, rather than total application traffic. The cards use the same overview refresh control.
The page index links each feature's dashboard guide and full-size screenshots. Those guides describe filters, detail dialogs, provider requirements and actions. Open a card to inspect that feature; use a correlation link in a detail dialog to continue into Logs.
Dashboard actions use compact, themed confirmation and message dialogs. Cancel, Close or Escape dismisses a confirmation without executing the action. A confirmation opened from a details dialog returns to those details when dismissed.
Quick date/time ranges¶
Logs, Errors, Change History, Operations and Requests offer a Quick range clock icon immediately before the From UTC input. Open its menu to choose a preset. Choose Last minute, Last 5 or 15 minutes, Last hour, Last 6 hours, Last day, Last week or Last 30 days. The control fills From UTC with the selected interval before now and clears To UTC. An empty end includes new records on refresh. From UTC remains fixed until you edit it or choose a preset again. The pickers show only hours and minutes, with seconds defaulting to 00; recorded timestamps and timings retain their precision. Select Apply to use the range. Day and week mean the previous 24 hours and 7 days, including across daylight-saving changes.
Comparison dialogs have a separate picker for each side; select Compare after choosing their ranges. An empty comparison end resolves to one shared current UTC instant when you select Compare. Saved profiling filters retain the fixed start and empty end when you return. To move the start forward, select the preset again.
System¶
System at /_bdk/dashboard/system shows process CPU, memory, traffic, thread-pool and GC observations. Overview keeps the current summaries, routes and database context. The Diagnostics tab shows four charts with the shared workload layout: process CPU and its five-sample mean; working set, private, managed and GC heap memory; started/completed/failed requests per second; and interval versus process-lifetime mean request latency. Server sampling retains up to fifteen minutes independently of browser visits. Rates use actual elapsed sampling time, and idle intervals leave latency gaps. Runtime and HTTP sources can be unavailable independently. Refresh manually or choose an interval to watch changes. These process snapshots complement Profiling; they do not attribute resource usage to one operation. The Process tab lists application, runtime, server and process details such as versions, OS, architecture and memory. The Environment tab shows environment checks, environment variables and the worktree instance when one applies.
The System overview illustration below predates moving the charts to Diagnostics.
Metrics¶
The metrics page is server-rendered and reads in-process snapshot services directly. It does not call the metrics JSON endpoints. The page has its own content fragment endpoint and refresh controls for updating only the metrics body.
Metrics remain optional. Registering the dashboard does not automatically register metrics; applications opt into metrics separately.
Profiling¶
Runtime, Operations, Requests, Timeline and Insights share the Profiling page. Insights ranks operations by completed p95 latency, accumulated completed time, frequency or root failure rate. It separates latency samples from other outcomes and opens segment bottlenecks, execution details and comparisons in dialogs. Rankings cover the complete bounded selection before applying the row limit. Timeline provides a moving kind-by-time overview with persisted 15-minute/30-minute/hour/12-hour/day/week/month windows, UTC date bounds, kind/key/node filters, count boxes for dense activity, and the existing execution details dialog. Operations and Requests can compare executions of the same operation under different UTC ranges, nodes, application versions or dimension values. A group action opens the comparison dialog with that operation selected; results and segment differences stay inside the dialog. See the Profiling dashboard guide for screenshots and the comparison workflow. Dimension controls discover recorded names and typed values, filter executions, and split operation groups by a dimension. Group counts, median and p95 use the retained selection. A recorded group's conditions can seed either side of the comparison dialog. Execution details also provide dimension actions; segment filters explicitly select their full path.
Health¶
The health page is server-rendered and invokes the registered ASP.NET Core health checks through HealthCheckService from Microsoft.Extensions.Diagnostics.HealthChecks. It does not call a /healthz endpoint.
The page shows the overall status, number of registered checks, unhealthy count, total duration, and individual check cards. It has its own content fragment endpoint and refresh controls for updating only the health body.
Register health checks in the host application with the standard ASP.NET Core API:
builder.Services.AddHealthChecks()
.AddCheck("self", () => HealthCheckResult.Healthy());
If AddHealthChecks() is not registered, the page and card show an unavailable state instead of failing the dashboard.
Inspect individual checks to distinguish a database-readiness issue from a background-service or provider failure. The page reports the registered checks; registering the dashboard does not add feature-specific checks by itself.
Identity¶
The identity page displays the current principal, roles, claims and saved authentication tokens. See the Identity dashboard guide for inspecting the signed-in user's authentication context.
Document Storage¶
The document storage page is contributed by Presentation.Web.Storage and is shown only when AddDocumentStorage(...) is active and at least one typed document client is registered. The page is server-rendered and uses the existing IDocumentStoreClient<T> instances for the selected document type.
The page lets operators switch between registered document clients on the fly, page through document keys with selectable page sizes of 25, 50, 100, 250, or 500 items remembered in browser storage, filter by partition and row key, reset filters, create a new document from keyed pasted or written JSON, download a document from the table, open exact documents in a details dialog, edit payload JSON with syntax validation, and delete one or more checked documents after a browser confirmation alert that includes the affected keys. New-document creation checks the selected client first and reports a conflict instead of overwriting an existing key. Paging, filtering, and reset actions clear row selections so stale checked rows are not reused. It does not expose a separate REST admin API; dashboard-local fragment and form-action routes serve the rendered page workflow.
Blob Storage¶
The blob storage page is contributed by Presentation.Web.Storage and is shown only when AddBlobStorage(...) is active and at least one named blob client is registered. The page is server-rendered and uses IBlobStoreClientFactory, so the dashboard stays provider-neutral across in-memory, Entity Framework Core, Azure Blob Storage, and decorated clients.
The page lets operators switch between registered blob clients, choose a container and optional prefix, list BlobInfo metadata with deterministic paging, explicitly approve full scans when the selected client allows them, upload a local file to the selected container and prefix, download an exact blob, and delete an exact blob. Listing renders metadata only and does not download content streams. The download action streams the selected blob and disposes the returned BlobDownload after the response is complete.
Entities¶
The entities page is contributed by Presentation.Web and is shown when at least one IGenericRepository<T> or ActiveEntity configuration for an IEntity type exists. It works like a rough table editor: search with FilterModel, load more rows, inspect details and, for principals that satisfy the configured edit policy or roles, create, update and delete entities in a modal dialog. Properties can be masked or hidden per entity. Hide it with DisablePages("entities"). See the Entities dashboard guide.
Adding project-specific dashboard pages¶
For new project or module pages, prefer DashboardPageSet. A page set lets one module declare all of its dashboard pages, content fragments, local action routes, sidebar metadata, and index cards in one class. The low-level IDashboardEndpoints and IDashboardPageProvider contracts remain available for advanced or unusual plugins.
Folder layout¶
Presentation.Web/
Modules/
Catalog/
Dashboard/
CatalogDashboard.cs
Pages/
Overview.cshtml
OverviewContent.cshtml
ProductManagement.cshtml
ProductManagementContent.cshtml
_ViewImports.cshtml
Project package reference¶
The application or plugin assembly that owns the .cshtml files must reference RazorSlices directly so RazorSlice proxy types are generated for that assembly. With central package management, add the reference without a version:
<ItemGroup>
<PackageReference Include="RazorSlices" />
</ItemGroup>
Page set¶
Use one page set per module. Each page owns its display route, optional content fragments, optional dashboard index card, and optional local actions.
namespace MyApp.Modules.Catalog.Dashboard;
using BridgingIT.DevKit.Presentation.Web.Dashboard;
public sealed class CatalogDashboard(DashboardEndpointsOptions options)
: DashboardPageSet(options)
{
protected override void Configure(DashboardPageSetBuilder pages)
{
pages.WithTags("_bdk.Dashboard.Catalog");
pages.Group("Catalog", order: 100)
.Page("overview", "/catalog")
.Title("Overview")
.Icon("boxes")
.Order(0)
.Description("Catalog overview")
.Razor<Pages.Overview>()
.Content<Pages.OverviewContent>()
.Card(GetOverviewCardAsync)
.Page("product-management", "/catalog/products")
.Title("Product Management")
.Icon("box-seam")
.Order(10)
.Description("Manage catalog products")
.Razor<Pages.ProductManagement>()
.Content<Pages.ProductManagementContent>()
.HideFromIndex()
.Post("/create", CreateProductAsync)
.Name("_bdk.Dashboard.Catalog.ProductCreate");
}
private static async ValueTask<DashboardPageCard> GetOverviewCardAsync(DashboardPageCardContext card)
{
var requester = card.HttpContext.RequestServices.GetService<IRequester>();
if (requester is null)
{
return card.Unavailable("Requester unavailable");
}
var result = await requester.SendAsync(new ProductSummaryQuery(), cancellationToken: card.HttpContext.RequestAborted);
return result.IsSuccess
? card.Value(result.Value.ProductCount.ToString(CultureInfo.InvariantCulture), "products")
: card.Error(result.Errors.FirstOrDefault()?.Message ?? "Could not load products");
}
}
The builder derives:
- endpoint mappings for the page and content fragments
- absolute dashboard URLs
- sidebar items
- default index card metadata
- endpoint names, summaries, and descriptions
- page-local action routes such as
/catalog/products/create
Use .HideFromSidebar() for utility pages and .HideFromIndex() for pages that should not appear as index cards.
RazorSlice imports¶
For project-local dashboard pages, add a _ViewImports.cshtml beside the pages.
@using BridgingIT.DevKit.Presentation.Web.Dashboard
@using BridgingIT.DevKit.Presentation.Web.Dashboard.Pages
@using Microsoft.Extensions.DependencyInjection
@using RazorSlices
@tagHelperPrefix __disable_tagHelpers__:
@removeTagHelper *, Microsoft.AspNetCore.Mvc.Razor
RazorSlices currently do not support Tag Helpers in this repo because warnings are treated as errors and RazorSlices marks Tag Helper APIs obsolete. Use RazorSlice base classes and normal Razor markup instead.
RazorSlice page¶
Use DashboardPageSlice for full dashboard pages and DashboardContentSlice for content fragments. The page can resolve services directly because it is server-rendered.
@using MyApp.Modules.Catalog.Application
@inherits DashboardPageSlice
@{
var contentPath = this.Dashboard.Url("overview", "content");
}
<div class="d-flex justify-content-between align-items-center py-2 mb-2 border-bottom">
<div>
<h4 class="m-0">Catalog</h4>
<div class="text-muted small">Product inventory overview</div>
</div>
<span class="text-muted small">Updated @DateTimeOffset.UtcNow.LocalDateTime.ToString("T", CultureInfo.InvariantCulture)</span>
</div>
<div id="catalog-overview-content">
<div class="text-muted small py-2">Loading catalog content...</div>
</div>
<script>
(() => {
window.bdkDashboard.createRefresher({
contentUrl: '@contentPath',
contentSelector: '#catalog-overview-content'
}).refresh(true);
})();
</script>
@functions {
public override string PageTitle => "Catalog";
}
createRefresher expects an HTML fragment by default. For a JSON data endpoint, set responseType: 'json' and provide an applyResponse(contentElement, responseText) callback that parses the JSON and updates the page. The helper checks the expected response format and preserves the current display on a failed or redirected request. HTML query-error markers are checked only for HTML responses.
Page descriptor guidance¶
.Title(...): Display name in sidebar and default card title..Icon(...): Bootstrap icon name without thebi-prefix..Group(...): Sidebar/card group heading and group sort order..Order(...): Sort order inside the group..HideFromSidebar(): Use for utility pages..HideFromIndex(): Use for pages that should not create dashboard cards..Badge(...): Optional async count shown in the sidebar..Card(...): Optional async card provider for the dashboard index..Razor<TPage>(): Main typed RazorSlice page..Content<TPage>(): Optional typed refreshable RazorSlice fragment below the page route..Get(...),.Post(...),.Put(...),.Delete(...): Optional page-local Minimal API action routes.
Page sets are called at render time to provide navigation and cards. Keep badge and card work lightweight, use in-process services, and handle missing optional services gracefully.
Advanced manual mapping¶
For advanced cases, implement IDashboardEndpoints to map custom routes and IDashboardPageProvider to contribute sidebar/card metadata manually. Use MapDashboardPage<TPage>(...) for typed RazorSlices or MapDashboardPage(..., razorIdentifier, assembly, ...) when the generated RazorSlice type is awkward to reference.
Dashboard index cards¶
Cards are rendered on the dashboard index and refreshed through the index content fragment endpoint. A card provider can return live values such as counts, health summaries, queue depth, or last activity.
If a page has ShowOnIndex = true but no Card delegate, the shell can still produce a default card from page metadata. Define Card when the plugin has useful summary data.
The dashboard catches page provider/card failures and keeps rendering the rest of the dashboard. Failed card providers are logged and replaced with an unavailable card state.
Sidebar grouping¶
The sidebar groups pages by DashboardPage.Group. Groups are visually separated. Built-in bITdevKit pages use the bdk group. Application pages should use an application-specific group such as Application, Catalog, Operations, or the module name.
Built-in navigation items use the feature SVG icons, selected by DashboardPage.Key. Their colors follow the selected dashboard theme in both expanded and collapsed navigation. Custom pages and legacy navigation items use their configured Bootstrap Icon value as a fallback.
Use GroupOrder to place groups predictably:
new DashboardPage("orders", "Orders", "receipt", "/_bdk/dashboard/orders")
{
Group = "Application",
GroupOrder = 100,
Order = 20
};
Refresh strategy¶
The dashboard shell uses fragment endpoints for refreshable regions:
/_bdk/dashboard/content: dashboard index cards./_bdk/dashboard/health/content: health body./_bdk/dashboard/metrics/content: metrics body.
The browser-side refresh strategy:
- Stores interval selection in
localStorage. - Uses
fetch()to request server-rendered HTML fragments. - Replaces only the content container
innerHTML. - Uses recursive
setTimeoutinstead ofsetIntervalto avoid overlapping refreshes. - Uses
AbortControllerto cancel in-flight requests when the interval changes. - Keeps previous content visible on failure and updates status text.
- Pauses automatic refresh while
document.hiddenistrue.
Project-specific pages can use the same pattern when only part of a page should update. Add a fragment RazorSlice, map a second dashboard endpoint, and replace a scoped content container from JavaScript.
External plugin assemblies¶
Dashboard plugins can live in separate packages or application assemblies. A plugin assembly should provide:
- One or more
DashboardPageSetimplementations, or advanced manualIDashboardEndpointsimplementations. - Optional manual
IDashboardPageProviderimplementations when not usingDashboardPageSet. - RazorSlice pages compiled into the plugin assembly. Reference
RazorSlicesdirectly when using typed.Razor<TPage>()and.Content<TPage>()page declarations.
Register the plugin assembly explicitly from the host:
builder.Services.AddDashboard(options =>
{
options.WithPluginAssemblyContaining<MyPluginDashboard>();
});
The dashboard scans configured plugin assemblies for endpoint and page provider implementations. It also scans currently loaded assemblies as a convenience, but explicit registration is recommended for reusable packages.
Troubleshooting¶
- Dashboard returns 404: Ensure
builder.Services.AddDashboard(...)is called andapp.MapEndpoints()is executed. - Plugin page route is missing: Ensure the plugin assembly is loaded and registered with
WithPluginAssemblyContaining<T>(). - Sidebar item is missing: Ensure an
IDashboardPageProviderimplementation is concrete, public, and in a scanned assembly. - Card does not appear: Ensure
ShowOnIndexistrueand the page provider returns a page. Check logs for provider/card exceptions. - Typed RazorSlice type is missing: Verify the application or plugin assembly references
RazorSlicesdirectly, and prefer unique page-specific.cshtmlfilenames such asOverview.cshtmlandOverviewContent.cshtml. - Path-based RazorSlice cannot render: Verify the RazorSlice identifier and assembly. The identifier is usually the project-relative
.cshtmlpath with a leading slash. - Authorization behaves differently than expected: Dashboard routes are endpoint routes. Apply authorization through the inherited endpoint options and
MapGroup(...)behavior, or require authorization on the mapped route group. - OIDC login does not start: Ensure the dashboard is configured with an authentication scheme whose challenge forwards to the OIDC handler, and that the identity provider client includes the dashboard callback URI.
- Refresh shows stale content: Confirm the fragment endpoint returns updated server-rendered HTML and that the browser interval is not set to
Off.
Appendix A: minimal plugin¶
The following is the smallest useful dashboard plugin with the recommended page-set API: one route, one page, one sidebar item, and one card.
public sealed class HealthDashboard(DashboardEndpointsOptions options)
: DashboardPageSet(options)
{
protected override void Configure(DashboardPageSetBuilder pages)
{
pages.Group("Application", 100)
.Page("health", "/health")
.Title("Health")
.Icon("activity")
.Order(0)
.Razor<Pages.Health>()
.Card(card => ValueTask.FromResult(
card.Value("OK", "Application is responding", "System")));
}
}
@inherits DashboardPageSlice
<div class="d-flex justify-content-between align-items-center py-2 mb-2 border-bottom">
<h4 class="m-0">Health</h4>
<span class="text-muted small">Updated @DateTimeOffset.UtcNow.LocalDateTime.ToString("T", CultureInfo.InvariantCulture)</span>
</div>
<div class="card">
<div class="card-body p-3">
<h6 class="card-title">Application</h6>
<div class="fs-4 fw-semibold">OK</div>
</div>
</div>
@functions {
public override string PageTitle => "Health";
}
Register external plugin assemblies explicitly:
builder.Services.AddDashboard(options =>
{
options.WithPluginAssemblyContaining<HealthDashboard>();
});
Consistent page controls¶
Dashboard.Pages.InfoTooltip renders a keyboard-focusable info button with an encoded description, accessible name and Bootstrap tooltip. Use it for short explanations beside cards, headers and settings:
@using BridgingIT.DevKit.Presentation.Web.Dashboard.Pages
<span>Owned memory @(await RenderPartialAsync<InfoTooltip, string>(
"Memory retained by this process for the selected collection."))</span>
The shell initializes tooltips on initial load. Pages that replace fragments initialize the new controls with bootstrap.Tooltip.getOrCreateInstance and dispose tooltip instances before removing their owner elements. The shared control uses data-dashboard-help, hover and focus triggers, and text-only tooltip content. Application Caching uses this control with its fragment lifecycle.
The breadcrumb provides the page title. Equivalent pages place their compact refresh toolbar first, routed view pills second, then context and filters, results, and continuation controls. Filter forms use a text Apply action and a circled-X Reset action (bi-x-circle, with the accessible name Reset filters) beside the final criteria on desktop. The pair wraps together on narrow screens. Editing a criterion creates a draft; refresh, export and continuation use the last successful selection. Reset preserves context, row-size and refresh preferences while clearing investigation criteria.
Growing lists keep Load more below the results beside Rows per load and show the cumulative number of items loaded. Exhausted lists retain a disabled button and an enabled selector. Changing the batch size loads a fresh first batch without applying other draft criteria. Jobs and broker lists preserve loaded history across Diagnostics navigation by replaying bounded requests; browser storage contains query boundaries, counts and scroll positions rather than row payloads. Restoration is limited to 100 batches and 20,000 rows.
Jobs has Jobs, Occurrences and Diagnostics views. Messaging and Queueing have Operations and Diagnostics. Graphs load and poll only inside Diagnostics. Diagnostic session statistics retain their own scope and do not imply the operational filters have been applied to them.
Editors keep unsaved values after failures. Escape, Cancel and the close button offer a discard decision in the existing dialog; clicking the backdrop leaves a dirty editor open. Read-only dialogs provide Close. Refresh status uses an explicit UTC time.




