bulletboards/ImageBoardServerApp/Pages/Basic/Index.razor

36 lines
1 KiB
Text
Raw Normal View History

2023-01-18 12:56:24 +00:00
@page "/"
@using ImageBoardServerApp.Data.Repository
2023-02-02 07:15:43 +00:00
@inject AuthenticationStateProvider authStateProvider
2023-01-18 12:56:24 +00:00
<h1>BulletBoard</h1>
<span>This is a simple Imageboard made in Razor.</span>
<br/>
2023-02-07 20:21:38 +00:00
<span>We're currently hosting @amountOfPosts Threads, @amountOfComments Comments and @amountOfUsers Users.</span>
<br/>
2023-02-02 07:15:43 +00:00
<span>@Details</span>
2023-02-12 18:06:33 +00:00
<AuthorizeView>
<Authorized>
<br/>
<a href="/sys/you">Edit your account</a>
</Authorized>
</AuthorizeView>
@code{
2023-02-02 07:15:43 +00:00
private string Details { get; set; }
private int amountOfPosts = -1;
private int amountOfComments = -1;
private int amountOfUsers = -1;
protected override async Task OnParametersSetAsync()
{
var posts = await PostsRepository.getPostsAsync();
amountOfPosts = posts.Count;
var comments = await CommentsRepository.getCommentsAsync();
amountOfComments = comments.Count;
var users = await UsersRepository.getUsersAsync();
amountOfUsers = users.Count;
await base.OnParametersSetAsync();
}
}