diff --git a/TaikoWebUI/Components/MainLayout.razor b/TaikoWebUI/Components/MainLayout.razor index 141ce24..2f7bc6c 100644 --- a/TaikoWebUI/Components/MainLayout.razor +++ b/TaikoWebUI/Components/MainLayout.razor @@ -1,6 +1,8 @@ @inherits LayoutComponentBase @inject Blazored.LocalStorage.ILocalStorageService LocalStorage @inject AuthService AuthService +@using Microsoft.Extensions.Options; +@using TaikoWebUI.Settings; @@ -17,7 +19,7 @@ - TaikoWebUI + @title @@ -35,9 +37,20 @@ @code { bool drawerOpen = true; bool isDarkMode = false; + string title = "TaikoWebUI"; + [Inject] + IOptions UiSettings { get; set; } = default!; + + protected override void OnInitialized() + { + title = UiSettings.Value.Title; + } + protected override async Task OnInitializedAsync() { + + var hasDrawerOpenEntry = await LocalStorage.ContainKeyAsync("drawerOpen"); if (hasDrawerOpenEntry) diff --git a/TaikoWebUI/Settings/WebUiSettings.cs b/TaikoWebUI/Settings/WebUiSettings.cs index b122ee3..63adc3f 100644 --- a/TaikoWebUI/Settings/WebUiSettings.cs +++ b/TaikoWebUI/Settings/WebUiSettings.cs @@ -2,6 +2,7 @@ public class WebUiSettings { + public string Title { get; set; } = "TaikoWebUI"; public bool LoginRequired { get; set; } public bool OnlyAdmin { get; set; } public int BoundAccessCodeUpperLimit { get; set; } diff --git a/TaikoWebUI/wwwroot/appsettings.json b/TaikoWebUI/wwwroot/appsettings.json index d576366..e1fc610 100644 --- a/TaikoWebUI/wwwroot/appsettings.json +++ b/TaikoWebUI/wwwroot/appsettings.json @@ -1,5 +1,6 @@ { "WebUiSettings": { + "Title": "TaikoWebUI", "LoginRequired": "false", "OnlyAdmin": "false", "BoundAccessCodeUpperLimit": "3",