mirror of
https://github.com/DrMboga/WotBlitzStatisticsBlazor.git
synced 2026-10-23 19:30:06 +02:00
Blazor server and client apps. With data service mocks
This commit is contained in:
1 parent
1fa0b03555
commit
a0ad7ca395
68 files changed
+1893
No files matched your search
@@ -0,0 +1,64 @@
|
||||
@page "/accountinfo/{AccountId:long}"
|
||||
@inherits AccountInfoShellComponent
|
||||
|
||||
@if (PlayerAccountInfo == null)
|
||||
{
|
||||
<h3>Loading...</h3>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="container-fluid p-3">
|
||||
<div class="row">
|
||||
<div class="col-sm-4"><h2>@PlayerAccountInfo.NickName</h2></div>
|
||||
<div class="col-sm-4 p-2">Last battle: @PlayerAccountInfo.LastBattleTime</div>
|
||||
<div class="col-sm-4 p-2">Account created: @PlayerAccountInfo.AccountCreatedAt</div>
|
||||
</div>
|
||||
<div class="row pt-5">
|
||||
<div class="col-sm-4">
|
||||
<table class="table table-striped">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Battles:</td>
|
||||
<td>@PlayerAccountInfo.Battles.ToString("N0")</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Winrate:</td>
|
||||
<td>@PlayerAccountInfo.Winrate.ToString("N2") %</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Wn7:</td>
|
||||
<td>@PlayerAccountInfo.Wn7.ToString("N0")</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Average damage:</td>
|
||||
<td>@PlayerAccountInfo.AvgDamage.ToString("N0")</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Average XP:</td>
|
||||
<td>@PlayerAccountInfo.AvgXp.ToString("N0")</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
<p>Top tanks:</p>
|
||||
@foreach (var tank in PlayerAccountInfo.TopTanks)
|
||||
{
|
||||
<div class="row">
|
||||
<TankCard TankInfo="tank"></TankCard>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
<p>Top achievements:</p>
|
||||
@foreach (var achievement in PlayerAccountInfo.Achievements)
|
||||
{
|
||||
<div class="p-2">
|
||||
<img src="@achievement.Image" title="@achievement.Name"/>
|
||||
<p>@achievement.Count</p>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using System.Threading.Tasks;
|
||||
using WotBlitzStatisticsPro.Common;
|
||||
using WotBlitzStatisticsPro.Common.Model;
|
||||
|
||||
namespace WotBlitzStatisticsPro.UI.AccountInfo
|
||||
{
|
||||
public class AccountInfoShellComponent : ComponentBase
|
||||
{
|
||||
[Inject]
|
||||
public IAccountInfoService AccountInfoService { get; set; }
|
||||
|
||||
[Parameter]
|
||||
public long AccountId { get; set; }
|
||||
|
||||
public PlayerAccountInfo PlayerAccountInfo { get; set; }
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
await base.OnInitializedAsync();
|
||||
PlayerAccountInfo = await AccountInfoService.GetAccountInfo(AccountId);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
@using WotBlitzStatisticsPro.Common.Model
|
||||
|
||||
<div class="row p-2">
|
||||
<div class="col">
|
||||
<img class="tank-img @TankInfo.Nation-img"
|
||||
src="@TankInfo.PreviewImageUrl" />
|
||||
</div>
|
||||
<div class="col">
|
||||
@TankInfo.Name <br />
|
||||
Winrate @TankInfo.WinRate.ToString("N2") % <br />
|
||||
Avg damage @TankInfo.AvgDamage.ToString("N0")
|
||||
</div>
|
||||
</div>
|
||||
@code {
|
||||
[Parameter]
|
||||
public PlayerTankInfo TankInfo { get; set; }
|
||||
}
|
||||
Reference in new issue
Block a user