Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
c812cbb
Compile Hangfire.Core agains NETStandard 1.3
odinserj Jun 28, 2016
289d7f0
Get rid of "project.json doesn't have a runtimes section" message
odinserj Jun 28, 2016
ade4e37
Don't compile obsolete members under .NET Core
odinserj Jun 29, 2016
be438fd
Add all the required dashboard abstractions
odinserj Jun 29, 2016
587678a
Add MvcCoreSample project based on ASP.NET Core
odinserj Jun 29, 2016
36c2482
Add Hangfire.SqlServer.NetCore project
odinserj Jun 29, 2016
ae09f80
Add dashboard middleware
odinserj Jun 29, 2016
4d67a41
Use portable projects based on .NET Standard target
odinserj Jun 30, 2016
9440086
Merge remote-tracking branch 'refs/remotes/origin/dev' into netcore
odinserj Jun 30, 2016
6791c26
Merge remote-tracking branch 'refs/remotes/origin/dev' into netcore
odinserj Jun 30, 2016
59381d2
Remove some conditional defines to minimize branches
odinserj Jun 30, 2016
a7693a3
Add missing StateContext class link to NetStandard
odinserj Jun 30, 2016
7857965
Add own internal ExcludeFromCodeCoverageAttribute
odinserj Jun 30, 2016
9596ef5
Add the blank line that was removed by an accident
odinserj Jun 30, 2016
94e91d1
Add missing file headers
odinserj Jun 30, 2016
238216a
Temporarily disable compiling recurring jobs
odinserj Jul 1, 2016
d1e40f3
Update nuspec and project.json files
odinserj Jul 1, 2016
da7acee
Allow to build NuGet package for Hangfire.AspNetCore
odinserj Jul 1, 2016
46370a5
Exclude **\obj\* files from symbol packages
odinserj Jul 1, 2016
a0c03a7
Fix ServerHeartbeatFacts
odinserj Jul 1, 2016
b8c40a8
Move netstandard project to the same project folder as net45
odinserj Jul 1, 2016
3562bfe
Remove diffs with `dev` branch that don't make sense
odinserj Jul 1, 2016
696bdc3
Remove other unnecessary differences
odinserj Jul 1, 2016
f1e6ba0
Move obsolete files to the Obsolete folder
odinserj Jul 1, 2016
1988bfa
Fix Hangfire.Core.csproj
odinserj Jul 1, 2016
6831c01
Pass transaction instance to Dapper queries
odinserj Jul 1, 2016
ad18001
Reduce conditional branches in SqlServerStorage
odinserj Jul 1, 2016
deeeaeb
Lower the verbosity of NuGet install command
odinserj Jul 1, 2016
b4dd256
Pass transaction instance to the SqlServerJobQueue.Enqueue method
odinserj Jul 4, 2016
2ae291f
Add Microsoft.NETCore.Portable.Compatibility to the dependency list
odinserj Jul 4, 2016
91cedd5
Add required dependencies to the Hangfire.SqlServer nuspec
odinserj Jul 4, 2016
771e4a6
Move AspNetCore classes to the Dashboard folder
odinserj Jul 4, 2016
fe39dd0
Authorize dashboard requests if no remote ip address found in Core
odinserj Jul 4, 2016
ff35100
Revert authorization filter implementation
odinserj Jul 4, 2016
6d442c8
Add deep integration with ASP.NET Core
odinserj Jul 4, 2016
bfe1983
Add missing System.ComponentModel dependency
odinserj Jul 5, 2016
bab23f4
Revert "Add missing System.ComponentModel dependency"
odinserj Jul 5, 2016
8cc0360
Add missing AspNetCoreJobActivatorScope reference
odinserj Jul 5, 2016
e97dc57
Add missing System.ComponentModel dependency again
odinserj Jul 5, 2016
1211ecf
Remove "imports" directive
odinserj Jul 5, 2016
816d85c
*
odinserj Jul 5, 2016
b374633
Use HOSTNAME environment variable for unix
odinserj Jul 5, 2016
c3b50ac
Export HOSTNAME variable on Travis CI
odinserj Jul 5, 2016
3292f9e
Fix compiler warnings
odinserj Jul 5, 2016
f391d22
Place System.ComponentModel under Microsoft.NETCore.Compatibility
odinserj Jul 5, 2016
931c1d5
Fix Dapper dependency version
odinserj Jul 5, 2016
3d0babc
Add Hangfire.AspNetCore dependency to the Hangfire package
odinserj Jul 5, 2016
b868757
Fix POST method handling in CommandDispatcher
odinserj Jul 5, 2016
2b3b7a3
Remove conditionals for recurring jobs under .NET Core
odinserj Jul 5, 2016
2ca9587
Bring the ServerName option back
odinserj Jul 5, 2016
d7ddfaa
Fix UrlHelper that's working in OWIN environment
odinserj Jul 5, 2016
af97b44
Remove dependency on System.ComponentModel.Primitives in .NET Core
odinserj Jul 5, 2016
6a8aba0
Replace `param` with `paramref` tag to prevent warnings
odinserj Jul 5, 2016
234e808
Simplify the Dapper dependency version value
odinserj Jul 5, 2016
144d35d
Use explicit `targetFramework` sections in nuspec files
odinserj Jul 5, 2016
1090cf4
Place configuration logic to the right place
odinserj Jul 5, 2016
c4990fa
Move Microsoft.NETCore.Portable.Compatibility to the top
odinserj Jul 5, 2016
ea447cf
Migrate to Hangfire.Build 0.2.2
odinserj Jul 7, 2016
5a3c294
Update Hangfire.Build to 0.2.4
odinserj Jul 7, 2016
40ddb00
Update Hangfire.Build to 0.2.5
odinserj Jul 7, 2016
9f14768
Wrap CRON string in a code block on recurring jobs page
odinserj Jul 7, 2016
5e97b9f
Register IGlobalConfiguration instance, remove marker service
odinserj Jul 7, 2016
8e35b1b
Register all the other interfaces and implementations
odinserj Jul 7, 2016
dbca416
Configuration action is now called when JobStorage instance is resolved
odinserj Jul 7, 2016
587801f
Add non-blocking Server.SendStop method, that requests for a shutdown
odinserj Jul 7, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add dashboard middleware
  • Loading branch information
