mirror of https://github.com/abpframework/abp
parent
736b072d09
commit
7a56f78313
@ -0,0 +1,26 @@
|
||||
using System;
|
||||
using Hangfire;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Volo.Abp.BackgroundJobs.Hangfire;
|
||||
|
||||
namespace Microsoft.AspNetCore.Builder;
|
||||
|
||||
public static class AbpHangfireApplicationBuilderExtensions
|
||||
{
|
||||
public static IApplicationBuilder UseAbpHangfireDashboard(
|
||||
this IApplicationBuilder app,
|
||||
string pathMatch = "/hangfire",
|
||||
Action<DashboardOptions>? configure = null,
|
||||
JobStorage? storage = null)
|
||||
{
|
||||
var options = app.ApplicationServices.GetRequiredService<AbpDashboardOptionsProvider>().Get();
|
||||
configure?.Invoke(options);
|
||||
return app.UseHangfireDashboard(pathMatch, options, storage);
|
||||
|
||||
|
||||
app.UseAbpHangfireDashboard("/hangfire", options =>
|
||||
{
|
||||
options.AsyncAuthorization = new[] { new AbpHangfireAuthorizationFilter() };
|
||||
});
|
||||
}
|
||||
}
|
Loading…
Reference in new issue