diff --git a/src/AzureIoTHub.Portal/Client/AzureIoTHub.Portal.Client.csproj b/src/AzureIoTHub.Portal/Client/AzureIoTHub.Portal.Client.csproj index 89d75c3d9..d52b61350 100644 --- a/src/AzureIoTHub.Portal/Client/AzureIoTHub.Portal.Client.csproj +++ b/src/AzureIoTHub.Portal/Client/AzureIoTHub.Portal.Client.csproj @@ -49,6 +49,7 @@ + diff --git a/src/AzureIoTHub.Portal/Client/Program.cs b/src/AzureIoTHub.Portal/Client/Program.cs index 92d4d2d2b..926d16c13 100644 --- a/src/AzureIoTHub.Portal/Client/Program.cs +++ b/src/AzureIoTHub.Portal/Client/Program.cs @@ -19,6 +19,7 @@ namespace AzureIoTHub.Portal.Client using MudBlazor; using MudBlazor.Services; using Tewr.Blazor.FileReader; + using Toolbelt.Blazor.Extensions.DependencyInjection; public static class Program { @@ -29,10 +30,11 @@ public static async Task Main(string[] args) _ = builder.Services.AddTransient(); - _ = builder.Services.AddHttpClient("api", client => + _ = builder.Services.AddHttpClient("api", (sp, client) => { client.BaseAddress = new Uri(builder.HostEnvironment.BaseAddress); client.DefaultRequestHeaders.Add("X-Version", "1.0"); + _ = client.EnableIntercept(sp); }).AddHttpMessageHandler() .AddHttpMessageHandler(); @@ -59,6 +61,10 @@ public static async Task Main(string[] args) await ConfigureOidc(builder); await ConfigurePortalSettings(builder); + // Enable loading bar + builder.Services.AddLoadingBar(); + _ = builder.UseLoadingBar(); + await builder.Build().RunAsync(); }