Coder Social home page Coder Social logo

zhaopeiym / quartzui Goto Github PK

View Code? Open in Web Editor NEW
1.5K 67.0 408.0 48.82 MB

基于Quartz.NET3.0的定时任务Web可视化管理。docker打包开箱即用、内置SQLite持久化、语言无关、业务代码零污染、支持 RESTful风格接口、傻瓜式配置

License: MIT License

C# 52.09% HTML 14.56% TypeScript 20.22% JavaScript 0.67% CSS 2.18% Dockerfile 0.25% TSQL 10.03%
quartzui quartz quartznet quartz3 quartznet3 quartznetcore quartz-docker quartzdocker jobs quartznetui

quartzui's Introduction

LICENSE 996.icu GitHub license

注意:请不要跑在IIS上,因为IIS会自动回收。建议使用docker运行,或者直接用命令dotnet Host.dll。

说明文档

https://github.com/zhaopeiym/quartzui/wiki

演示地址

https://scheduler.haojima.net
默认口令:admin

quartzui

  • 基于.NET5.0和Quartz.NET3.2.4的任务调度Web界面管理。
  • docker方式开箱即用
  • 内置SQLite持久化
  • 支持 RESTful风格接口
  • 业务代码零污染
  • 语言无关
  • 傻瓜式配置
  • 异常请求邮件通知

使用

  • 方式1(docker使用)
docker run -v /fileData/quartzuifile:/app/File  --restart=unless-stopped --privileged=true --name quartzui -dp 5088:80 bennyzhao/quartzui

一行命令开箱即用,赶快体验下docker的便捷吧!
1、其中/fileData/quartzuifile为映射的文件地址,如SQLite数据库和log日志
2、5088为映射到主机的端口
3、直接在浏览器 ip:5088 即可访问。(注意防火墙是否打开了5088端口,或者在主机测试 curl 127.0.0.1:5088)
  • 方式2(docker部署树莓派)
docker run -v /fileData/quartzuifile:/app/File  --restart=unless-stopped --privileged=true --name quartzui -dp 5088:80 bennyzhao/quartzui:RaspberryPi
  • 方式3(可直接通过源码部署到windows或linux平台)

更换数据源

默认使用的是SQLite-Microsoft
如果需要使用其他数据源请自行在appsettings.json进行正确配置。如:

"dbProviderName":"OracleODPManaged",
"connectionString": "Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=xe)));User Id=system;Password=oracle;";

"dbProviderName":"SqlServer",
"connectionString": "Server=localhost;Database=quartznet;User Id={SqlServerUser};Password={SqlServerPassword};";

"dbProviderName":"SQLServerMOT",
"connectionString": "Server=localhost,1444;Database=quartznet;User Id={SqlServerUser};Password={SqlServerPassword};"

"dbProviderName":"MySql", // MySql 测试通过
"connectionString": "Server = localhost; Database = quartznet; Uid = quartznet; Pwd = quartznet";

"dbProviderName":"Npgsql", // Npgsql 测试通过
"connectionString": "Server=127.0.0.1;Port=5432;Userid=quartznet;Password=quartznet;Pooling=true;MinPoolSize=1;MaxPoolSize=20;Timeout=15;SslMode=Disable;Database=quartznet";

"dbProviderName":"SQLite",
"connectionString": "Data Source=test.db;Version=3;";

"dbProviderName":"SQLite-Microsoft", // SQLite-Microsoft 测试通过
"connectionString": "Data Source=test.db;";

"dbProviderName":"Firebird",
"connectionString": "User=SYSDBA;Password=masterkey;Database=/firebird/data/quartz.fdb;DataSource=localhost;Port=3050;Dialect=3;Charset=NONE;Role=;Connection lifetime=15;Pooling=true;MinPoolSize=0;MaxPoolSize=50;Packet Size=8192;ServerType=0;";

效果图

1 2 3 4 5

quartzui's People

Contributors

lilei2020 avatar ran-snow avatar zhaopeiym 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  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  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

quartzui's Issues

编译后无法运行

克隆代码后没做任何修改直接编译通过,但双击Host.exe或cmd窗口中执行dotnet Host.exe命令均无反应。请给位兄弟姐妹指点迷津,是不是我哪个环节漏了,多谢!!!

