# CrystalQuartz **Repository Path**: sundayisblue/CrystalQuartz ## Basic Information - **Project Name**: CrystalQuartz - **Description**: pluggable UI for Quartz.NET - **Primary Language**: C# - **License**: MIT - **Default Branch**: master - **Homepage**: https://github.com/guryanovev/CrystalQuartz - **GVP Project**: No ## Statistics - **Stars**: 2 - **Forks**: 0 - **Created**: 2020-10-27 - **Last Updated**: 2022-05-25 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README ![输入图片说明](https://images.gitee.com/uploads/images/2020/1027/170030_b3526243_436641.png "1.png") Crystal Quartz Panel is a lightweight, completely pluggable module for displaying Quartz.NET scheduler jobs information. [![Build Status](https://travis-ci.org/guryanovev/CrystalQuartz.svg?branch=master)](https://travis-ci.org/guryanovev/CrystalQuartz) [![Join the chat at https://gitter.im/guryanovev/CrystalQuartz](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/guryanovev/CrystalQuartz?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) ## [View Demo](http://guryanovev.github.io/CrystalQuartz/demo/?v=6.9.0&utm_source=readme) (serverless, Quartz.NET scheduler is emulated in the browser) ## # Features # * simple and lightweight, could be embedded into existing application: * supports OWIN-based web or standalone applications; * supports non-OWIN web applications; * native support for ASP.NET Core (without OWIN). * displays basic scheduler information: * scheduler state and properties; * triggers by jobs and groups; * job properties (`JobDataMap`); * ability to perform basic scheduler actions: * pause/resume/delete triggers, jobs or groups; * start/shutdown/standby/resume a scheduler; * execute a job on demand ("Trigger Now"); * add a trigger for jobs; * easy integration with a *remote scheduler* (see [examples](https://github.com/guryanovev/CrystalQuartz/tree/master/examples)); * works with Quartz.NET v2 or v3. # Pre Requirements # 1. Quartz.NET v2 or v3 installed to project you want to use as a CrystalQuartz panel host.

CrystalQuartz detects Quartz.dll version at runtime and does not explicitly depend on Quartz NuGet package. So you need to make sure you have Quartz pre-installed.

For Quartz 3:

Install-Package Quartz -Version 3.0.2

For Quartz 2:

Install-Package Quartz -Version 2.6.1
2. Make sure you have appropriate target framework version

Minimal supported .NET versions (vary by packages)

