diff --git a/src/App.razor b/src/App.razor
index aedf94c..66be981 100644
--- a/src/App.razor
+++ b/src/App.razor
@@ -1,6 +1,88 @@
-
-
-
-
-
-
+
+
+
+
+
+
+ Synentra Console
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+

+
+
+
+ SYNENTRA
+
+
+
+
+
+
+
+ Initializing Console
+
+
+
+
+
+
+ An unhandled error has occurred.
+
Reload
+
🗙
+
+
+
+
+
+
diff --git a/src/Console.csproj b/src/Console.csproj
index 13f9bd4..19473ec 100644
--- a/src/Console.csproj
+++ b/src/Console.csproj
@@ -22,8 +22,6 @@
-
-
diff --git a/src/Extensions/ApplicationBuilderExtensions.cs b/src/Extensions/ApplicationBuilderExtensions.cs
new file mode 100644
index 0000000..1cd3dd5
--- /dev/null
+++ b/src/Extensions/ApplicationBuilderExtensions.cs
@@ -0,0 +1,18 @@
+using Console.Settings;
+
+namespace Console.Extensions;
+
+public static class ApplicationBuilderExtensions
+{
+ public static IApplicationBuilder UseHttps(this IApplicationBuilder app)
+ {
+ var serviceProvider = app.ApplicationServices;
+ var endpointConfiguration = serviceProvider.GetService();
+ if (endpointConfiguration != null && endpointConfiguration.Https?.Enabled == true)
+ {
+ app.UseHttpsRedirection();
+ }
+
+ return app;
+ }
+}
\ No newline at end of file
diff --git a/src/Extensions/ServiceCollectionExtensions.cs b/src/Extensions/ServiceCollectionExtensions.cs
new file mode 100644
index 0000000..64ab9a1
--- /dev/null
+++ b/src/Extensions/ServiceCollectionExtensions.cs
@@ -0,0 +1,45 @@
+using Blazored.LocalStorage;
+using Console.Preferences;
+using Console.Services;
+using Console.Settings;
+using MudBlazor;
+using MudBlazor.Services;
+
+namespace Console.Extensions;
+
+public static class ServiceCollectionExtensions
+{
+ public static IServiceCollection AddConsoleServices(this IServiceCollection services)
+ {
+ services.AddServerSideBlazor();
+ services
+ .AddBlazoredLocalStorage()
+ .AddScoped()
+ .AddScoped()
+ .AddScoped()
+ .AddHttpClient()
+ .AddHttpContextAccessor();
+
+ return services;
+ }
+
+ public static IServiceCollection AddMudBlazor(this IServiceCollection services) =>
+ services.AddMudServices(ConfigureMudSnackbar);
+
+ #region Private Helpers
+
+ private static void ConfigureMudSnackbar(MudServicesConfiguration config)
+ {
+ var snackbar = config.SnackbarConfiguration;
+ snackbar.PositionClass = Defaults.Classes.Position.BottomRight;
+ snackbar.HideTransitionDuration = 500;
+ snackbar.ShowTransitionDuration = 500;
+ snackbar.VisibleStateDuration = 10000;
+ snackbar.PreventDuplicates = false;
+ snackbar.NewestOnTop = false;
+ snackbar.ShowCloseIcon = true;
+ snackbar.SnackbarVariant = Variant.Filled;
+ }
+
+ #endregion
+}
\ No newline at end of file
diff --git a/src/Extensions/WebApplicationBuilderExtensions.cs b/src/Extensions/WebApplicationBuilderExtensions.cs
new file mode 100644
index 0000000..2f7a736
--- /dev/null
+++ b/src/Extensions/WebApplicationBuilderExtensions.cs
@@ -0,0 +1,82 @@
+using Console.Settings;
+
+namespace Console.Extensions;
+
+public static class WebApplicationBuilderExtensions
+{
+ public static WebApplicationBuilder ConfigureHttpServer(this WebApplicationBuilder builder)
+ {
+ var endpointConfiguration = new EndpointConfiguration();
+ builder.Configuration.GetSection("Endpoints").Bind(endpointConfiguration);
+ builder.Services.AddSingleton(endpointConfiguration);
+
+ using var scope = builder.Services.BuildServiceProvider().CreateScope();
+ var logger = scope.ServiceProvider.GetRequiredService>();
+
+ ConfigureKestrelEndpoints(builder, endpointConfiguration, logger);
+ ConfigureKestrelSettings(builder);
+
+ return builder;
+ }
+
+ private static void ConfigureKestrelEndpoints(
+ WebApplicationBuilder builder,
+ EndpointConfiguration config,
+ ILogger logger)
+ {
+ builder.WebHost.ConfigureKestrel((_, options) =>
+ {
+ var httpPort = config.Http?.Port ?? 8180;
+ int? httpsPort = null;
+
+ if (config.Https?.Enabled == true)
+ {
+ httpsPort = config.Https.Port ?? 8443;
+
+ if (httpsPort == httpPort)
+ throw new InvalidOperationException($"HTTP and HTTPS endpoint ports cannot be the same: {httpPort}");
+ }
+
+ options.ListenAnyIP(httpPort);
+
+ if (httpsPort.HasValue)
+ {
+ options.ListenAnyIP(httpsPort.Value, listenOptions =>
+ {
+ var cert = config.Https!.Certificate;
+
+ if (cert != null)
+ {
+ if (!string.IsNullOrWhiteSpace(cert.Password))
+ {
+ listenOptions.UseHttps(cert.Path, cert.Password);
+ }
+ else
+ {
+ listenOptions.UseHttps(cert.Path);
+ }
+ }
+ else
+ {
+ listenOptions.UseHttps();
+ }
+ });
+
+ logger.LogInformation("Configuring HTTP and HTTPS endpoints: HTTP {HttpPort}, HTTPS {HttpsPort}", httpPort, httpsPort);
+ }
+ else
+ {
+ logger.LogInformation("Configuring HTTP endpoint only: HTTP {HttpPort}", httpPort);
+ }
+ });
+ }
+
+ private static void ConfigureKestrelSettings(WebApplicationBuilder builder)
+ {
+ builder.WebHost.UseKestrel(options =>
+ {
+ options.AddServerHeader = false;
+ options.Limits.MaxRequestBufferSize = null;
+ });
+ }
+}
\ No newline at end of file
diff --git a/src/Layout/MainLayout.razor b/src/Layout/MainLayout.razor
index c95934a..2dff7fd 100644
--- a/src/Layout/MainLayout.razor
+++ b/src/Layout/MainLayout.razor
@@ -60,6 +60,7 @@
_isDarkMode = await PreferenceManager.IsDarkTheme();
_drawerOpen = await PreferenceManager.IsDrawerOpenAsync();
_initialized = true;
+ await JS.InvokeVoidAsync("synentraLoader.dismiss");
StateHasChanged();
}
}
diff --git a/src/wwwroot/index.html b/src/Pages/_Host.cshtml
similarity index 58%
rename from src/wwwroot/index.html
rename to src/Pages/_Host.cshtml
index 253ccf6..963183e 100644
--- a/src/wwwroot/index.html
+++ b/src/Pages/_Host.cshtml
@@ -1,3 +1,8 @@
+@page "/"
+@namespace Console.Pages
+@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
+@using Microsoft.AspNetCore.Components.Web
+
@@ -5,8 +10,7 @@
Synentra Console
-
-
+
@@ -31,35 +35,11 @@
document.documentElement.classList.add(themeClass);
})();
-
+
-
-
-
-
-

-
-
-
- SYNENTRA
-
-
-
-
-
-
-
- Initializing Console
-
-
-
+
An unhandled error has occurred.
@@ -67,7 +47,7 @@
🗙
-
+