Skip to content

Commit

Permalink
Version 0.9.61
Browse files Browse the repository at this point in the history
- 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.
  • Loading branch information
jhuckaby committed Oct 18, 2024
1 parent b9e1250 commit ae28d63
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 7 deletions.
14 changes: 12 additions & 2 deletions htdocs/js/pages/JobDetails.class.js
Original file line number Diff line number Diff line change
Expand Up @@ -257,9 +257,14 @@ Class.subclass( Page.Base, "Page.JobDetails", {
html += '</div>';
html += '</div>';

var nice_source = (job.source || 'Scheduler');
if (nice_source.match(/Chain Reaction/) && job.source_job) {
nice_source = '<a href="#JobDetails?id=' + job.source_job + '">' + nice_source + '</a>';
}

html += '<div style="float:left; width:25%;">';
html += '<div class="info_label">JOB SOURCE</div>';
html += '<div class="info_value"><div class="ellip" style="max-width:'+col_width+'px;">' + (job.source || 'Scheduler') + '</div></div>';
html += '<div class="info_value"><div class="" style="">' + nice_source + '</div></div>';

html += '<div class="info_label">SERVER HOSTNAME</div>';
html += '<div class="info_value">' + this.getNiceGroup( null, job.hostname, col_width ) + '</div>';
Expand Down Expand Up @@ -800,9 +805,14 @@ Class.subclass( Page.Base, "Page.JobDetails", {
html += '<div class="info_value">' + this.getNiceGroup(group, event.target, col_width) + '</div>';
html += '</div>';

var nice_source = (job.source || 'Scheduler');
if (nice_source.match(/Chain Reaction/) && job.source_job) {
nice_source = '<a href="#JobDetails?id=' + job.source_job + '">' + nice_source + '</a>';
}

html += '<div style="float:left; width:25%;">';
html += '<div class="info_label">JOB SOURCE</div>';
html += '<div class="info_value"><div class="ellip" style="max-width:'+col_width+'px;">' + (job.source || 'Scheduler') + '</div></div>';
html += '<div class="info_value"><div class="" style="">' + nice_source + '</div></div>';

html += '<div class="info_label">SERVER HOSTNAME</div>';
html += '<div class="info_value">' + this.getNiceGroup( null, job.hostname, col_width ) + '</div>';
Expand Down
6 changes: 3 additions & 3 deletions htdocs/js/pages/Schedule.class.js
Original file line number Diff line number Diff line change
Expand Up @@ -775,7 +775,7 @@ Class.subclass( Page.Base, "Page.Schedule", {
var event = this.event;

// event title
html += get_form_table_row( 'Event Name', '<input type="text" id="fe_ee_title" size="35" value="'+escape_text_field_value(event.title)+'" spellcheck="false"/>' );
html += get_form_table_row( 'Event Name', '<input type="text" id="fe_ee_title" style="width:90%" value="'+escape_text_field_value(event.title)+'" spellcheck="false"/>' );
html += get_form_table_caption( "Enter a title for the event, which will be displayed on the main schedule." );
html += get_form_table_spacer();

Expand Down Expand Up @@ -1001,10 +1001,10 @@ Class.subclass( Page.Base, "Page.Schedule", {
'<div style="font-size:13px;'+(chain_expanded ? 'display:none;' : '')+'"><span class="link addme" onMouseUp="$P().expand_fieldset($(this))"><i class="fa fa-plus-square-o">&nbsp;</i>Chain Options</span></div>' +
'<fieldset style="padding:10px 10px 0 10px; margin-bottom:5px;'+(chain_expanded ? '' : 'display:none;')+'"><legend class="link addme" onMouseUp="$P().collapse_fieldset($(this))"><i class="fa fa-minus-square-o">&nbsp;</i>Chain Options</legend>' +
'<div class="plugin_params_label">Run Event on Success:</div>' +
'<div class="plugin_params_content"><select id="fe_ee_chain" style="margin-left:10px; font-size:12px;"><option value="">(None)</option>' + render_menu_options( sorted_events, event.chain, false ) + '</select></div>' +
'<div class="plugin_params_content"><select id="fe_ee_chain" style="width:90%; margin-left:10px; font-size:12px;"><option value="">(None)</option>' + render_menu_options( sorted_events, event.chain, false ) + '</select></div>' +

'<div class="plugin_params_label">Run Event on Failure:</div>' +
'<div class="plugin_params_content"><select id="fe_ee_chain_error" style="margin-left:10px; font-size:12px;"><option value="">(None)</option>' + render_menu_options( sorted_events, event.chain_error, false ) + '</select></div>' +
'<div class="plugin_params_content"><select id="fe_ee_chain_error" style="width:90%; margin-left:10px; font-size:12px;"><option value="">(None)</option>' + render_menu_options( sorted_events, event.chain_error, false ) + '</select></div>' +

'</fieldset>'
);
Expand Down
3 changes: 2 additions & 1 deletion lib/scheduler.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>",
"homepage": "https://github.com/jhuckaby/Cronicle",
Expand Down

0 comments on commit ae28d63

Please sign in to comment.