mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
47 lines
1.1 KiB
Plaintext
47 lines
1.1 KiB
Plaintext
@page "/gallery"
|
|
@layout Shared.MainLayout
|
|
|
|
@using Wabbajack.Networking.WabbajackClientApi;
|
|
@using System.Linq;
|
|
@using Wabbajack.DTOs
|
|
|
|
@inject Client _client
|
|
|
|
<div id="content">
|
|
@foreach (ModListItem item in listItems)
|
|
{
|
|
<ModListItem ImageURL=@item.ImageURL Title=@item.Title Description=@item.Description></ModListItem>
|
|
}
|
|
</div>
|
|
|
|
@code {
|
|
List<ModListItem> listItems = new();
|
|
|
|
private class ModListItem
|
|
{
|
|
public readonly string Title;
|
|
public readonly string Description;
|
|
public readonly string ImageURL;
|
|
|
|
public ModListItem(string title, string description, string imageUrl)
|
|
{
|
|
Description = description;
|
|
ImageURL = imageUrl;
|
|
Title = title;
|
|
}
|
|
}
|
|
|
|
protected override async Task OnInitializedAsync()
|
|
{
|
|
try
|
|
{
|
|
ModlistMetadata[] modLists = await _client.LoadLists();
|
|
listItems = modLists.Select(x => new ModListItem(x.Title, x.Description, x.Links.ImageUri)).ToList();
|
|
StateHasChanged();
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
Console.WriteLine(ex);
|
|
}
|
|
}
|
|
} |