'CREATE TRIGGER' 必须是查询批次中的第一个语句。

消息 111,级别 15,状态 1,第 65 行
'CREATE TRIGGER' 必须是查询批次中的第一个语句。
消息 111,级别 15,状态 1,第 93 行
'CREATE TRIGGER' 必须是查询批次中的第一个语句。
消息 111,级别 15,状态 1,第 111 行
'CREATE TRIGGER' 必须是查询批次中的第一个语句。
消息 111,级别 15,状态 1,第 128 行
'CREATE TRIGGER' 必须是查询批次中的第一个语句。

HttpClient超时

任务执行时间很长,大概5分钟左右,HttpClient默认超时时间是100秒,可否把这个时间改为配置或者设置长一点。我找到对应的代码了,但是不知道你这边是怎么打包成docker的,所以麻烦了

任务调度数量过多的话,连接池不释放

Failed to obtain DB connection from data source 'default': Npgsql.NpgsqlException (0x80004005): The connection pool has been exhausted, either raise MaxPoolSize (currently 20) or Timeout (currently 15 seconds)

3.0的dev版编译通过但是控制台有错误信息。

微软提示:
app.UseCors()必须在app.UseRouting()和app.UseEndpoints()之间。

fail: Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware[1]
An unhandled exception has occurred while executing the request.
System.InvalidOperationException: Endpoint Host.Controllers.JobController.GetAllJobBriefInfo (Host) contains CORS metadata, but a middleware was not found that supports CORS.
Configure your application startup by adding app.UseCors() inside the call to Configure(..) in the application startup code. The call to app.UseAuthorization() must appear between app.UseRouting() and app.UseEndpoints(...).
at Microsoft.AspNetCore.Routing.EndpointMiddleware.ThrowMissingCorsMiddlewareException(Endpoint endpoint)
at Microsoft.AspNetCore.Routing.EndpointMiddleware.Invoke(HttpContext httpContext)
at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
at Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIMiddleware.Invoke(HttpContext httpContext)
at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext, ISwaggerProvider swaggerProvider)
at Host.Startup.<>c.<b__5_0>d.MoveNext() in D:\workspace\quartzui-dev\QuartzNetAPI\Host\Startup.cs:line 84
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)

app.UseCors("AllowSameDomain") 位置错误

app.UseRouting();
app.UseAuthorization();
app.UseCors("AllowSameDomain");
app.UseEndpoints(endpoints =>
{
endpoints.MapControllers();
});
如上,应该放在 app.UseRouting(); 和 UseEndpoints 之间

[BUG] 执行 Http Get 任务时触发异常

问题描述:

系统定时在 0点 执行多个 Http Get 任务时, 触发以下异常:

`
System.NullReferenceException: Object reference not set to an instance of an object.

at System.Collections.Generic.Dictionary`2.TryInsert(TKey key, TValue value, InsertionBehavior behavior)

at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value)

