2023-04-27 17:23:01 +02:00
|
|
|
@page "/"
|
2023-05-26 21:54:12 +02:00
|
|
|
@page "/dashboard"
|
2023-05-17 16:03:04 +02:00
|
|
|
@using WebSharpRSS.Models;
|
2023-06-25 22:02:15 +02:00
|
|
|
@using SharpRss.Models
|
|
|
|
@using SharpRss.Services
|
2023-04-27 17:23:01 +02:00
|
|
|
|
2023-05-17 16:03:04 +02:00
|
|
|
@inject FeedStateContainer _stateContainer;
|
2023-06-25 22:02:15 +02:00
|
|
|
@inject SyndicationService _service;
|
2023-05-07 18:37:25 +02:00
|
|
|
|
2023-06-25 22:02:15 +02:00
|
|
|
<MudGrid Spacing="2" Class="mx-2" Justify="Justify.FlexStart">
|
|
|
|
@if (_loading)
|
|
|
|
{
|
|
|
|
<MudProgressCircular Indeterminate="true" Color="Color.Primary"/>
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
@foreach (CategoryModel category in _categories)
|
|
|
|
{
|
|
|
|
<MudItem>
|
|
|
|
<DashboardCategoryItemView Category="category"/>
|
|
|
|
</MudItem>
|
|
|
|
}
|
|
|
|
}
|
2023-05-26 21:54:12 +02:00
|
|
|
</MudGrid>
|
2023-04-27 17:23:01 +02:00
|
|
|
|
|
|
|
@code {
|
2023-06-25 22:02:15 +02:00
|
|
|
bool _loading = true;
|
|
|
|
HashSet<CategoryModel> _categories = new HashSet<CategoryModel>();
|
|
|
|
|
|
|
|
protected override async void OnInitialized()
|
|
|
|
{
|
|
|
|
await _service.GetCategoriesAsync().ContinueWith(task =>
|
|
|
|
{
|
|
|
|
_categories = task.Result;
|
|
|
|
_loading = false;
|
|
|
|
});
|
|
|
|
}
|
2023-04-27 17:23:01 +02:00
|
|
|
}
|