コード例 #1
0
 public Dashboard(
     ILogger <Dashboard> logger,
     ILocalSiloDetails localSiloDetails,
     IGrainFactory grainFactory,
     IOptions <DashboardOptions> dashboardOptions)
 {
     this.logger           = logger;
     this.grainFactory     = grainFactory;
     this.localSiloDetails = localSiloDetails;
     this.dashboardOptions = dashboardOptions.Value;
 }
コード例 #2
0
        public static IApplicationBuilder UseOrleansDashboard(this IApplicationBuilder app, DashboardOptions options = null)
        {
            if (string.IsNullOrEmpty(options?.BasePath) || options.BasePath == "/")
            {
                app.UseMiddleware <DashboardMiddleware>();
            }
            else
            {
                // Make sure there is a leading slash
                var basePath = options.BasePath.StartsWith("/") ? options.BasePath : $"/{options.BasePath}";

                app.Map(basePath, a => a.UseMiddleware <DashboardMiddleware>());
            }

            return(app);
        }
 public BasicAuthMiddleware(RequestDelegate next, IOptions <DashboardOptions> options)
 {
     this.next    = next;
     this.options = options.Value;
 }
コード例 #4
0
        internal static IServiceCollection AddServicesForHostedDashboard(this IServiceCollection services, IGrainFactory grainFactory, DashboardOptions options)
        {
            services.AddSingleton(DashboardLogger.Instance);
            services.AddSingleton(Options.Create(options));
            services.AddSingleton <ILoggerProvider>(DashboardLogger.Instance);
            services.AddSingleton(grainFactory);

            return(services);
        }