at Host.HttpHelper.GetHttpClient(String url) in D:\worksapce\repository\quartzui\QuartzNetAPI\Host\Common\HttpHelper.cs:line 32
`

显然是多线程操作 Dictionary 问题

我想请教一个问题

我想请教一个问题,就是我执行的任务可能时间比较长半小时,十几分钟的都会有,怎么回调接收任务执行结果,比如说任务的执行结果,执行过程日志,执行发生异常等情况,保存到这个任务系统里

打包

QuartzNetAPI 是接口api,QuartzNetWeb是ui 他们是怎么一起打包在bennyzhao/quartzui 这个镜像里面的,可以教我吗,感谢!!!

开发分支运行

本地运行起来跟你演示地址的运行效果不一样,少了RabbitMQ及MQTT的配置,添加任务没法选择任务类型,这个是怎么开放出来?

问下作者,代码是否需要改动才可运行!

System.InvalidOperationException: Endpoint Host.Controllers.JobController.GetAllJob (Host) contains CORS metadata, but a middleware was not found that supports CORS.
Configure your application startup by adding app.UseCors() inside the call to Configure(..) in the application startup code. The call to app.UseAuthorization() must appear between app.UseRouting() and app.UseEndpoints(...).
at Microsoft.AspNetCore.Routing.EndpointMiddleware.ThrowMissingCorsMiddlewareException(Endpoint endpoint)
at Microsoft.AspNetCore.Routing.EndpointMiddleware.Invoke(HttpContext httpContext)
at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
at Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIMiddleware.Invoke(HttpContext httpContext)
at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext, ISwaggerProvider swaggerProvider)
at Host.Startup.<>c.<b__5_0>d.MoveNext() in C:\Users\Administrator\Desktop\quartzui-dev\QuartzNetAPI\Host\Startup.cs:line 91
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)

HEADERS

Connection: keep-alive
Content-Type: application/json
Accept: application/json, text/plain, /
Accept-Encoding: gzip, deflate, br
Accept-Language: zh-CN,zh;q=0.9
Host: localhost:8100
Referer: http://localhost:8100/
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.120 Safari/537.36
Sec-Fetch-Mode: cors
Sec-Fetch-Site: same-origin

任务比较耗费时间

任务比较耗费时间时候,Quartzui频繁 出现The request was canceled due to the configured HttpClient.Timeout of 100 seconds elapsing
异常错误。建议应提供可配置最长超时设置。

任务不执行

任务执行到某天后,之后就不再执行了,看docker日志没有发现异常。只有我一直打开页面才会正常执行
qq 20180718095902

怎么做到开机启动的

目前看了下示例,是把schedulecenter注册成单例的,每次一调用就start了,如何做到重启以后自动start

[讨论] 做一个更大的整体设计

  1. 底层调度是基于Hangfire | Quart.NET 我并不关心
  2. 回调方式抽象,HTTP回调只是一种, 但有局限性,需要调度的程序也不全是Web. 可以是消息队列推送等

异常信息

image
接口并没有返回异常,但是一直会出现异常提示。

支持运行c#脚本任务

执行用户上传的C#脚本。

可选方案我目前找到 dotnet-script。

但需要考虑产生的问题,比如隔离,安全。

如何解决任务阻塞

比如我有一个计算排放量的算法,按照不同的参数计算 比如这个排放量是是分部计算100个公司的排放量,我给一百个公司分别设置不同的时间执行调用这个方法,但是传的是不同的公司参数,根据参数计算,这个时候就会遇到如果其中一个公司的还没有算完 下个任务就开始了 由于调用的是同一个方法,只是参数不一样就会造成阻塞 如果解决

展示任务出错

当QRTZ_JOB_DETAILS表中JOB_CLASS_NAME字段存在一个与当前创建任务不同的类型时,界面不会展示数据。
出错位置在SchedulerCenter==>GetAllJobBriefInfoAsync方法的第十行。
报错信息:Couldn't retrieve job because a required type was not found: Could not load type 'XXX'

使用两套程序分别向一个数据库中创建任务时发现的这个问题。

JWT授权认证不支持

现在太多WebApi通过JWT授权认证方式。似乎.net core JWT不允许那种超长不过期的Token。
也就是说无法通过在QuartzUI中加入固定的Head参数Token来调用WebApi
有啥好的解决方案?或者能否加入针对Token请求接口和刷新 Token接口?

quartzui支持禁止任务并发执行吗

一个任务执行很耗时,超过间隔时间后,任务没有执行完毕,quartzui会等到执行结果后再执行下一次的吗?还是说会并发执行

扫描下一个待触发的触发器时出错

程序正常运行了一段时间,但近两天每次再早上停止运行了,不知道什么原因,错误提示如下:
[Error] An error occurred while scanning for the next trigger to fire.
Quartz.Impl.AdoJobStore.LockException: Failure obtaining db row lock: SQLite Error 14: 'unable to open database file'.
---> Microsoft.Data.Sqlite.SqliteException (0x80004005): SQLite Error 14: 'unable to open database file'.
at Microsoft.Data.Sqlite.SqliteException.ThrowExceptionForRC(Int32 rc, sqlite3 db)
at Microsoft.Data.Sqlite.SqliteDataReader.NextResult()
at Microsoft.Data.Sqlite.SqliteCommand.ExecuteReader(CommandBehavior behavior)
at Microsoft.Data.Sqlite.SqliteCommand.ExecuteNonQuery()
at System.Data.Common.DbCommand.Execute

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.