Newsbot.Portal/Newsbot.Portal.Blazor.Server/Pages/Articles/Sources.razor

33 lines
722 B
Plaintext
Raw Normal View History

@page "/articles/sources"
@using Newsbot.Collector.Client
@using Newsbot.Collector.Client.Domain.Dto
<h3>Select Source</h3>
<table>
<tr>
<td>Source</td>
<td>Name</td>
<td>Type</td>
</tr>
@foreach (var item in Items ??= new List<SourcesDto>())
{
<tr>
<td>@item.Source</td>
<td>
<a href="/articles/sources/@item.Id">@item.Name</a>
</td>
<td>@item.Type</td>
</tr>
}
</table>
@code {
private List<SourcesDto>? Items { get; set; }
protected override async Task OnInitializedAsync()
{
var c = new SourcesClient(Global.HttpClient, Global.DefaultInstanceUri ?? "");
Items = await c.ListAsync();
}
}