524ae10439
Use more user settings
52 lines
1.5 KiB
Plaintext
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}");
|
|
}
|
|
} |