1
0
mirror of synced 2025-02-05 22:25:29 +01:00

50 lines
1.1 KiB
Plaintext
Raw Normal View History

2022-09-05 01:19:42 +08:00
@using SharedProject.Models.Responses
2022-09-06 22:32:36 +08:00
@using TaikoWebUI.Pages.Dialogs
@using SharedProject.Models
2022-09-05 01:19:42 +08:00
@inject HttpClient Client
2022-09-05 00:52:29 -04:00
@inject NavigationManager UriHelper
2022-09-06 22:32:36 +08:00
@inject IDialogService DialogService
2022-09-05 01:19:42 +08:00
@page "/"
2022-09-05 17:42:13 -04:00
<h1>Dashboard</h1>
<MudText Class="mt-8">
Welcome to TaikoWebUI!
</MudText>
2022-09-05 01:19:42 +08:00
2022-09-06 22:32:36 +08:00
2022-09-05 01:19:42 +08:00
@code {
private DashboardResponse? response;
protected override async Task OnInitializedAsync()
{
await base.OnInitializedAsync();
response = await Client.GetFromJsonAsync<DashboardResponse>("api/Dashboard");
}
2022-09-05 00:52:29 -04:00
private void NavigateToProfile(uint baid)
2022-09-05 00:52:29 -04:00
{
UriHelper.NavigateTo($"/Card/{baid}");
}
2022-09-06 22:32:36 +08:00
private async Task DeleteCard(User user)
{
var parameters = new DialogParameters
{
["user"] = user
};
2022-09-06 22:32:36 +08:00
var dialog = DialogService.Show<CardDeleteConfirmDialog>("Delete Card", parameters);
var result = await dialog.Result;
if (result.Cancelled)
{
return;
}
response = await Client.GetFromJsonAsync<DashboardResponse>("api/Dashboard");
}
2022-09-05 01:19:42 +08:00
}