1
0
mirror of synced 2024-11-15 10:57:34 +01:00
TaikoLocalServer/TaikoWebUI/Pages/Dashboard.razor
asesidaa 524ae10439 Add user setting UI and api
Use more user settings
2022-09-05 23:01:54 +08:00

52 lines
1.5 KiB
Plaintext

@using SharedProject.Models.Responses
@inject HttpClient Client
@inject NavigationManager UriHelper
@page "/Dashboard"
<MudContainer>
@if (response is null)
{
<MudText>No Data</MudText>
}
else
{
<MudGrid>
@foreach (var user in response.Users)
{
<MudItem>
<MudCard>
<MudCardHeader>
<CardHeaderContent>
<MudText Typo="Typo.h5">Baid @user.Baid</MudText>
</CardHeaderContent>
<CardHeaderActions>
<MudIconButton OnClick="() => NavigateToProfile(user.Baid)" Icon="@Icons.Material.Filled.Settings" Color="Color.Default" />
</CardHeaderActions>
</MudCardHeader>
<MudCardContent>
<MudText Typo="Typo.h6">Access Code</MudText>
<MudText>@user.AccessCode</MudText>
</MudCardContent>
</MudCard>
</MudItem>
}
</MudGrid>
}
</MudContainer>
@code {
private DashboardResponse? response;
protected override async Task OnInitializedAsync()
{
await base.OnInitializedAsync();
response = await Client.GetFromJsonAsync<DashboardResponse>("api/Dashboard");
}
private void NavigateToProfile(uint baid)
{
UriHelper.NavigateTo($"/Card/{baid}");
}
}