Coder Social home page Coder Social logo

hangfire.missioncontrol's Introduction

Hangfire.MissionControl

NuGet NuGet Tests

A plugin for Hangfire that enables you to launch jobs manually.

dashboard

Read about hangfire here: https://github.com/HangfireIO/Hangfire#hangfire- and here: http://hangfire.io/

Instructions

  • Install NuGet package
  • Decorate your code with attributes (all parameters are optional)
[MissionLauncher(CategoryName = "Emails")]
public class EmailSenderMissions
{
    [Mission(Name = "Send email", 
        Description = "Send email to customer", 
        Queue = "emails")]
    public string SendEmail(int customerId, string displayName) => //...code;
}
  • Setup dashboard code
// ASP.NET Core
services.AddHangfire(configuration =>
{
    ...
    configuration.UseMissionControl(
        new MissionControlOptions
        {
            RequireConfirmation = false, // disables confirmation popup
            HideCodeSnippet = false // hides code snippet and queue on missions page
        },
        typeof(TestSuite).Assembly);
});

// Or console application
GlobalConfiguration.Configuration.UseMissionControl(typeof(EmailSenderMissions).Assembly);

License

Authored by: Viktor Svyatokha (ahydrax)

This project is under MIT license. You can obtain the license copy here.

hangfire.missioncontrol's People

Contributors

ahydrax avatar chadburggraf avatar liminiens avatar thomas-illiet avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hangfire.missioncontrol's Issues

Customize parameter handling

Hi and thank you for a great project first of all!

We have some jobs with specialized parameters that needs to be handled the same way as e.g. PerformContext and CancellationToken so they are not required to invoke the mission (they are instantiated by the Hangfire pipeline), but that is not customizable in the current version.

It seems to be handled by the following internal static classes:

  1. MissionParameterParser: https://github.com/ahydrax/Hangfire.MissionControl/blob/master/src/Hangfire.MissionControl/Launching/MissionParameterParser.cs
  2. ControlFactory: https://github.com/ahydrax/Hangfire.MissionControl/blob/master/src/Hangfire.MissionControl/Dashboard/Pages/Controls/ControlFactory.cs

Would you be willing to consider adding such functionality to the project?

If you dont mind, I can probably do a pull-request with a suggested approach at some point.
Currently I am thinking about adding a Func to the MissionControlOptions class to support adding custom mappings of MissionParameters and RazorPage controls based on the type. That would probably require some refactoring's though.

Protect mission page/endpoint

Hello @ahydrax,

Do you have any idea to protect mission control with the following configuration:

app.UseHangfireDashboard("/hangfire", new DashboardOptions
{
    IsReadOnlyFunc = (DashboardContext context) => true
});

Kind regards
ThomaK

Allow to use interface

Hello guys,

On my project, I use a divided project (server / dashboard) with a common project to share the definition of the job interface.

Can you update the use of the MissionLauncherAttribute attribute, to be able to use it on the interface?

Kind regards,
Thomas

Upgrade to Hangfire 1.8

Package requires Hangfire.Core (>= 1.7.3 && <= 1.8.0).
Any news on updating this package to support 1.8+?

Cross-site Scripting Vulnerability in Hangfire.Core < v1.7.3

I respectfully request that Hangfire.MissionControl be updated to require a minimum version of v1.7.3 of Hangfire.Core as previous versions contained an XSS vulnerability. Currently, Hangfire.MissionControl.csproj allows for versions 1.7 up to, but not including, 1.8 (<PackageReference Include="Hangfire.Core" Version="[1.7, 1.8)" />).

I would be more than happy to create a Pull Request for this, however the Hangfire.MissionControl.Tests.Web package requires net6.0 and we are locked-down to VS2019 at work. I cannot, in good conscience, just change the minimum version number of Hangfire.Core within the Hangfire.MissionControl project without the ability to run the tests before submitting the PR.

Henceforth, this Issue request for another contributor to do so.

Thank you.

Support enum

Hi! Thanks for this lib !

What do you think to support enum values ?

An ideia:

Render a dropdown with enum values, option text should use Description attribute.

Allow creating Missions without Attributes

Instead of having to declare a lot of missions manually through attributes, I would like to create missions by passing in a collection of Mission objects into the UseMissionControl extension method.

That way I could build my own logic on how to define missions which would integrate into our code that we are already using for defining jobs.

For that to work, UseMissionControl would neet to get another overload that takes in an IEnumerable<Mission> which the existion method could call after it got those from the MissionMapBuilder.
The Mission class would need to be made public and get another constructor that does not rely on Attributes, but just has a bunch of parameters to set everything directly.

Hide code-snippet from Mission Overview Page

Hello,

Is it possible to hide code-snippet from Mission Over View Page? I found it not help so much when reading the usings and namespaces. In other hand, it shows my code to the user.

Thanks.

Show/Hide mission depending on the user

Hi! First of all thank you for your excellent job with MissionControl. It's being really helpful!

I would like to ask if there's any way to show or hide some missions depending on the user.

I have been trying to create an attribute (not a filter as it shouldn't be applied to all missions) without success.

Thank you!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.