Added keys count to edit view
This commit is contained in:
parent
e7f84e4bd2
commit
4655e75da5
1 changed files with 41 additions and 0 deletions
|
@ -85,6 +85,38 @@
|
||||||
<MultiplayerModeEditor Game="Game" />
|
<MultiplayerModeEditor Game="Game" />
|
||||||
</MudCardContent>
|
</MudCardContent>
|
||||||
</MudCard>
|
</MudCard>
|
||||||
|
|
||||||
|
<MudCard Class="mt-4">
|
||||||
|
<MudCardHeader>
|
||||||
|
<CardHeaderContent>
|
||||||
|
<MudText Typo="Typo.h6">Keys</MudText>
|
||||||
|
</CardHeaderContent>
|
||||||
|
|
||||||
|
<CardHeaderActions>
|
||||||
|
<MudButton Href="@($"/Games/{Id}/Keys")">View</MudButton>
|
||||||
|
</CardHeaderActions>
|
||||||
|
</MudCardHeader>
|
||||||
|
|
||||||
|
<MudCardContent>
|
||||||
|
<MudGrid>
|
||||||
|
<MudItem md="4" Class="mud-typography-align-center">
|
||||||
|
<MudText Typo="Typo.overline">Available</MudText>
|
||||||
|
<MudText Typo="Typo.body1">@KeysAvailable</MudText>
|
||||||
|
</MudItem>
|
||||||
|
|
||||||
|
<MudItem md="4" Class="mud-typography-align-center">
|
||||||
|
<MudText Typo="Typo.overline">Claimed</MudText>
|
||||||
|
<MudText Typo="Typo.body1">@(Game.Keys.Count - KeysAvailable)</MudText>
|
||||||
|
</MudItem>
|
||||||
|
|
||||||
|
<MudItem md="4" Class="mud-typography-align-center">
|
||||||
|
<MudText Typo="Typo.overline">Total</MudText>
|
||||||
|
<MudText Typo="Typo.body1">@Game.Keys.Count</MudText>
|
||||||
|
</MudItem>
|
||||||
|
</MudGrid>
|
||||||
|
</MudCardContent>
|
||||||
|
</MudCard>
|
||||||
|
|
||||||
<MudFab Color="Color.Primary" Disabled="@(!Success)" OnClick="Save" StartIcon="@Icons.Material.Filled.Save" Style="position: fixed; right: 32px; bottom: 32px;" />
|
<MudFab Color="Color.Primary" Disabled="@(!Success)" OnClick="Save" StartIcon="@Icons.Material.Filled.Save" Style="position: fixed; right: 32px; bottom: 32px;" />
|
||||||
|
|
||||||
@code {
|
@code {
|
||||||
|
@ -96,6 +128,15 @@
|
||||||
|
|
||||||
private Game Game { get; set; }
|
private Game Game { get; set; }
|
||||||
|
|
||||||
|
private int KeysAvailable { get {
|
||||||
|
return Game.Keys.Count(k =>
|
||||||
|
{
|
||||||
|
return (k.AllocationMethod == KeyAllocationMethod.MacAddress && String.IsNullOrWhiteSpace(k.ClaimedByMacAddress))
|
||||||
|
||
|
||||||
|
(k.AllocationMethod == KeyAllocationMethod.UserAccount && k.ClaimedByUser == null);
|
||||||
|
});
|
||||||
|
} }
|
||||||
|
|
||||||
protected override async Task OnInitializedAsync()
|
protected override async Task OnInitializedAsync()
|
||||||
{
|
{
|
||||||
Game = await GameService.Get(Id);
|
Game = await GameService.Get(Id);
|
||||||
|
|
Loading…
Add table
Reference in a new issue