Skip to main content

Admin UI

Bundled as embedded resources in the CommerceMind.Nexus.UI NuGet package is an admin UI. It uses the API for all data and requests, so anything that's possible to do in the admin UI is possible to do with the API.

Register the Admin UI and tell it where the Nexus API is hosted:

using CommerceMind.Nexus.UI.Extensions;

builder.Services
.AddNexus()
.AddApi()
.AddAdminUI(options =>
{
options.ApiBaseUrl = "/";
})
.Build();

var app = builder.Build();

app.UseNexusAdminUI();

When the API and Admin UI are hosted in the same application, set ApiBaseUrl to the same value as NexusApiOptions.BasePath. Feature discovery is served by the API, including when the UI is hosted separately. Menu customization is supplied by the UI host when it serves the page.

If you deploy Nexus to multiple environments such as dev/test/stage/prod/etc you can add an environment name that is shown in the UI, as well as add an info notice bar with any message you want. Both of these settings are used in the demo environment described below to see it in action.

builder.Services.AddNexus().AddAdminUI(options =>
{
options.ApiBaseUrl = "/";
options.EnvironmentName = "Dev";
options.InfoNotice = "This is a <b>note</b> to anyone using the UI";
});

The UI uses the API host's /api/enabled-features response to show available features, together with the menu supplied by the UI host. If you want to control the menu you can implement the menu loader to return which menu items you want:

builder.Services.AddNexus().AddAdminUI(options =>
{
options.ApiBaseUrl = "/";
options.MenuItemsLoader = httpContext => Task.FromResult(new List<NexusAdminUIMenuItems>
{
NexusAdminUIMenuItems.HealthChecks,
NexusAdminUIMenuItems.Jobs,
NexusAdminUIMenuItems.Queues,
NexusAdminUIMenuItems.Functions,
NexusAdminUIMenuItems.Statistics,
});
});

The menu loader is an async lambda that gets an HTTP request passed in that lets you have different menu items for different users. The order in the returned list is respected.

Admin UI versions​

The new version of the admin UI is enabled by default. You can temporarily switch back to the legacy admin UI by setting UseLegacyVersion to true:

builder.Services.AddNexus().AddAdminUI(options =>
{
options.ApiBaseUrl = "/";
options.UseLegacyVersion = true;
});

UseLegacyVersion and the legacy admin UI are retained as a temporary fallback. They will be removed in a future major version.

Jobs, activation, and processing controls​

The jobs list and job details show live progress reported by IJobProgress. Queue jobs do not generate progress automatically unless automatic progress is enabled. A readiness-driven job can be waiting for messages rather than waiting for a cron run; clearing a queue job's saved schedule switches to that mode. A cron schedule makes it scheduled-only.

Both UI versions show the optional queue-job schedule and activation delay. The new UI also shows distributed processors on their queue pages, including per-instance worker activity, in-flight messages, and pause/resume/wake controls. They do not create job runs in the jobs list.

The Processing tab saves per-queue processing overrides. Clearing an override restores the code default; Use code defaults resets all overrides. Jobs apply changes on the next run, while distributed pools finish current work before rebuilding. The legacy UI does not expose these new processing controls.

Hosting the UI on its own​

If you want to separate the Admin UI from the API you can host the Admin UI on it's own. Just install the NuGet package CommerceMind.Nexus.UI in a separate ASP.NET Web app and in your Program.cs you add:

builder.Services
.AddNexus()
.AddAdminUI(options =>
{
options.Path = "nexus-ui"; // Optional, default is "nexus"
options.ApiBaseUrl = "https://your-nexus-api-url.com";
})
.Build();

var app = builder.Build();

app.UseNexusAdminUI();

This will serve the Admin UI without needing a database connection or any other access to Nexus but the API.

Demo environment​

There's a demo environment that's deployed to a free tier Azure Web App here:
https://commerce-mind-nexus-a9bsbwgth3cgfnde.swedencentral-01.azurewebsites.net/admin/

You can click on any buttons you like, start any job or do anything with the queues to get a feel for what the system does.

Demo environment

Since the demo environment is using a free tier Azure Web App the scheduler is paused when nobody is using the API or admin UI which means that the jobs won't run exactly according to schedule.

Authentication​

See API docs about authentication.

Authorization​

See API docs about authorization.