From a289690b6bd5c4780219ed2a8a5aa91b2b17d59c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Zieli=C5=84ski?= Date: Fri, 28 Nov 2025 11:44:19 +0100 Subject: [PATCH] Add custom app name per instance --- DiunaBI.UI.Shared/MainLayout.razor | 4 +++- DiunaBI.UI.Shared/Services/AppConfig.cs | 6 ++++++ DiunaBI.UI.Web/Program.cs | 4 ++++ DiunaBI.UI.Web/appsettings.Production.json | 3 +++ DiunaBI.UI.Web/appsettings.json | 5 ++++- 5 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 DiunaBI.UI.Shared/Services/AppConfig.cs diff --git a/DiunaBI.UI.Shared/MainLayout.razor b/DiunaBI.UI.Shared/MainLayout.razor index 07317b6..f3fe399 100644 --- a/DiunaBI.UI.Shared/MainLayout.razor +++ b/DiunaBI.UI.Shared/MainLayout.razor @@ -1,4 +1,6 @@ @using MudBlazor +@using DiunaBI.UI.Shared.Services +@inject AppConfig AppConfig @inherits LayoutComponentBase @@ -16,7 +18,7 @@ OnClick="ToggleDrawer" Class="mud-hidden-md-up"/> - DiunaBI + @AppConfig.AppName () ?? new AppConfig(); +builder.Services.AddSingleton(appConfig); + builder.Services.AddScoped(); var app = builder.Build(); diff --git a/DiunaBI.UI.Web/appsettings.Production.json b/DiunaBI.UI.Web/appsettings.Production.json index 43538aa..2ce55b3 100644 --- a/DiunaBI.UI.Web/appsettings.Production.json +++ b/DiunaBI.UI.Web/appsettings.Production.json @@ -12,5 +12,8 @@ "Url": "http://0.0.0.0:7143" } } + }, + "App": { + "AppName": "DiunaBI" } } \ No newline at end of file diff --git a/DiunaBI.UI.Web/appsettings.json b/DiunaBI.UI.Web/appsettings.json index 0b4b50d..1ef5b0f 100644 --- a/DiunaBI.UI.Web/appsettings.json +++ b/DiunaBI.UI.Web/appsettings.json @@ -6,5 +6,8 @@ "Microsoft.AspNetCore": "Warning" } }, - "AllowedHosts": "*" + "AllowedHosts": "*", + "App": { + "AppName": "DiunaBI" + } } \ No newline at end of file