From ae28d63be2fe4b9498da686bdf1dcccbe8a47ad0 Mon Sep 17 00:00:00 2001 From: Joseph Huckaby Date: Fri, 18 Oct 2024 16:09:12 -0700 Subject: [PATCH] Version 0.9.61 - Improve display of chain reaction jobs on Job Detail page. - Link chain reaction to originating job. - Widen event name input field. - Widen chain reaction menus for selecting jobs. --- htdocs/js/pages/JobDetails.class.js | 14 ++++++++++++-- htdocs/js/pages/Schedule.class.js | 6 +++--- lib/scheduler.js | 3 ++- package.json | 2 +- 4 files changed, 18 insertions(+), 7 deletions(-) diff --git a/htdocs/js/pages/JobDetails.class.js b/htdocs/js/pages/JobDetails.class.js index 10c9a156..2df5c688 100644 --- a/htdocs/js/pages/JobDetails.class.js +++ b/htdocs/js/pages/JobDetails.class.js @@ -257,9 +257,14 @@ Class.subclass( Page.Base, "Page.JobDetails", { html += ''; html += ''; + var nice_source = (job.source || 'Scheduler'); + if (nice_source.match(/Chain Reaction/) && job.source_job) { + nice_source = '' + nice_source + ''; + } + html += '
'; html += '
JOB SOURCE
'; - html += '
' + (job.source || 'Scheduler') + '
'; + html += '
' + nice_source + '
'; html += '
SERVER HOSTNAME
'; html += '
' + this.getNiceGroup( null, job.hostname, col_width ) + '
'; @@ -800,9 +805,14 @@ Class.subclass( Page.Base, "Page.JobDetails", { html += '
' + this.getNiceGroup(group, event.target, col_width) + '
'; html += '
'; + var nice_source = (job.source || 'Scheduler'); + if (nice_source.match(/Chain Reaction/) && job.source_job) { + nice_source = '' + nice_source + ''; + } + html += '
'; html += '
JOB SOURCE
'; - html += '
' + (job.source || 'Scheduler') + '
'; + html += '
' + nice_source + '
'; html += '
SERVER HOSTNAME
'; html += '
' + this.getNiceGroup( null, job.hostname, col_width ) + '
'; diff --git a/htdocs/js/pages/Schedule.class.js b/htdocs/js/pages/Schedule.class.js index ff8fb9f2..293478d4 100644 --- a/htdocs/js/pages/Schedule.class.js +++ b/htdocs/js/pages/Schedule.class.js @@ -775,7 +775,7 @@ Class.subclass( Page.Base, "Page.Schedule", { var event = this.event; // event title - html += get_form_table_row( 'Event Name', '' ); + html += get_form_table_row( 'Event Name', '' ); html += get_form_table_caption( "Enter a title for the event, which will be displayed on the main schedule." ); html += get_form_table_spacer(); @@ -1001,10 +1001,10 @@ Class.subclass( Page.Base, "Page.Schedule", { '
 Chain Options
' + '
 Chain Options' + '
Run Event on Success:
' + - '
' + + '
' + '
Run Event on Failure:
' + - '
' + + '
' + '
' ); diff --git a/lib/scheduler.js b/lib/scheduler.js index 8d0d51f7..f74bd1b2 100644 --- a/lib/scheduler.js +++ b/lib/scheduler.js @@ -310,7 +310,8 @@ module.exports = Class.create({ chain_code: old_job.code || 0, chain_description: old_job.description || '', source: "Chain Reaction (" + old_job.event_title + ")", - source_event: old_job.event + source_event: old_job.event, + source_job: old_job.id } ); // merge in chain_params if applicable diff --git a/package.json b/package.json index b300fa72..d3c28657 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "Cronicle", - "version": "0.9.60", + "version": "0.9.61", "description": "A simple, distributed task scheduler and runner with a web based UI.", "author": "Joseph Huckaby ", "homepage": "https://github.com/jhuckaby/Cronicle",