adding a basic page to dump sources
All checks were successful
continuous-integration/drone/pr Build is passing
All checks were successful
continuous-integration/drone/pr Build is passing
This commit is contained in:
parent
9e6dd529fe
commit
ec2e4113c1
@ -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; }
|
||||||
|
|
||||||
}
|
}
|
@ -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;
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user