Get icons from API. Implement basic search.
This commit is contained in:
parent
0d1513a944
commit
2c102202ef
1 changed files with 3 additions and 12 deletions
|
@ -1,7 +1,7 @@
|
||||||
@page "/Games"
|
@page "/Games"
|
||||||
@inject GameService GameService
|
@inject GameService GameService
|
||||||
|
|
||||||
<MudTable Items="@Games" Hover="true" Elevation="0">
|
<MudTable Items="@Games.Where(g => String.IsNullOrEmpty(Search) || g.Title.ToLower().Contains(Search.ToLower().Trim()))" Hover="true">
|
||||||
<ToolBarContent>
|
<ToolBarContent>
|
||||||
<MudText Typo="Typo.h6">Games</MudText>
|
<MudText Typo="Typo.h6">Games</MudText>
|
||||||
<MudSpacer />
|
<MudSpacer />
|
||||||
|
@ -21,7 +21,7 @@
|
||||||
|
|
||||||
<RowTemplate>
|
<RowTemplate>
|
||||||
<MudTd>
|
<MudTd>
|
||||||
<MudImage Src="@GetIcon(context)" />
|
<MudImage Src="@GetIcon(context)" Height="32" Width="32" />
|
||||||
</MudTd>
|
</MudTd>
|
||||||
<MudTd DataLabel="Title">@context.Title</MudTd>
|
<MudTd DataLabel="Title">@context.Title</MudTd>
|
||||||
<MudTd DataLabel="Sort Title">@context.SortTitle</MudTd>
|
<MudTd DataLabel="Sort Title">@context.SortTitle</MudTd>
|
||||||
|
@ -51,15 +51,6 @@
|
||||||
|
|
||||||
private string GetIcon(Game game)
|
private string GetIcon(Game game)
|
||||||
{
|
{
|
||||||
try
|
return $"/api/Games/{game.Id}/Icon.png";
|
||||||
{
|
|
||||||
var icon = GameService.GetIcon(game);
|
|
||||||
|
|
||||||
return $"data:image/png;base64,{Convert.ToBase64String(icon)}";
|
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue