From ec2e4113c10b19d435995f6df75c15a89f1d305d Mon Sep 17 00:00:00 2001 From: James Tombleson Date: Mon, 12 Jun 2023 13:16:07 -0700 Subject: [PATCH] adding a basic page to dump sources --- Newsbot.Portal.Blazor.Server/Global.cs | 1 - .../Pages/Sources/List.razor | 33 ++++++++++++++++++- 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/Newsbot.Portal.Blazor.Server/Global.cs b/Newsbot.Portal.Blazor.Server/Global.cs index 9bc1ab7..0eda7bd 100644 --- a/Newsbot.Portal.Blazor.Server/Global.cs +++ b/Newsbot.Portal.Blazor.Server/Global.cs @@ -4,5 +4,4 @@ public static class Global { public static HttpClient HttpClient { get; set; } public static string? DefaultInstanceUri { get; set; } - } \ No newline at end of file diff --git a/Newsbot.Portal.Blazor.Server/Pages/Sources/List.razor b/Newsbot.Portal.Blazor.Server/Pages/Sources/List.razor index 5a07999..aa1b953 100644 --- a/Newsbot.Portal.Blazor.Server/Pages/Sources/List.razor +++ b/Newsbot.Portal.Blazor.Server/Pages/Sources/List.razor @@ -1,6 +1,37 @@ @page "/sources/list" -

list

+@using Newsbot.Collector.Client +@using Newsbot.Collector.Client.Domain.Dto + +

Available Sources

+ + + + + + + @foreach (var item in Data ??= new List()) + { + if (!item.Enabled) + { + continue; + } + + + + + + } +
TitlePublish Date
+ @item.Name
+
@item.Source
@code { + private List Data { get; set; } + protected override async Task OnInitializedAsync() + { + var c = new SourcesClient(Global.HttpClient, Global.DefaultInstanceUri ?? ""); + var items = await c.ListAsync(); + Data = items; + } } \ No newline at end of file -- 2.45.2