diff --git a/xxl-job-admin/src/main/resources/static/plugins/cronGen/cronGen.js b/xxl-job-admin/src/main/resources/static/plugins/cronGen/cronGen.js index ba55d63d..2ebf3375 100755 --- a/xxl-job-admin/src/main/resources/static/plugins/cronGen/cronGen.js +++ b/xxl-job-admin/src/main/resources/static/plugins/cronGen/cronGen.js @@ -10,7 +10,7 @@ options = $.extend({}, $.fn.cronGen.defaultOptions, options); //create top menu var cronContainer = $("
", { id: "CronContainer", style: "display:none;width:300px;height:300px;" }); - var mainDiv = $("
", { id: "CronGenMainDiv", style: "width:410px;height:300px;" }); + var mainDiv = $("
", { id: "CronGenMainDiv", style: "width:410px;height:430px;" }); var topMenu = $("
    ", { "class": "nav nav-tabs", id: "CronGenTabs" }); $('
  • ', { 'class': 'active' }).html($('')).appendTo(topMenu); $('
  • ').html($('分钟')).appendTo(topMenu); @@ -318,9 +318,12 @@ // resultsName = $(this).prop("id"); // $(this).prop("name", resultsName); + var runTime = '

'; + $(span12).appendTo(row); $(row).appendTo(container); $(container).appendTo(mainDiv); + $(runTime).appendTo(mainDiv); $(cronContainer).append(mainDiv); var that = $(this); @@ -354,6 +357,9 @@ placement: options.direction }).on('click', function (e) { + if (inputElement.val().trim() !== '') { + refreshRunTime(); + } e.preventDefault(); //fillDataOfMinutesAndHoursSelectOptions(); @@ -374,6 +380,7 @@ }); $("#CronGenMainDiv select,input").change(function (e) { generate(); + refreshRunTime(); }); $("#CronGenMainDiv input").focus(function (e) { generate(); @@ -628,6 +635,24 @@ displayElement.val(results); }; + var refreshRunTime = function () { + $.ajax({ + type : 'GET', + url : base_url + "/jobinfo/nextTriggerTime", + data : { + "cron" : inputElement.val(), + }, + dataType : "json", + success : function(data){ + if (data.code === 200) { + $('#runTime').val(data.content.join("\n")); + } else { + $('#runTime').val(data.msg); + } + } + }); + }; + })(jQuery); (function($) { diff --git a/xxl-job-admin/src/main/resources/static/plugins/cronGen/cronGen_en.js b/xxl-job-admin/src/main/resources/static/plugins/cronGen/cronGen_en.js index 4ba7abc6..a88be4a7 100755 --- a/xxl-job-admin/src/main/resources/static/plugins/cronGen/cronGen_en.js +++ b/xxl-job-admin/src/main/resources/static/plugins/cronGen/cronGen_en.js @@ -10,7 +10,7 @@ options = $.extend({}, $.fn.cronGen.defaultOptions, options); //create top menu var cronContainer = $("
", { id: "CronContainer", style: "display:none;width:300px;height:300px;" }); - var mainDiv = $("
", { id: "CronGenMainDiv", style: "width:410px;height:300px;" }); + var mainDiv = $("
", { id: "CronGenMainDiv", style: "width:410px;height:430px;" }); var topMenu = $("
    ", { "class": "nav nav-tabs", id: "CronGenTabs" }); $('
  • ', { 'class': 'active' }).html($('')).appendTo(topMenu); $('
  • ').html($('Minute')).appendTo(topMenu); @@ -318,9 +318,12 @@ // resultsName = $(this).prop("id"); // $(this).prop("name", resultsName); + var runTime = '

'; + $(span12).appendTo(row); $(row).appendTo(container); $(container).appendTo(mainDiv); + $(runTime).appendTo(mainDiv); $(cronContainer).append(mainDiv); var that = $(this); @@ -354,6 +357,9 @@ placement: options.direction }).on('click', function (e) { + if (inputElement.val().trim() !== '') { + refreshRunTime(); + } e.preventDefault(); //fillDataOfMinutesAndHoursSelectOptions(); @@ -374,6 +380,7 @@ }); $("#CronGenMainDiv select,input").change(function (e) { generate(); + refreshRunTime(); }); $("#CronGenMainDiv input").focus(function (e) { generate(); @@ -628,6 +635,24 @@ displayElement.val(results); }; + var refreshRunTime = function () { + $.ajax({ + type : 'GET', + url : base_url + "/jobinfo/nextTriggerTime", + data : { + "cron" : inputElement.val(), + }, + dataType : "json", + success : function(data){ + if (data.code === 200) { + $('#runTime').val(data.content.join("\n")); + } else { + $('#runTime').val(data.msg); + } + } + }); + }; + })(jQuery); (function($) {