diff --git a/src/EventLogExpert/Main.razor b/src/EventLogExpert/Main.razor index 0d11f98f..690f0ef4 100644 --- a/src/EventLogExpert/Main.razor +++ b/src/EventLogExpert/Main.razor @@ -1,12 +1,15 @@ - - - - - - - - -

Sorry, there's nothing at this address.

-
-
-
+ + + + + + + + + + +

Sorry, there's nothing at this address.

+
+
+
+
diff --git a/src/EventLogExpert/MauiProgram.cs b/src/EventLogExpert/MauiProgram.cs index a0a0cbf2..e125a40b 100644 --- a/src/EventLogExpert/MauiProgram.cs +++ b/src/EventLogExpert/MauiProgram.cs @@ -28,8 +28,9 @@ public static MauiApp CreateMauiApp() builder.Services.AddMauiBlazorWebView(); - if (Environment.GetCommandLineArgs().Contains("/EnableConsole", StringComparer.OrdinalIgnoreCase) || - Environment.Version.CompareTo(new Version("9.0.0")) == 0) +#if RELEASE + if (Environment.GetCommandLineArgs().Contains("/EnableConsole", StringComparer.OrdinalIgnoreCase)) +#endif { builder.Services.AddBlazorWebViewDeveloperTools(); } diff --git a/src/EventLogExpert/Shared/MainLayout.razor b/src/EventLogExpert/Shared/MainLayout.razor index fdb94010..2f3d3964 100644 --- a/src/EventLogExpert/Shared/MainLayout.razor +++ b/src/EventLogExpert/Shared/MainLayout.razor @@ -1,9 +1,9 @@ -@using EventLogExpert.Shared.Components +@using EventLogExpert.Components +@using EventLogExpert.Shared.Components @using EventLogExpert.Shared.Components.Filters -@using EventLogExpert.Components @inherits LayoutComponentBase -
+
@@ -12,10 +12,10 @@ -
+
+
-
diff --git a/src/EventLogExpert/Shared/MainLayout.razor.css b/src/EventLogExpert/Shared/MainLayout.razor.css deleted file mode 100644 index 5acf2da9..00000000 --- a/src/EventLogExpert/Shared/MainLayout.razor.css +++ /dev/null @@ -1,7 +0,0 @@ -.display_layout { - display: flex; - flex-direction: column; - - /* 20px offset for status bar - Adjust later if file menu gets adjusted */ - height: calc(100vh - 20px); -} diff --git a/src/EventLogExpert/Shared/UnhandledExceptionHandler.razor b/src/EventLogExpert/Shared/UnhandledExceptionHandler.razor new file mode 100644 index 00000000..08caac91 --- /dev/null +++ b/src/EventLogExpert/Shared/UnhandledExceptionHandler.razor @@ -0,0 +1,18 @@ +@inherits ErrorBoundary + +@if (CurrentException is null) +{ + @ChildContent +} +else if (ErrorContent is not null) +{ + @ErrorContent(CurrentException) +} +else +{ +
+ @ChildContent + +
+
+} diff --git a/src/EventLogExpert/Shared/UnhandledExceptionHandler.razor.cs b/src/EventLogExpert/Shared/UnhandledExceptionHandler.razor.cs new file mode 100644 index 00000000..95862b04 --- /dev/null +++ b/src/EventLogExpert/Shared/UnhandledExceptionHandler.razor.cs @@ -0,0 +1,21 @@ +// // Copyright (c) Microsoft Corporation. +// // Licensed under the MIT License. + +using EventLogExpert.Eventing.Helpers; +using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components.Web; +using Microsoft.Extensions.Logging; + +namespace EventLogExpert.Shared; + +public partial class UnhandledExceptionHandler : ErrorBoundary +{ + [Inject] private ITraceLogger TraceLogger { get; set; } = null!; + + protected override Task OnErrorAsync(Exception exception) + { + TraceLogger.Trace($"Unhandled exception in UI:\r\n{exception}", LogLevel.Critical); + + return base.OnErrorAsync(exception); + } +} diff --git a/src/EventLogExpert/wwwroot/css/app.css b/src/EventLogExpert/wwwroot/css/app.css index 3ceaa328..6d922c10 100644 --- a/src/EventLogExpert/wwwroot/css/app.css +++ b/src/EventLogExpert/wwwroot/css/app.css @@ -60,6 +60,7 @@ html, body { .page { display: flex; flex-direction: column; + height: 100%; background-color: var(--background-dark); color: var(--clr-lightblue); } diff --git a/src/EventLogExpert/wwwroot/index.html b/src/EventLogExpert/wwwroot/index.html index 74db7443..bc3decdb 100644 --- a/src/EventLogExpert/wwwroot/index.html +++ b/src/EventLogExpert/wwwroot/index.html @@ -14,7 +14,7 @@
-
Loading...
+
Loading...
An unhandled error has occurred.