Prepare for dani dojo data
This commit is contained in:
parent
9e34ef86f1
commit
6829c1f96a
@ -71,7 +71,9 @@
|
|||||||
FullWidth="true"
|
FullWidth="true"
|
||||||
AnchorOrigin="Origin.BottomCenter"
|
AnchorOrigin="Origin.BottomCenter"
|
||||||
TransformOrigin="Origin.TopCenter">
|
TransformOrigin="Origin.TopCenter">
|
||||||
<MudMenuItem Href="@($"Cards/{user.Baid}/PlayResults")">Taiko Mode</MudMenuItem>
|
<MudMenuItem Href="@($"Cards/{user.Baid}/TaikoMode")">Taiko Mode</MudMenuItem>
|
||||||
|
<MudMenuItem Href="@($"Cards/{user.Baid}/DaniDojo")">Dani Dojo</MudMenuItem>
|
||||||
|
@*<MudMenuItem Href="@($"Cards/{user.Baid}/AIBattle")">AI Battle</MudMenuItem>*@
|
||||||
</MudMenu>
|
</MudMenu>
|
||||||
</MudStack>
|
</MudStack>
|
||||||
</MudCardActions>
|
</MudCardActions>
|
||||||
|
50
TaikoWebUI/Pages/DaniDojo.razor
Normal file
50
TaikoWebUI/Pages/DaniDojo.razor
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
@using TaikoWebUI.Services
|
||||||
|
@using SharedProject.Models.Responses
|
||||||
|
@using SharedProject.Models
|
||||||
|
@using SharedProject.Models.Requests
|
||||||
|
@using SharedProject.Enums
|
||||||
|
@using Throw
|
||||||
|
@inject IGameDataService GameDataService
|
||||||
|
@inject HttpClient Client
|
||||||
|
|
||||||
|
@page "/Cards/{baid:int}/DaniDojo"
|
||||||
|
|
||||||
|
<MudBreadcrumbs Items="breadcrumbs" Class="px-0"></MudBreadcrumbs>
|
||||||
|
|
||||||
|
<h1>Dani Dojo</h1>
|
||||||
|
<MudText Typo="Typo.caption">Card: @Baid</MudText>
|
||||||
|
|
||||||
|
<MudGrid Class="my-8">
|
||||||
|
|
||||||
|
</MudGrid>
|
||||||
|
|
||||||
|
|
||||||
|
@code {
|
||||||
|
|
||||||
|
[Parameter]
|
||||||
|
public int Baid { get; set; }
|
||||||
|
|
||||||
|
private SongBestResponse? response;
|
||||||
|
|
||||||
|
private const string ICON_STYLE = "width:25px; height:25px;";
|
||||||
|
|
||||||
|
private readonly List<BreadcrumbItem> breadcrumbs = new()
|
||||||
|
{
|
||||||
|
new BreadcrumbItem("Cards", href: "/Cards"),
|
||||||
|
};
|
||||||
|
|
||||||
|
protected override async Task OnInitializedAsync()
|
||||||
|
{
|
||||||
|
await base.OnInitializedAsync();
|
||||||
|
response = await Client.GetFromJsonAsync<SongBestResponse>($"api/PlayData/{Baid}");
|
||||||
|
response.ThrowIfNull();
|
||||||
|
response.SongBestData.Sort((data1, data2) =>
|
||||||
|
{
|
||||||
|
return GameDataService.GetMusicIndexBySongId(data1.SongId)
|
||||||
|
.CompareTo(GameDataService.GetMusicIndexBySongId(data2.SongId));
|
||||||
|
});
|
||||||
|
|
||||||
|
breadcrumbs.Add(new BreadcrumbItem($"Card: {Baid}", href: null, disabled: true));
|
||||||
|
breadcrumbs.Add(new BreadcrumbItem("Dani Dojo", href: $"/Cards/{Baid}/DaniDojo", disabled: false));
|
||||||
|
}
|
||||||
|
}
|
@ -7,7 +7,7 @@
|
|||||||
@inject IGameDataService GameDataService
|
@inject IGameDataService GameDataService
|
||||||
@inject HttpClient Client
|
@inject HttpClient Client
|
||||||
|
|
||||||
@page "/Cards/{baid:int}/PlayResults"
|
@page "/Cards/{baid:int}/TaikoMode"
|
||||||
|
|
||||||
<MudBreadcrumbs Items="breadcrumbs" Class="px-0"></MudBreadcrumbs>
|
<MudBreadcrumbs Items="breadcrumbs" Class="px-0"></MudBreadcrumbs>
|
||||||
|
|
||||||
@ -131,7 +131,7 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
breadcrumbs.Add(new BreadcrumbItem($"Card: {Baid}", href: null, disabled: true));
|
breadcrumbs.Add(new BreadcrumbItem($"Card: {Baid}", href: null, disabled: true));
|
||||||
breadcrumbs.Add(new BreadcrumbItem("Taiko Mode", href: $"/Cards/{Baid}/PlayResults", disabled: false));
|
breadcrumbs.Add(new BreadcrumbItem("Taiko Mode", href: $"/Cards/{Baid}/TaikoMode", disabled: false));
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task OnFavoriteToggled(SongBestData data)
|
private async Task OnFavoriteToggled(SongBestData data)
|
Loading…
Reference in New Issue
Block a user