adding a basic page to dump sources
All checks were successful
continuous-integration/drone/pr Build is passing

This commit is contained in:
James Tombleson 2023-06-12 13:16:07 -07:00
parent 9e6dd529fe
commit ec2e4113c1
2 changed files with 32 additions and 2 deletions

View File

@ -4,5 +4,4 @@ public static class Global
{ {
public static HttpClient HttpClient { get; set; } public static HttpClient HttpClient { get; set; }
public static string? DefaultInstanceUri { get; set; } public static string? DefaultInstanceUri { get; set; }
} }

View File

@ -1,6 +1,37 @@
@page "/sources/list" @page "/sources/list"
<h3>list</h3> @using Newsbot.Collector.Client
@using Newsbot.Collector.Client.Domain.Dto
<h3>Available Sources</h3>
<table>
<tr>
<td>Title</td>
<td>Publish Date</td>
</tr>
@foreach (var item in Data ??= new List<SourcesDto>())
{
if (!item.Enabled)
{
continue;
}
<tr>
<td>
<a href="@item.Url" target="_blank">@item.Name</a><br/>
</td>
<td>@item.Source</td>
</tr>
}
</table>
@code { @code {
private List<SourcesDto> Data { get; set; }
protected override async Task OnInitializedAsync()
{
var c = new SourcesClient(Global.HttpClient, Global.DefaultInstanceUri ?? "");
var items = await c.ListAsync();
Data = items;
}
} }