本文整理汇总了C#中IAppBuilder.UseHangfireDashboard方法的典型用法代码示例。如果您正苦于以下问题:C# IAppBuilder.UseHangfireDashboard方法的具体用法?C# IAppBuilder.UseHangfireDashboard怎么用?C# IAppBuilder.UseHangfireDashboard使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IAppBuilder
的用法示例。
在下文中一共展示了IAppBuilder.UseHangfireDashboard方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Configuration
public void Configuration(IAppBuilder app)
{
var config = new HttpConfiguration();
config.MapHttpAttributeRoutes();
config.IncludeErrorDetailPolicy = IncludeErrorDetailPolicy.Always;
config.EnableSwagger("help/{apiVersion}", c =>
{
c.IncludeXmlComments("Slight.WeMo.Service.XML");
c.SingleApiVersion("v1", "Slight.WeMo REST Api");
}).EnableSwaggerUi("help/ui/{*assetPath}");
app.UseWebApi(config);
GlobalConfiguration.Configuration.UseMemoryStorage();
app.UseHangfireDashboard("/hangfire", new DashboardOptions
{
AuthorizationFilters = new IAuthorizationFilter[] { new AllowAllFilter() }
});
app.UseHangfireServer();
app.Use(async (context, func) =>
{
if (new[] { "/", "/help" }.Any(x => context.Request.Path.Value.StartsWith(x)))
{
context.Response.Redirect("/help/ui/index");
return;
}
await func.Invoke();
});
}
示例2: Configuration
public static void Configuration(IAppBuilder app)
{
// Enable the application to use a cookie to store information for the signed in user.
app.UseCookieAuthentication(new CookieAuthenticationOptions
{
AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie,
LoginPath = new PathString("/")
});
// Enable the application to use a cookie to store information about a user logging
// in with a third party login provider.
app.UseExternalSignInCookie(DefaultAuthenticationTypes.ExternalCookie);
// Enable the Reddit authentication provider.
app.UseRedditAuthentication(GetRedditOptions());
GlobalConfiguration.Configuration.UseSqlServerStorage("Hangfire");
app.UseHangfireDashboard("/Hangfire", new DashboardOptions
{
AuthorizationFilters = new[] {new HangfireDashboardAuthorizationFilter(),}
});
app.UseHangfireServer();
RecurringJob.AddOrUpdate<BulkFlairUpdateJob>(FlairJobId, job => job.Execute(), Cron.Minutely);
RecurringJob.AddOrUpdate<BulkLeagueUpdateJob>(LeagueJobId, job => job.Execute(), Cron.Minutely);
}
示例3: Configuration
public void Configuration(IAppBuilder app)
{
GlobalConfiguration.Configuration.UseMongoStorage("mongodb://localhost", "StrawHatEntertainment");
app.UseHangfireDashboard("/jobs");
JobSchedulerConfig.RegisterJobs();
// For more information on how to configure your application, visit http://go.microsoft.com/fwlink/?LinkID=316888
}
示例4: InitHangfire
private void InitHangfire(IAppBuilder app)
{
var hangfireConfig = IoC.Container.Resolve<IHangfireConfig>();
GlobalConfiguration.Configuration.UseSqlServerStorage(
hangfireConfig.SqlServerConnectionString,
new SqlServerStorageOptions()
{
PrepareSchemaIfNecessary = true,
QueuePollInterval = TimeSpan.FromSeconds(1)
});
GlobalJobFilters.Filters.Add(new AutomaticRetryAttribute { Attempts = 3 });
app.UseHangfireDashboard("/hangfire", new DashboardOptions
{
AuthorizationFilters = new[] { new MyRestrictiveAuthorizationFilter() }
});
LogProvider.SetCurrentLogProvider(new ElmahLogProvider(LogLevel.Trace));
var options = new BackgroundJobServerOptions
{
WorkerCount = Environment.ProcessorCount * 5
};
app.UseHangfireServer(options);
}
示例5: ConfigureOwin
public void ConfigureOwin(IAppBuilder app, IUnityContainer container)
{
JobStorage.Current = CreateJobStorage(Stage.ConfigureOwin);
// Configure Hangfire dashboard
var securityService = container.Resolve<ISecurityService>();
var moduleInitializerOptions = container.Resolve<IModuleInitializerOptions>();
var appPath = "/" + moduleInitializerOptions.RoutePrefix;
var authorizationFilters = new[]
{
new PermissionBasedAuthorizationFilter(securityService)
{
Permission = PredefinedPermissions.BackgroundJobsManage
}
};
var dashboardOptions = new DashboardOptions
{
AppPath = appPath,
AuthorizationFilters = authorizationFilters
};
app.UseHangfireDashboard(appPath + "hangfire", dashboardOptions);
// Configure Hangfire server
if (_options.StartServer)
{
app.UseHangfireServer(new BackgroundJobServerOptions { Activator = new UnityJobActivator(container) });
}
}
示例6: Configuration
public void Configuration(IAppBuilder app)
{
HangfireConfiguration.Register();
var options = new DashboardOptions
{
AuthorizationFilters = new []
{
new BasicAuthAuthorizationFilter(new BasicAuthAuthorizationFilterOptions
{
RequireSsl = true,
LoginCaseSensitive = true,
Users = new []
{
new BasicAuthAuthorizationUser
{
Login = "[email protected]",
PasswordClear = "D3v3L0pM3nT"
}
}
}),
}
};
app.UseHangfireDashboard("/hangfire", options);
app.UseHangfireServer();
}
示例7: ConfigureHangfire
public static void ConfigureHangfire(IAppBuilder app)
{
GlobalConfiguration.Configuration.UseSqlServerStorage("DefaultConnection");
app.UseHangfireDashboard("/jobs");
app.UseHangfireServer();
}
示例8: Configuration
public void Configuration(IAppBuilder app)
{
app.UseOAuthBearerAuthentication(AccountController.OAuthBearerOptions);
app.UseCookieAuthentication(new CookieAuthenticationOptions
{
AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie,
LoginPath = new PathString("/Account/Login")
});
app.UseExternalSignInCookie(DefaultAuthenticationTypes.ExternalCookie);
if (IsTrue("ExternalAuth.Facebook.IsEnabled"))
{
app.UseFacebookAuthentication(CreateFacebookAuthOptions());
}
if (IsTrue("ExternalAuth.Twitter.IsEnabled"))
{
app.UseTwitterAuthentication(CreateTwitterAuthOptions());
}
if (IsTrue("ExternalAuth.Google.IsEnabled"))
{
app.UseGoogleAuthentication(CreateGoogleAuthOptions());
}
app.UseHangfireDashboard(); //Enable hangfire dashboard.
}
示例9: Configuration
public void Configuration(IAppBuilder app)
{
var authorizationFilter = new BasicAuthAuthorizationFilter(
new BasicAuthAuthorizationFilterOptions
{
// Require secure connection for dashboard
RequireSsl = true,
// Case sensitive login checking
LoginCaseSensitive = true,
// Users
Users = new[]
{
new BasicAuthAuthorizationUser
{
Login = "[email protected]",
PasswordClear = "passW0rd!"
}
}
});
var options = new DashboardOptions
{
AuthorizationFilters = new IAuthorizationFilter[]
{
authorizationFilter
}
};
GlobalConfiguration.Configuration.UseSqlServerStorage("DefaultConnection");
app.UseHangfireDashboard("/hangfire", options);
app.UseHangfireServer();
ConfigureAuth(app);
}
示例10: ConfigureHangFire
public void ConfigureHangFire(IAppBuilder app)
{
var storageOptions = new SqlServerStorageOptions
{
InvisibilityTimeout = TimeSpan.FromHours(2),
QueuePollInterval = TimeSpan.FromMinutes(15.0)
};
GlobalConfiguration.Configuration
.UseSqlServerStorage("TrainingManagerDb", storageOptions);
// case msmq installed
/*GlobalConfiguration.Configuration
.UseSqlServerStorage("TrainingManagerDb")
.UseMsmqQueues(@".\hangfire-{0}");*/
var dashboardOptions = new DashboardOptions
{
AuthorizationFilters = new[] { new AuthorizationFilter { Roles = AppConstants.UserRole.Administrator } }
};
app.UseHangfireDashboard("/hangfire", dashboardOptions);
var jobServerOptions = new BackgroundJobServerOptions
{
WorkerCount = 1
};
app.UseHangfireServer(jobServerOptions);
RecurringJob.AddOrUpdate(() => UpdateDaemon.ScheduledCatalogsUpdate(), Cron.Hourly);
}
示例11: Configuration
public void Configuration(IAppBuilder app)
{
ConfigureAuth(app);
GlobalConfiguration.Configuration.UseSqlServerStorage("DefaultConnection");
app.UseHangfireDashboard();
app.UseHangfireServer();
}
示例12: Configuration
public void Configuration(IAppBuilder app)
{
ConfigureAuth(app);
// Map Dashboard to the `http://<your-app>/hangfire` URL.
app.UseHangfireDashboard();
}
示例13: Configuration
public void Configuration(IAppBuilder app)
{
GlobalConfiguration.Configuration
.UseSqlServerStorage("CoopCheck");
app.UseHangfireDashboard();
app.UseHangfireServer();
}
示例14: Configuration
public void Configuration(IAppBuilder app)
{
//Reference connection string for data base of hangfire
GlobalConfiguration.Configuration.UseSqlServerStorage("myConnectionString");
app.UseHangfireServer();
//activate dashboard of hangfire in application
app.UseHangfireDashboard();
}
示例15: Configuration
public void Configuration(IAppBuilder app)
{
GlobalConfiguration.Configuration
.UseSqlServerStorage(@"<your_connection_string>");
app.UseHangfireServer();
app.UseHangfireDashboard();
}