Add custom app name per instance
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
@using MudBlazor
|
||||
@using DiunaBI.UI.Shared.Services
|
||||
@inject AppConfig AppConfig
|
||||
@inherits LayoutComponentBase
|
||||
|
||||
<AuthGuard>
|
||||
@@ -16,7 +18,7 @@
|
||||
OnClick="ToggleDrawer"
|
||||
Class="mud-hidden-md-up"/>
|
||||
<MudSpacer/>
|
||||
<MudText Typo="Typo.h6">DiunaBI</MudText>
|
||||
<MudText Typo="Typo.h6">@AppConfig.AppName</MudText>
|
||||
</MudAppBar>
|
||||
|
||||
<MudDrawer @bind-Open="_drawerOpen"
|
||||
|
||||
6
DiunaBI.UI.Shared/Services/AppConfig.cs
Normal file
6
DiunaBI.UI.Shared/Services/AppConfig.cs
Normal file
@@ -0,0 +1,6 @@
|
||||
namespace DiunaBI.UI.Shared.Services;
|
||||
|
||||
public class AppConfig
|
||||
{
|
||||
public string AppName { get; set; } = "DiunaBI";
|
||||
}
|
||||
@@ -14,6 +14,10 @@ var apiBaseUrl = builder.Configuration["ApiSettings:BaseUrl"]
|
||||
?? throw new InvalidOperationException("ApiSettings:BaseUrl is not configured");
|
||||
builder.Services.AddSharedServices(apiBaseUrl);
|
||||
|
||||
// Configure App settings
|
||||
var appConfig = builder.Configuration.GetSection("App").Get<AppConfig>() ?? new AppConfig();
|
||||
builder.Services.AddSingleton(appConfig);
|
||||
|
||||
builder.Services.AddScoped<IGoogleAuthService, WebGoogleAuthService>();
|
||||
|
||||
var app = builder.Build();
|
||||
|
||||
@@ -12,5 +12,8 @@
|
||||
"Url": "http://0.0.0.0:7143"
|
||||
}
|
||||
}
|
||||
},
|
||||
"App": {
|
||||
"AppName": "DiunaBI"
|
||||
}
|
||||
}
|
||||
@@ -6,5 +6,8 @@
|
||||
"Microsoft.AspNetCore": "Warning"
|
||||
}
|
||||
},
|
||||
"AllowedHosts": "*"
|
||||
"AllowedHosts": "*",
|
||||
"App": {
|
||||
"AppName": "DiunaBI"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user