Skip to content

Commit

Permalink
Cherry-Picked from "Merge pull request #396 from RecursosOnline/master".
Browse files Browse the repository at this point in the history
  • Loading branch information
Киршин Максим committed Jun 3, 2024
1 parent 4f84d77 commit dfb63e8
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions OrleansDashboard/Dashboard.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,37 @@
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
{
public sealed class Dashboard : IStartupTask, IDisposable
public sealed class Dashboard : IStartupTask, IDisposable
{
private IWebHost host;
private readonly ILogger<Dashboard> logger;
private readonly ILocalSiloDetails localSiloDetails;
private readonly IGrainFactory grainFactory;
private readonly DashboardOptions dashboardOptions;
private readonly IAssetProvider assetProvider;
private readonly DashboardOptions dashboardOptions;

public static int HistoryLength => 100;

public Dashboard(
ILogger<Dashboard> logger,
ILocalSiloDetails localSiloDetails,
IGrainFactory grainFactory,
IOptions<DashboardOptions> dashboardOptions)
IOptions<DashboardOptions> dashboardOptions,
IAssetProvider assetProvider)
{
this.logger = logger;
this.grainFactory = grainFactory;
this.localSiloDetails = localSiloDetails;
this.assetProvider = assetProvider;
this.dashboardOptions = dashboardOptions.Value;
}

Expand All @@ -43,7 +48,9 @@ public async Task Execute(CancellationToken cancellationToken)
new WebHostBuilder()
.ConfigureServices(services =>
{
services.AddServicesForHostedDashboard(grainFactory, dashboardOptions);
//Add IAssetProvider [EmbeddedAssetProvider]
services.AddSingleton(assetProvider);
services.AddServicesForHostedDashboard(grainFactory, dashboardOptions);
})
.Configure(app =>
{
Expand Down

0 comments on commit dfb63e8

Please sign in to comment.