For Quartz v2 + CrystalQuartz.Owin → .NET 4.5
For Quartz v2 + CrystalQuartz.Simple → .NET 4.0
For Quartz v2 + CrystalQuartz.Remote → .NET 4.0
For Quartz v3 + CrystalQuartz.Owin → .NET 4.5.2
For Quartz v3 + CrystalQuartz.Simple → .NET 4.5.2
For Quartz v3 + CrystalQuartz.Remote → .NET 4.5.2
For Quartz v3 + CrystalQuartz.AspNetCore → .NET Standard 2.0
# Getting started # CrystalQuartzPanel is an embeddable module that can be plugged into an existing application. Getting started strategy depends on a type of environment you use. ## Option 1: OWIN (recommended) ## 1. Install NuGet package ```Install-Package CrystalQuartz.Owin -IncludePrerelease``` 2. Once you have an OWIN-supporting application (no matter if it's web or self hosted) you can activate CrystalQuartz panel: ```C# using CrystalQuartz.Owin; // ... /* * app is IAppBuilder * scheduler is your IScheduler (local or remote) */ app.UseCrystalQuartz(() => scheduler); ``` 3. Run your app and navigate to ```localhost:YOUR_PORT/quartz``` Please check [complete OWIN setup guide](//github.com/guryanovev/CrystalQuartz/wiki/CrystalQuartz-OWIN-Configuration) for more details. **Examples** - [OWIN Self-hosted console app example](//github.com/guryanovev/CrystalQuartz/tree/master/examples/01_Owin_SelfHosted) - [OWIN Simple site](//github.com/guryanovev/CrystalQuartz/tree/master/examples/02_Owin_Web_Simple) - [OWIN Web site + remote](//github.com/guryanovev/CrystalQuartz/tree/master/examples/03_Owin_Web_Remote) ## Option 2: ASP.NET Core ## 1. Install NuGet package ```Install-Package CrystalQuartz.AspNetCore -IncludePrerelease``` 2. Once you have an ASP.NET Core-supporting application (no matter if it's web or self hosted) you can activate CrystalQuartz panel: ```C# using CrystalQuartz.AspNetCore; // ... /* * app is IAppBuilder * scheduler is your IScheduler (local or remote) */ app.UseCrystalQuartz(() => scheduler); ``` 3. Run your app and navigate to ```localhost:YOUR_PORT/quartz``` **Examples** - [OWIN ASP.NET Core Web App](//github.com/guryanovev/CrystalQuartz/tree/master/examples/09_Quartz3_AspNetCore_Web) ## Option 3: Non-OWIN (Legacy ASP.NET) ## Non-owin CrystalQuartzPanel implemented as an http module. It can work in web-applications only and requires some configuration to be added to the `web.config` file. There are two NuGet packages aimed to help in case of non-owin application, the choice depends on the type of scheduler you use. **Option 2.1: If Quartz Scheduler works in the app domain of your web application:** 1. Install [CrystalQuartz.Simple](http://nuget.org/List/Packages/CrystalQuartz.Simple) NuGet package. ```Install-Package CrystalQuartz.Simple -IncludePrerelease``` 2. Customize `SimpleSchedulerProvider` class that has been added by NuGet package ```C# public class SimpleSchedulerProvider : ISchedulerProvider { public object CreateScheduler(ISchedulerEngine engine) { ISchedulerFactory schedulerFactory = new StdSchedulerFactory(); var scheduler = GetScheduler(schedulerFactory.GetScheduler()); /* ADD JOBS HERE */ return scheduler; } //... } ``` 3. Run you application and go to `YOUR_APP_URL/CrystalQuartzPanel.axd` **Option 2.2: If Quartz Scheduler works in a separate application (remote scheduler):** 1. Install [CrystalQuartz.Remote](http://nuget.org/List/Packages/CrystalQuartz.Remote) NuGet package. ```Install-Package CrystalQuartz.Remote -IncludePrerelease``` 2. Customize url of the remote scheduler in web config file: ```XML ``` 3. Run you application and go to `YOUR_APP_URL/CrystalQuartzPanel.axd` **Examples** - [Simple Scheduler Example](https://github.com/guryanovev/CrystalQuartz/tree/master/examples/04_SystemWeb_Simple) - [Remote Scheduler Example](https://github.com/guryanovev/CrystalQuartz/tree/master/examples/05_SystemWeb_Remote) # Advanced Configuration # CrystalQuartz supports some configuration options that could be passed to the panel at startup time to customize it's behavior. For CrystalQuartz.Owin package pass options to `UseCrystalQuartz` method: ```C# using CrystalQuartz.Application; //... app.UseCrystalQuartz( () => scheduler, new CrystalQuartzOptions { /* SET OPTIONS HERE */ }); ``` For CrystalQuartz.Simple and CrystalQuartz.Remote use the web.config: ```XML
``` Advanced configuration topics: - [Detecting failed Quartz.NET runs](http://guryanovev.github.io/CrystalQuartz/advanced-config/detecting-failed-runs/) - [Configuring Allowed Job Types](http://guryanovev.github.io/CrystalQuartz/advanced-config/configuring-allowed-job-types/) List of available options: | Property Name | XML Attribute | Default | | | -------------- | ------------- |----------- |---| | `Path` | not supported | `'quartz'` | Url part for the panel. | | `CustomCssUrl` | `customCssUrl`| `null` | Valid absolute or relative url for custom CSS styles for the panel. See [custom styles example](//github.com/guryanovev/CrystalQuartz/tree/master/examples/06_CustomStyles) for details. | | `LazyInit` | not supported | `false` | A flag indicating whether CrystalQuartz Panel should be initialized immediately after application start (`false`) or after first call of panel services (`true`). | | `TimelineSpan` | not supported | 1 hour | Span of timeline events displayed by the panel. | *Please note:* The options list here is not complete, please check the [options class source code](https://github.com/guryanovev/CrystalQuartz/blob/master/src/CrystalQuartz.Application/CrystalQuartzOptions.cs) for details. # Building from source # Please use `Build.bat` script to build the project locally. **Rebuilding directly from Visual Studio would not work correctly** because some client-side assets should be regenerated. `Build.bat` is a bootstrapper for [Rosalia build tool](https://github.com/rosaliafx/Rosalia). Prerquirements: * NodeJs and npm should be installed on your machine and globally available. Once the build completes successfully, you can Run the VS project as usually. # Collaboration # Please use [gitter](https://gitter.im/guryanovev/CrystalQuartz?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) to ask questions. Fill free to report issues and open pull requests. # Changelog # **Latest update:** * timeline tooltip cosmetic fixes * introduced trigger fire details dialog (opens on timeline item click) ![输入图片说明](https://images.gitee.com/uploads/images/2020/1027/170054_a0e79d16_436641.png "2.png") [See full changelog](//github.com/guryanovev/CrystalQuartz/wiki/Changelog)