diff --git a/Moonlight/App/Helpers/SmartTranslateHelper.cs b/Moonlight/App/Helpers/SmartTranslateHelper.cs index 96b45999..309b6300 100644 --- a/Moonlight/App/Helpers/SmartTranslateHelper.cs +++ b/Moonlight/App/Helpers/SmartTranslateHelper.cs @@ -21,7 +21,9 @@ public class SmartTranslateHelper foreach (var line in lines) { var parts = line.Split(";"); - content.Add(parts[0], parts[1]); + + if(!content.ContainsKey(parts[0])) + content.Add(parts[0], parts[1]); } Languages.Add(langKey, content); diff --git a/Moonlight/Shared/Components/ErrorBoundaries/GlobalErrorBoundary.razor b/Moonlight/Shared/Components/ErrorBoundaries/GlobalErrorBoundary.razor index e3771cd8..489a5a6a 100644 --- a/Moonlight/Shared/Components/ErrorBoundaries/GlobalErrorBoundary.razor +++ b/Moonlight/Shared/Components/ErrorBoundaries/GlobalErrorBoundary.razor @@ -52,10 +52,7 @@ else { receivedExceptions.Add(exception); - var user = await IdentityService.Get(); - var id = user == null ? -1 : user.Id; - - Logger.Error($"[{id}] An unhanded exception occured:"); + Logger.Error($"An unhanded exception occured:"); Logger.Error(exception); await base.OnErrorAsync(exception); diff --git a/Moonlight/Shared/Views/Admin/Servers/Manager.razor b/Moonlight/Shared/Views/Admin/Servers/Manager.razor index 06aebefb..1c96755e 100644 --- a/Moonlight/Shared/Views/Admin/Servers/Manager.razor +++ b/Moonlight/Shared/Views/Admin/Servers/Manager.razor @@ -100,23 +100,30 @@ { await lazyLoader.SetText(node.Name); - var containerStats = await NodeService.GetContainerStats(node); - - foreach (var container in containerStats.Containers) + try { - if (Guid.TryParse(container.Name, out Guid uuid)) - { - var server = ServerRepository - .Get() - .Include(x => x.Owner) - .FirstOrDefault(x => x.Uuid == uuid); + var containerStats = await NodeService.GetContainerStats(node); - if (server != null) + foreach (var container in containerStats.Containers) + { + if (Guid.TryParse(container.Name, out Guid uuid)) { - Containers.Add(server, container); + var server = ServerRepository + .Get() + .Include(x => x.Owner) + .FirstOrDefault(x => x.Uuid == uuid); + + if (server != null) + { + Containers.Add(server, container); + } } } } + catch (Exception) + { + // ignored + } } } diff --git a/Moonlight/Shared/Views/Domains/Index.razor b/Moonlight/Shared/Views/Domains/Index.razor index e98fc70d..87bdfe4d 100644 --- a/Moonlight/Shared/Views/Domains/Index.razor +++ b/Moonlight/Shared/Views/Domains/Index.razor @@ -3,49 +3,69 @@ @using Moonlight.App.Repositories.Domains @using Moonlight.App.Database.Entities @using Microsoft.EntityFrameworkCore -@using BlazorTable -@using Moonlight.App.Services -@using domain = Moonlight.App.Database.Entities.Domain @inject DomainRepository DomainRepository -@inject DomainService DomainService -@inject SmartTranslateService SmartTranslateService - @foreach (var domain in domains) + @if (Domains.Any()) { -
-
-
-
-
-
- -
- + } + } + else + { +
+
+

+ You have no domains +

+ + We were not able to find any domains associated with your account +
} @code { + [CascadingParameter] public User? User { get; set; } - - private domain[] domains { get; set; } - - public async Task Load(LazyLoader loader) + + private Domain[] Domains { get; set; } + + private Task Load(LazyLoader loader) { - domains = DomainRepository + Domains = DomainRepository .Get() .Include(x => x.SharedDomain) .Include(x => x.Owner) .Where(x => x.Owner == User) .ToArray(); + + return Task.CompletedTask; } + } \ No newline at end of file diff --git a/Moonlight/Shared/Views/Servers/Index.razor b/Moonlight/Shared/Views/Servers/Index.razor index d5cd8c68..d2047485 100644 --- a/Moonlight/Shared/Views/Servers/Index.razor +++ b/Moonlight/Shared/Views/Servers/Index.razor @@ -73,8 +73,15 @@ } else { -
- No servers found +
+
+

+ You have no servers +

+ + We were not able to find any servers associated with your account + +
} @@ -84,8 +91,8 @@ [CascadingParameter] public User User { get; set; } - private App.Database.Entities.Server[] AllServers; - private readonly Dictionary StatusCache = new(); + private Server[] AllServers; + private readonly Dictionary StatusCache = new(); private Task Load(LazyLoader arg) { diff --git a/Moonlight/Shared/Views/Websites/Index.razor b/Moonlight/Shared/Views/Websites/Index.razor index 6bf9dd88..47d773b4 100644 --- a/Moonlight/Shared/Views/Websites/Index.razor +++ b/Moonlight/Shared/Views/Websites/Index.razor @@ -1 +1,69 @@ -@page "/websites" \ No newline at end of file +@page "/websites" +@using Moonlight.App.Database.Entities +@using Moonlight.App.Repositories +@using Microsoft.EntityFrameworkCore + +@inject WebsiteRepository WebsiteRepository + + + @if (Websites.Any()) + { + foreach (var website in Websites) + { + + } + } + else + { +
+
+

+ You have no websites +

+ + We were not able to find any websites associated with your account + +
+
+ } +
+ +@code +{ + [CascadingParameter] + public User User { get; set; } + + private Website[] Websites; + + private Task Load(LazyLoader lazyLoader) + { + Websites = WebsiteRepository + .Get() + .Include(x => x.Owner) + .Include(x => x.PleskServer) + .Where(x => x.Owner.Id == User.Id) + .ToArray(); + + return Task.CompletedTask; + } +} diff --git a/Moonlight/resources/lang/de_de.lang b/Moonlight/resources/lang/de_de.lang index 3fe0ffb3..6bb869e6 100644 --- a/Moonlight/resources/lang/de_de.lang +++ b/Moonlight/resources/lang/de_de.lang @@ -557,3 +557,9 @@ Saving...;Saving... Deleting...;Deleting... Delete post;Delete post Do you really want to delete the post ";Do you really want to delete the post " +You have no domains;You have no domains +We were not able to find any domains associated with your account;We were not able to find any domains associated with your account +You have no websites;You have no websites +We were not able to find any websites associated with your account;We were not able to find any websites associated with your account +Guest;Guest +You need a domain;You need a domain