Hangfire: Can Dashboard user interface be extended?

Created on 26 Jul 2016  路  5Comments  路  Source: HangfireIO/Hangfire

We have been enjoying using Hangfire for adding Data Import Jobs. It would be also great to extend the user interface, in order to add additional functionality. Is there a way to extend the existing User Interface? For instance adding new tabs, pages, include additional JS files etc.

question

Most helpful comment

Actually, it can be extended, and there are following extension points:

  • Routes through the DashboardRoutes.Routes
  • Pages through the RazorGenerator extension for Visual Studio, and RazorPage base class.
  • Navigation menu items through the NavigationMenu class
  • Job sidebar menu items through the JobsSidebarMenu class.

So you can add pages, new routes, menu items, etc. without recompiling Hangfire. Please see the source code for this classes for examples.

All 5 comments

A cheap solution would be to add it as an iframe to your existing site. As far as I know, it's not easy to extend the current dashboard, unless you fork Hangfire and modify it locally.

I see. Thanks for the info :)

Actually, it can be extended, and there are following extension points:

  • Routes through the DashboardRoutes.Routes
  • Pages through the RazorGenerator extension for Visual Studio, and RazorPage base class.
  • Navigation menu items through the NavigationMenu class
  • Job sidebar menu items through the JobsSidebarMenu class.

So you can add pages, new routes, menu items, etc. without recompiling Hangfire. Please see the source code for this classes for examples.

Thanks odinserj, You got me on the right path. I used this code in my startup class to add a custom menu item, but it can be called everywhere since navigationMenu is static:

 NavigationMenu.Items.Add(page => new MenuItem("Title of my menu item", "/url/to/mypage"));

And how to extend existing Dashboard pages? Let's say I want to add another button into Recurring Jobs page.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dealproc picture dealproc  路  3Comments

nsnail picture nsnail  路  3Comments

pwueje picture pwueje  路  4Comments

cindro picture cindro  路  3Comments

osmanrahimi picture osmanrahimi  路  3Comments