diff --git a/public/scripts/search-client.js b/public/scripts/search-client.js index ce62b8b..70a51e9 100644 --- a/public/scripts/search-client.js +++ b/public/scripts/search-client.js @@ -3,6 +3,7 @@ $(document).ready(function() { // populate and render results table $.get('/flows/search/' + search_term, function(data) { ViewUtil.renderMatchedJobs(DataUtil.unpackFlows(data)); + $("#matched").tablesorter(); }); }); diff --git a/public/scripts/view-util.js b/public/scripts/view-util.js index 381202b..f573a94 100644 --- a/public/scripts/view-util.js +++ b/public/scripts/view-util.js @@ -132,7 +132,7 @@ var ViewUtil = (function($) { ///////////////// private utility functions //////////////// function renderJobsTable(flows, barStylez, clusterFilter, isCompletedJobs) { - var rows = '' + + var rows = '' + 'Job Name' + 'User' + 'Cluster' + @@ -142,7 +142,7 @@ var ViewUtil = (function($) { 'Running Time' + 'Start Time' + (isCompletedJobs ? 'End Time' : 'Progress') + - ''; + ''; for (var i = 0; i < flows.length; ++i) { var f = flows[i]; if (clusterFilter === undefined || f.cluster_name === clusterFilter) { @@ -162,6 +162,7 @@ var ViewUtil = (function($) { ''; } } + rows += '' return rows; } diff --git a/views/index-layout.jade b/views/index-layout.jade index 9dd8453..0bdcc19 100644 --- a/views/index-layout.jade +++ b/views/index-layout.jade @@ -23,6 +23,8 @@ html script(src='/scripts/moment.min.js') script(src='/scripts/URI.min.js') script(src='/scripts/jquery.URI.min.js') + script(src='https://cdnjs.cloudflare.com/ajax/libs/jquery.tablesorter/2.28.7/js/jquery.tablesorter.js') + script(src='https://cdnjs.cloudflare.com/ajax/libs/jquery.tablesorter/2.28.7/js/jquery.tablesorter.widgets.js') body include index-header