diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index bb7db36..c3612d3 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -1,111 +1,128 @@ // This is a manifest file that'll be compiled into application.js, which will include all the files // listed below. // // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts, // or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path. // // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the // compiled file. // // Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details // about supported directives. // //= require jquery.min //= require jquery_ujs //= require jquery-ui.min //= require bootstrap.min //= require jstree //= require chosen.jquery.min //= require jquery.dataTables.min //= require dataTables.bootstrap.min //= require_tree . //= require highcharts //= require jobs //= require filesets //= require clients $(document).ready(function() { if ($('.schedule_run_form_plus').size() > 0) { $(".schedule_run_form_plus").click(function() { addScheduleRun(); return false; }); }; if ($('.schedule_run_form_remove').size() > 0) { $(".schedule_run_form_remove").click(function() { removeScheduleRun(); return false; }); }; if ($('.schedule_run_form').size() > 1) { $('.schedule_run_form_remove').show(); }; if ($('table#admin_clients').size() > 0) { $('table#admin_clients').DataTable({ paging: false, columnDefs: [ { targets: 'neither-search-nor-order', orderable: false, searchable: false }, { targets: 'no-search', orderable: true, searchable: false }], }); }; + if ($('table#admin_jobs').size() > 0) { + $('table#admin_jobs').DataTable({ + paging: false, + columnDefs: [ + { + targets: 'neither-search-nor-order', + orderable: false, + searchable: false + }, + { + targets: 'no-search', + orderable: true, + searchable: false + }], + }); + }; + }); function addScheduleRun() { var count = $('.schedule_run_form').size(); var scheduleRun = $('.schedule_run_form:last').clone(); $(scheduleRun).find('label').each(function() { var newLabel, oldLabel; oldLabel = $(this).attr('for'); newLabel = oldLabel.replace(new RegExp(/_[0-9]+_/), "_" + count + "_"); $(this).attr('for', newLabel); }); $(scheduleRun).find('select, input').each(function() { var newId, oldId, newName, oldName; oldId = $(this).attr('id'); newId = oldId.replace(new RegExp(/_[0-9]+_/), "_" + count + "_"); $(this).attr('id', newId); oldName = $(this).attr('name'); newName = oldName.replace(new RegExp(/[0-9]+/), "[" + count + "]"); $(this).attr('name', newName); }); scheduleRun.insertAfter('.schedule_run_form:last'); $('.schedule_run_form:last input').val(''); if (count > 0) { $(".schedule_run_form_remove").show(); }; $('.destroyer:last').remove(); } function removeScheduleRun() { var count = $('.schedule_run_form').size(); if (count > 1) { var last_id = count - 1; $('').attr({ type: 'hidden', class: 'destroyer', id: 'schedule_schedule_runs_attributes_' + last_id + '__destroy', name: 'schedule[schedule_runs_attributes][' + last_id + '][_destroy]', value: '1' }).appendTo('form'); $('.schedule_run_form:last').remove(); if ($('.schedule_run_form').size() == 1) { $(".schedule_run_form_remove").hide(); }; } else { alert('nothing to remove'); }; } diff --git a/app/views/admin/jobs/_recent_job.html.erb b/app/views/admin/jobs/_recent_job.html.erb index bac4d3c..a0ce173 100644 --- a/app/views/admin/jobs/_recent_job.html.erb +++ b/app/views/admin/jobs/_recent_job.html.erb @@ -1,15 +1,15 @@ <%= recent_job.name %> <%= recent_job.client.name %> - <%= recent_job.job_id %> + <%= link_to recent_job.job_id, logs_admin_client_path(recent_job.client) %> <%= recent_job.level_human %> <%= recent_job.fileset %> <%= recent_job.start_time_formatted %> <%= recent_job.end_time_formatted %> <%= recent_job.duration %> <%= number_to_human_size(recent_job.job_bytes) %> <%= number_by_magnitude(recent_job.job_files) %> <%= recent_job.status_human %> <%= recent_job.encryption %> <%= recent_job.compression %> diff --git a/app/views/admin/jobs/_recent_jobs.html.erb b/app/views/admin/jobs/_recent_jobs.html.erb index 07df9d7..0f7ffbe 100644 --- a/app/views/admin/jobs/_recent_jobs.html.erb +++ b/app/views/admin/jobs/_recent_jobs.html.erb @@ -1,26 +1,26 @@
- +
- - - - - - - - - - + + + + + + + + + + <%= render partial: 'admin/jobs/recent_job', collection: @jobs %>
Name Client JobIdLevelFilesetStarted AtFinished AtDurationBytesFilesStatusEncryptionCompressionLevelFilesetStarted AtFinished AtDurationBytesFilesStatusEncryptionCompression