diff --git a/OrleansDashboard/Dashboard.cs b/OrleansDashboard/Dashboard.cs index b74575af..725f3165 100644 --- a/OrleansDashboard/Dashboard.cs +++ b/OrleansDashboard/Dashboard.cs @@ -4,10 +4,12 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; +using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; using Orleans; using Orleans.Runtime; +using OrleansDashboard.Implementation.Assets; namespace OrleansDashboard { @@ -17,6 +19,7 @@ public sealed class Dashboard : IStartupTask, IDisposable private readonly ILogger logger; private readonly ILocalSiloDetails localSiloDetails; private readonly IGrainFactory grainFactory; + private readonly IAssetProvider assetProvider; private readonly DashboardOptions dashboardOptions; public static int HistoryLength => 100; @@ -25,11 +28,13 @@ public Dashboard( ILogger logger, ILocalSiloDetails localSiloDetails, IGrainFactory grainFactory, - IOptions dashboardOptions) + IOptions dashboardOptions, + IAssetProvider assetProvider) { this.logger = logger; this.grainFactory = grainFactory; this.localSiloDetails = localSiloDetails; + this.assetProvider = assetProvider; this.dashboardOptions = dashboardOptions.Value; } @@ -43,6 +48,8 @@ public async Task Execute(CancellationToken cancellationToken) new WebHostBuilder() .ConfigureServices(services => { + //Add IAssetProvider [EmbeddedAssetProvider] + services.AddSingleton(assetProvider); services.AddServicesForHostedDashboard(grainFactory, dashboardOptions); }) .Configure(app =>