From 6641be1210fd22e54e0fe2ca5b3b87906cf3f8da Mon Sep 17 00:00:00 2001 From: xuxueli <931591021@qq.com> Date: Tue, 22 Oct 2019 14:48:17 +0800 Subject: [PATCH] =?UTF-8?q?Cron=E4=B8=8B=E6=AC=A1=E6=89=A7=E8=A1=8C?= =?UTF-8?q?=E6=97=B6=E9=97=B4=E6=9F=A5=E8=AF=A2=EF=BC=9A=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E9=80=9A=E8=BF=87=E7=95=8C=E9=9D=A2=E5=9C=A8=E7=BA=BF=E6=9F=A5?= =?UTF-8?q?=E7=9C=8B=E5=90=8E=E7=BB=AD=E8=BF=9E=E7=BB=AD5=E6=AC=A1?= =?UTF-8?q?=E6=89=A7=E8=A1=8C=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- doc/XXL-JOB官方文档.md | 2 +- .../admin/controller/JobInfoController.java | 6 +-- .../main/resources/i18n/message.properties | 1 + .../main/resources/i18n/message_en.properties | 1 + .../resources/static/js/jobinfo.index.1.js | 42 +++++++++++++++++++ 5 files changed, 46 insertions(+), 6 deletions(-) diff --git a/doc/XXL-JOB官方文档.md b/doc/XXL-JOB官方文档.md index 74ef1b8e..9c027bfe 100644 --- a/doc/XXL-JOB官方文档.md +++ b/doc/XXL-JOB官方文档.md @@ -1548,7 +1548,7 @@ Tips: 历史版本(V1.3.x)目前已经Release至稳定版本, 进入维护阶段 - 10、项目依赖升级至较新稳定版本,如spring、spring-boot、mybatis、slf4j、groovy等等; - 11、JobThread自销毁优化,避免并发触发导致triggerQueue中任务丢失问题; - 12、Cron在线生成工具:任务新增、编辑框通过组件在线生成Cron表达式; -- 13、Cron执行时间查询:支持通过界面在线查看后续连续5次执行时间[ING,交互待完善]; +- 13、Cron下次执行时间查询:支持通过界面在线查看后续连续5次执行时间; - 14、[ING]xxl-rpc服务端线程优化,降低线程内存开销; - 15、[ING]调度日志优化:支持设置日志保留天数,过期日志天维度记录报表,并清理;调度报表汇总实时数据和报表; - 16、[ING]父子任务参数传递;流程任务等,透传动态参数; diff --git a/xxl-job-admin/src/main/java/com/xxl/job/admin/controller/JobInfoController.java b/xxl-job-admin/src/main/java/com/xxl/job/admin/controller/JobInfoController.java index 38d954bc..d6786cfd 100644 --- a/xxl-job-admin/src/main/java/com/xxl/job/admin/controller/JobInfoController.java +++ b/xxl-job-admin/src/main/java/com/xxl/job/admin/controller/JobInfoController.java @@ -158,13 +158,9 @@ public class JobInfoController { } } } catch (ParseException e) { - // - } - if (result!=null && result.size()>0) { - return new ReturnT>(result); - } else { return new ReturnT>(ReturnT.FAIL_CODE, I18nUtil.getString("jobinfo_field_cron_unvalid")); } + return new ReturnT>(result); } } diff --git a/xxl-job-admin/src/main/resources/i18n/message.properties b/xxl-job-admin/src/main/resources/i18n/message.properties index 613fba3d..e72c22be 100644 --- a/xxl-job-admin/src/main/resources/i18n/message.properties +++ b/xxl-job-admin/src/main/resources/i18n/message.properties @@ -129,6 +129,7 @@ jobinfo_opt_start=启动 jobinfo_opt_log=查询日志 jobinfo_opt_run=执行一次 jobinfo_opt_registryinfo=注册节点 +jobinfo_opt_next_time=下次执行时间 jobinfo_glue_remark=源码备注 jobinfo_glue_remark_limit=源码备注长度限制为4~100 jobinfo_glue_rollback=版本回溯 diff --git a/xxl-job-admin/src/main/resources/i18n/message_en.properties b/xxl-job-admin/src/main/resources/i18n/message_en.properties index d877a9de..2e688dc1 100644 --- a/xxl-job-admin/src/main/resources/i18n/message_en.properties +++ b/xxl-job-admin/src/main/resources/i18n/message_en.properties @@ -129,6 +129,7 @@ jobinfo_opt_start=Start jobinfo_opt_log=Query Log jobinfo_opt_run=Run Once jobinfo_opt_registryinfo=Registry Info +jobinfo_opt_next_time=Next trigger time jobinfo_glue_remark=Resource Remark jobinfo_glue_remark_limit=Resource Remark length is limited to 4~100 jobinfo_glue_rollback=Version Backtrack diff --git a/xxl-job-admin/src/main/resources/static/js/jobinfo.index.1.js b/xxl-job-admin/src/main/resources/static/js/jobinfo.index.1.js index ecb4aade..794ad255 100644 --- a/xxl-job-admin/src/main/resources/static/js/jobinfo.index.1.js +++ b/xxl-job-admin/src/main/resources/static/js/jobinfo.index.1.js @@ -135,6 +135,7 @@ $(function() { '
  • '+ I18n.jobinfo_opt_run +'
  • \n' + '
  • '+ I18n.jobinfo_opt_log +'
  • \n' + '
  • ' + I18n.jobinfo_opt_registryinfo + '
  • \n' + + '
  • ' + I18n.jobinfo_opt_next_time + '
  • \n' + '
  • \n' + codeBtn + start_stop_div + @@ -311,7 +312,48 @@ $(function() { } }); + }); + + // job_next_time + $("#job_list").on('click', '.job_next_time',function() { + var id = $(this).parents('ul').attr("_id"); + var row = tableData['key'+id]; + + var jobCron = row.jobCron; + + $.ajax({ + type : 'POST', + url : base_url + "/jobinfo/nextTriggerTime", + data : { + "cron" : jobCron + }, + dataType : "json", + success : function(data){ + + if (data.code != 200) { + layer.open({ + title: I18n.jobinfo_opt_next_time , + btn: [ I18n.system_ok ], + content: data.msg + }); + } else { + var html = '
    '; + if (data.code == 200 && data.content) { + for (var index in data.content) { + html += '' + data.content[index] + '
    '; + } + } + html += '
    '; + layer.open({ + title: I18n.jobinfo_opt_next_time , + btn: [ I18n.system_ok ], + content: html + }); + } + + } + }); });