Allow title to be changed via config
This commit is contained in:
parent
c3b5e11739
commit
a5c45b0065
@ -1,6 +1,8 @@
|
||||
@inherits LayoutComponentBase
|
||||
@inject Blazored.LocalStorage.ILocalStorageService LocalStorage
|
||||
@inject AuthService AuthService
|
||||
@using Microsoft.Extensions.Options;
|
||||
@using TaikoWebUI.Settings;
|
||||
|
||||
<MudThemeProvider IsDarkMode="@isDarkMode" Theme="@taikoWebUiTheme" />
|
||||
<MudDialogProvider />
|
||||
@ -17,7 +19,7 @@
|
||||
</MudAppBar>
|
||||
<MudDrawer Elevation="0" Style="border-right:1px solid #ededf0" @bind-Open="drawerOpen">
|
||||
<MudDrawerHeader>
|
||||
<MudText Typo="Typo.h6">TaikoWebUI</MudText>
|
||||
<MudText Typo="Typo.h6">@title</MudText>
|
||||
</MudDrawerHeader>
|
||||
<NavMenu />
|
||||
</MudDrawer>
|
||||
@ -35,9 +37,20 @@
|
||||
@code {
|
||||
bool drawerOpen = true;
|
||||
bool isDarkMode = false;
|
||||
string title = "TaikoWebUI";
|
||||
|
||||
[Inject]
|
||||
IOptions<WebUiSettings> 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)
|
||||
|
@ -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; }
|
||||
|
@ -1,5 +1,6 @@
|
||||
{
|
||||
"WebUiSettings": {
|
||||
"Title": "TaikoWebUI",
|
||||
"LoginRequired": "false",
|
||||
"OnlyAdmin": "false",
|
||||
"BoundAccessCodeUpperLimit": "3",
|
||||
|
Loading…
x
Reference in New Issue
Block a user