Skip to content

Commit

Permalink
Version 0.8.44
Browse files Browse the repository at this point in the history
- Fixes #264 - A refresh bug which occurs when the history view is reloaded after a job completes, but if the user has activated the "Filter By Event" menu, it gets invalidated and the user cannot select an item.  Thanks @geofffox!
  • Loading branch information
jhuckaby committed Feb 28, 2020
1 parent d573e98 commit 8c563e2
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 19 deletions.
44 changes: 26 additions & 18 deletions htdocs/js/pages/History.class.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,30 @@ Class.subclass( Page.Base, "Page.History", {
// show history
app.setWindowTitle( "History" );

var html = '';
// html += '<div style="padding:5px 15px 15px 15px;">';
html += '<div style="padding:20px 20px 30px 20px">';

html += '<div class="subtitle">';
html += 'All Completed Jobs';
// html += '<div class="subtitle_widget"><span class="link" onMouseUp="$P().refresh_user_list()"><b>Refresh</b></span></div>';
// html += '<div class="subtitle_widget"><i class="fa fa-search">&nbsp;</i><input type="text" id="fe_ul_search" size="15" placeholder="Find username..." style="border:0px;"/></div>';
var sorted_events = app.schedule.sort( function(a, b) {
return a.title.toLowerCase().localeCompare( b.title.toLowerCase() );
} );
html += '<div class="subtitle_widget"><i class="fa fa-chevron-down">&nbsp;</i><select id="fe_hist_event" class="subtitle_menu" onChange="$P().jump_to_event_history()"><option value="">Filter by Event</option>' + render_menu_options( sorted_events, '', false ) + '</select></div>';
html += '<div class="clear"></div>';
html += '</div>';

html += '<div id="d_history_table"></div>';
html += '</div>'; // padding
this.div.html( html );

this.get_history();
},

get_history: function() {
var args = this.args;
if (!args.offset) args.offset = 0;
if (!args.limit) args.limit = 25;
app.api.post( 'app/get_history', copy_object(args), this.receive_history.bind(this) );
Expand All @@ -52,20 +76,6 @@ Class.subclass( Page.Base, "Page.History", {

var cols = ['Job ID', 'Event Name', 'Category', 'Plugin', 'Hostname', 'Result', 'Start Date/Time', 'Elapsed Time'];

// html += '<div style="padding:5px 15px 15px 15px;">';
html += '<div style="padding:20px 20px 30px 20px">';

html += '<div class="subtitle">';
html += 'All Completed Jobs';
// html += '<div class="subtitle_widget"><span class="link" onMouseUp="$P().refresh_user_list()"><b>Refresh</b></span></div>';
// html += '<div class="subtitle_widget"><i class="fa fa-search">&nbsp;</i><input type="text" id="fe_ul_search" size="15" placeholder="Find username..." style="border:0px;"/></div>';
var sorted_events = app.schedule.sort( function(a, b) {
return a.title.toLowerCase().localeCompare( b.title.toLowerCase() );
} );
html += '<div class="subtitle_widget"><i class="fa fa-chevron-down">&nbsp;</i><select id="fe_hist_event" class="subtitle_menu" onChange="$P().jump_to_event_history()"><option value="">Filter by Event</option>' + render_menu_options( sorted_events, '', false ) + '</select></div>';
html += '<div class="clear"></div>';
html += '</div>';

var self = this;
var num_visible_items = 0;

Expand Down Expand Up @@ -125,9 +135,7 @@ Class.subclass( Page.Base, "Page.History", {
html += '</td></tr>';
}

html += '</div>'; // padding

this.div.html( html );
this.div.find('#d_history_table').html( html );
},

jump_to_event_history: function() {
Expand Down Expand Up @@ -727,7 +735,7 @@ Class.subclass( Page.Base, "Page.History", {

onStatusUpdate: function(data) {
// received status update (websocket), update sub-page if needed
if (data.jobs_changed && (this.args.sub == 'history')) this.gosub_history(this.args);
if (data.jobs_changed && (this.args.sub == 'history')) this.get_history();
},

onResizeDelay: function(size) {
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.8.43",
"version": "0.8.44",
"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 8c563e2

Please sign in to comment.