1
0
mirror of synced 2024-12-04 19:07:58 +01:00
TaikoLocalServer/TaikoWebUI/Pages/Song.razor

84 lines
3.8 KiB
Plaintext
Raw Normal View History

2024-03-10 04:48:26 +01:00
@page "/Users/{baid:int}/Songs/{songId:int}"
@inject IGameDataService GameDataService
@inject HttpClient Client
@inject LoginService LoginService
@inject NavigationManager NavigationManager
@inject IJSRuntime JSRuntime
2024-03-13 16:00:18 +01:00
@using TaikoWebUI.Utilities;
2024-03-10 04:48:26 +01:00
@if (LoginService.LoginRequired && (!LoginService.IsLoggedIn || (LoginService.GetLoggedInUser().Baid != Baid && !LoginService.IsAdmin)))
{
if (!LoginService.IsLoggedIn)
{
NavigationManager.NavigateTo("/Login");
}
else
{
NavigationManager.NavigateTo("/");
}
}
else
{
if (response is not null)
{
<MudBreadcrumbs Items="breadcrumbs" Class="p-0 mb-3"></MudBreadcrumbs>
<MudText Typo="Typo.h5">@SongTitle</MudText>
<MudText Typo="Typo.body2">@SongArtist</MudText>
<MudGrid Class="my-4 pb-10">
2024-03-10 05:49:47 +01:00
<MudItem xs="12">
<MudCard Outlined="true" Elevation="0">
<MudCardHeader>
2024-03-13 16:00:18 +01:00
<MudText Typo="Typo.h6">Play History</MudText>
2024-03-10 05:49:47 +01:00
</MudCardHeader>
2024-03-10 06:16:23 +01:00
2024-03-10 05:49:47 +01:00
@if (SongBestData is not null && SongBestData.RecentPlayData is not null && SongBestData.RecentPlayData.Count > 0)
{
2024-03-10 06:16:23 +01:00
<MudCardContent Class="p-0">
<MudTable Items="@SongBestData.RecentPlayData" Elevation="0" Striped="true">
2024-03-10 05:49:47 +01:00
<HeaderContent>
<MudTh>Play Time</MudTh>
<MudTh>Difficulty</MudTh>
2024-03-10 05:55:30 +01:00
<MudTh>Crown</MudTh>
<MudTh>Rank</MudTh>
2024-03-10 06:16:23 +01:00
<MudTh>Score</MudTh>
<MudTh>Good</MudTh>
<MudTh>Ok</MudTh>
<MudTh>Bad</MudTh>
<MudTh>Drumroll</MudTh>
<MudTh>Max Combo</MudTh>
2024-03-10 05:49:47 +01:00
</HeaderContent>
<RowTemplate>
<MudTd>@context.PlayTime</MudTd>
2024-03-13 16:00:18 +01:00
<MudTd>
<img src="@ScoreUtils.GetDifficultyIcon(context.Difficulty)" alt="@context.Difficulty" title="@context.Difficulty" style="@IconStyle" />
</MudTd>
<MudTd>
<img src="@($"/images/crown_{context.Crown}.png")" alt="@(ScoreUtils.GetCrownText(context.Crown))" title="@(ScoreUtils.GetCrownText(context.Crown))" style="@IconStyle" />
</MudTd>
<MudTd>
<img src="@($"/images/rank_{context.ScoreRank}.png")" alt="@(ScoreUtils.GetRankText(context.ScoreRank))" title="@(ScoreUtils.GetRankText(context.ScoreRank))" style="@IconStyle" />
</MudTd>
2024-03-10 06:16:23 +01:00
<MudTd>@context.Score</MudTd>
<MudTd>@context.GoodCount</MudTd>
<MudTd>@context.OkCount</MudTd>
<MudTd>@context.MissCount</MudTd>
<MudTd>@context.DrumrollCount</MudTd>
<MudTd>@context.ComboCount</MudTd>
2024-03-10 05:49:47 +01:00
</RowTemplate>
</MudTable>
2024-03-10 06:16:23 +01:00
</MudCardContent>
2024-03-10 05:49:47 +01:00
}
else
{
2024-03-10 06:16:23 +01:00
<MudCardContent>
<MudText Typo="Typo.body2" Class="pb-8" Color="Color.Surface" Align="Align.Center">No recent play data.</MudText>
</MudCardContent>
2024-03-10 05:49:47 +01:00
}
</MudCard>
</MudItem>
2024-03-10 04:48:26 +01:00
</MudGrid>
}
}