diff --git a/Moonlight/Shared/Components/Partials/SidebarMenu.razor b/Moonlight/Shared/Components/Partials/SidebarMenu.razor index 2d82030..c7e6c69 100644 --- a/Moonlight/Shared/Components/Partials/SidebarMenu.razor +++ b/Moonlight/Shared/Components/Partials/SidebarMenu.razor @@ -52,14 +52,6 @@ else Websites -
@@ -50,27 +53,6 @@
-
-
-
-
-
-
- Databases -
- - @(DatabaseCount) - -
-
- - - -
-
-
-
-
@@ -80,7 +62,7 @@ Domains - 0 + @(DomainCount)
@@ -119,15 +101,17 @@ @code { - private int DatabaseCount = 0; private int ServerCount = 0; private int UserCount = 0; + private int DomainCount = 0; + private int WebsiteCount = 0; private Task Load(LazyLoader lazyLoader) { - DatabaseCount = 0; ServerCount = ServerRepository.Get().Count(); UserCount = UserRepository.Get().Count(); + DomainCount = DomainRepository.Get().Count(); + WebsiteCount = WebsiteRepository.Get().Count(); return Task.CompletedTask; } diff --git a/Moonlight/Shared/Views/Index.razor b/Moonlight/Shared/Views/Index.razor index 585cac6..3a8162d 100644 --- a/Moonlight/Shared/Views/Index.razor +++ b/Moonlight/Shared/Views/Index.razor @@ -3,8 +3,12 @@ @using Moonlight.App.Repositories.Servers @using Microsoft.EntityFrameworkCore @using Moonlight.App.Database.Entities +@using Moonlight.App.Repositories +@using Moonlight.App.Repositories.Domains @inject ServerRepository ServerRepository +@inject WebsiteRepository WebsiteRepository +@inject DomainRepository DomainRepository
@@ -38,7 +42,7 @@ Websites - 0 + @(WebsiteCount)
@@ -50,27 +54,6 @@
-
-
-
-
-
-
- Databases -
- - @(DatabaseCount) - -
-
- - - -
-
-
-
-
@@ -80,7 +63,7 @@ Domains - 0 + @(DomainCount)
@@ -119,20 +102,6 @@
-
-
- -
-
- - Create a database - - - A quick way to store your data and manage it from all around the world - -
-
-
@@ -188,20 +157,6 @@
-
-
- -
-
- - Manage your databases - - - Insert, delete and update the data in your databases - -
-
-
@@ -239,16 +194,27 @@ [CascadingParameter] public User User { get; set; } - private int DatabaseCount = 0; private int ServerCount = 0; + private int DomainCount = 0; + private int WebsiteCount = 0; - private async Task Load(LazyLoader lazyLoader) + private Task Load(LazyLoader lazyLoader) { - DatabaseCount = 0; - ServerCount = ServerRepository .Get() .Include(x => x.Owner) .Count(x => x.Owner.Id == User.Id); + + DomainCount = DomainRepository + .Get() + .Include(x => x.Owner) + .Count(x => x.Owner.Id == User.Id); + + WebsiteCount = WebsiteRepository + .Get() + .Include(x => x.Owner) + .Count(x => x.Owner.Id == User.Id); + + return Task.CompletedTask; } } \ No newline at end of file