odinserj committed Jun 29, 2016
commit ae09f80820f1d664a7fdf001a78d6ea6fffc4af4
12 changes: 11 additions & 1 deletion samples/MvcCoreSample/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Hangfire;
using Hangfire.Dashboard;
using Hangfire.SqlServer;

namespace MvcCoreSample
{
Expand All @@ -29,6 +32,9 @@ public void ConfigureServices(IServiceCollection services)
{
// Add framework services.
services.AddMvc();
services.AddSingleton<JobStorage>(new SqlServerStorage(@"Server=.\sqlexpress;database=hangfire.sample;integrated security=sspi;"));
services.AddSingleton<DashboardOptions>(new DashboardOptions());
services.AddSingleton<Hangfire.Dashboard.RouteCollection>(Hangfire.Dashboard.DashboardRoutes.Routes);
}

// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
Expand All @@ -46,9 +52,13 @@ public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerF
{
app.UseExceptionHandler("/Home/Error");
}

app.UseStaticFiles();

GlobalConfiguration.Configuration.UseSqlServerStorage(@"Server=.\sqlexpress;database=hangfire.sample;integrated security=sspi;");

app.UseMiddleware<DashboardMiddleware>();

app.UseMvc(routes =>
{
routes.MapRoute(
Expand Down
5 changes: 3 additions & 2 deletions samples/MvcCoreSample/project.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
{
"dependencies": {
"Microsoft.NETCore.App": {
"version": "1.0.0",
Expand All @@ -20,7 +20,8 @@
"Microsoft.Extensions.Logging.Debug": "1.0.0",
"Microsoft.Extensions.Options.ConfigurationExtensions": "1.0.0",
"Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.0.0",
"Hangfire.Core": "1.6.0-*"
"Hangfire.Core": "1.6.0-*",
"Hangfire.SqlServer": "1.6.0-*"
},

"tools": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,63 @@
#if !NETFULL

using System;
using System.Net;
using System.Threading.Tasks;
using Hangfire.Annotations;
using Microsoft.AspNetCore.Http;

namespace Hangfire.Dashboard
{
public class DashboardMiddleware
{
private readonly RequestDelegate _next;
private readonly JobStorage _storage;
private readonly DashboardOptions _options;
private readonly RouteCollection _routes;

public DashboardMiddleware(
[NotNull] RequestDelegate next,
[NotNull] JobStorage storage,
[NotNull] DashboardOptions options,
[NotNull] RouteCollection routes)
{
if (next == null) throw new ArgumentNullException(nameof(next));
if (storage == null) throw new ArgumentNullException(nameof(storage));
if (options == null) throw new ArgumentNullException(nameof(options));
if (routes == null) throw new ArgumentNullException(nameof(routes));

_next = next;
_storage = storage;
_options = options;
_routes = routes;
}

public Task Invoke(HttpContext httpContext)
{
var context = new AspNetCoreDashboardContext(_storage, _options, httpContext);
var findResult = _routes.FindDispatcher(httpContext.Request.Path.Value);

if (findResult == null)
{
return _next.Invoke(httpContext);
}

// ReSharper disable once LoopCanBeConvertedToQuery
/*foreach (var filter in _options.Authorization)
{
if (!filter.Authorize(context))
{
httpContext.Response.StatusCode = (int) HttpStatusCode.Unauthorized;
return Task.FromResult(false);
}
}*/

context.UriMatch = findResult.Item2;

return findResult.Item1.Dispatch(context);
}
}

public sealed class AspNetCoreDashboardContext : DashboardContext
{
public AspNetCoreDashboardContext(
Expand Down
9 changes: 1 addition & 8 deletions src/Hangfire.Core/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,7 @@

"buildOptions": {
"compile": "**/*.cs",
"configurations": {
"Release": {
"buildOptions": {
"optimize": true,
"xmlDoc": true
}
}
}
"embed": [ "**/*.resources" ],
},

"frameworks": {
Expand Down
3 changes: 2 additions & 1 deletion src/Hangfire.SqlServer/project.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"version": "1.6.0-*",
"buildOptions": {
"compile": "**/*.cs"
"compile": "**/*.cs",
"embed": [ "Install.sql" ]
},
"frameworks": {
"net45": {
Expand Down