Extending System Information modal content

Hi,
I would like to add some infomration into the System Information modal, that is displayed when you click on the top-left Umbraco icon in the Backoffice:

I would like to add my solution build number or docker image tag.
What is the best way to acheive this?

Should I reimplement the InformationServerController or TroubleshootingServerController to add this info?


I couldn’t find anything in the docs about it so that’s why I’m asking.

Umbraco v17

Perhaps you could do some digging into the InformationServerController and see if anything can be extended?

hey @gregor-tusar-sowa and @Steffen_HK

After digging into the core code, here’s what I found:

The extensible path is ISystemTroubleshootingInformationService not the controllers. Both InformationServerController and TroubleshootingServerController are thin wrappers that just call a service and map the result, so they’re not the right place to extend.

To add custom keys (e.g. solution build number, Docker image tag) to the System Information modal without touching core, implement a decorator/wrapper around ISystemTroubleshootingInformationService:

public class CustomTroubleshootingInformationService : ISystemTroubleshootingInformationService
{
    private readonly ISystemTroubleshootingInformationService _inner;

    public CustomTroubleshootingInformationService(ISystemTroubleshootingInformationService inner)
        => _inner = inner;

    public IDictionary<string, string> GetTroubleshootingInformation()
    {
        var items = _inner.GetTroubleshootingInformation();
        items["Solution Build Number"] = "your-value-here";
        items["Docker Image Tag"] = "your-value-here";
        return items;
    }
}

Then register it in your Composer after Umbraco’s registration so it replaces the default:

builder.Services.AddUnique<ISystemTroubleshootingInformationService, CustomTroubleshootingInformationService>();

Your custom keys will appear under the “Server Troubleshooting” block in the existing modal no backoffice or core changes needed.

Note: if you specifically need the fields under “Server Information” (alongside Version/Runtime mode), that section has a fixed shape and would require core changes to ServerInformation, ServerInformationResponseModel,

/path : Umbraco-CMS/src/Umbraco.Web.UI.Client/src/packages/sysinfo/components/sysinfo.element.ts at main · umbraco/Umbraco-CMS · GitHub

Hope this helps

/Bishal

Thank you @BishalTimalsina12 for the hint. I had to “reimplement” the original class since injecting it with DI and using it as inner didn’t work as the DI breaks because of uniqueness and circular dependency:

Some services are not able to be constructed (Error while validating the service descriptor 'ServiceType: Umbraco.Cms.Core.Services.ISystemTroubleshootingInformationService Lifetime: Singleton ImplementationType: BsdLabs.Cms.Services.ExtendedSystemTroubleshootingInformationService': A circular dependency was detected for the service of type 'Umbraco.Cms.Core.Services.ISystemTroubleshootingInformationService'.
Umbraco.Cms.Core.Services.ISystemTroubleshootingInformationService(BsdLabs.Cms.Services.ExtendedSystemTroubleshootingInformationService) -> Umbraco.Cms.Core.Services.ISystemTroubleshootingInformationService)'

I also tried to construct it with new, but unforunatelly it’s internal and it’s not possible to instantiate it.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.