Compare commits

..

No commits in common. "f77481152f8f4d9662ae9ffaf4a2e1775a3b7f7a" and "9e6dd529fe514843ad5fcbfeb2cad7785e4cad07" have entirely different histories.

2 changed files with 2 additions and 32 deletions

View File

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

View File

@ -1,37 +1,6 @@
@page "/sources/list"
@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>
<h3>list</h3>
@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;
}
}