2022-09-04 19:19:42 +02:00
|
|
|
@using SharedProject.Models.Responses
|
|
|
|
@inject HttpClient Client
|
2022-09-05 06:52:29 +02:00
|
|
|
@inject NavigationManager UriHelper
|
2022-09-04 19:19:42 +02:00
|
|
|
|
|
|
|
@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>
|
2022-09-05 06:52:29 +02:00
|
|
|
<CardHeaderActions>
|
|
|
|
<MudIconButton OnClick="() => NavigateToProfile(user.Baid)" Icon="@Icons.Material.Filled.Settings" Color="Color.Default" />
|
|
|
|
</CardHeaderActions>
|
2022-09-04 19:19:42 +02:00
|
|
|
</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");
|
|
|
|
}
|
|
|
|
|
2022-09-05 06:52:29 +02:00
|
|
|
|
2022-09-05 17:01:54 +02:00
|
|
|
private void NavigateToProfile(uint baid)
|
2022-09-05 06:52:29 +02:00
|
|
|
{
|
|
|
|
UriHelper.NavigateTo($"/Card/{baid}");
|
|
|
|
}
|
2022-09-04 19:19:42 +02:00
|
|
|
}
|