<%= link_to 'Current or future entries', kaui_engine.queues_path(params.to_h.merge(:with_history => false, :max_date => @now + 1.week)) %> / <% unless params[:account_id].present? -%> <%= link_to 'Historical entries (last week)', kaui_engine.queues_path(params.to_h.merge(:with_history => true, :min_date => @now - 1.week, :max_date => @now + 1.week)) %> / <%= link_to 'Historical entries (last month)', kaui_engine.queues_path(params.to_h.merge(:with_history => true, :min_date => @now - 1.month, :max_date => @now + 1.week)) %> / <% end -%> <%= link_to 'All historical entries', kaui_engine.queues_path(params.to_h.merge(:with_history => true)) %>

<% nb_bus_entries = (@queues_entries['busEvents'] || []).size %> <% nb_notifications_entries = (@queues_entries['notifications'] || []).size %> <%= javascript_tag do %> $(document).ready(function() { $('#bus-table').dataTable({ <% if nb_bus_entries <= 50 %> "dom": "<'row'<'col-md-6'><'col-md-6'f>r>t", "paging": "false", <% else %> "dom": "<'row'<'col-md-6'><'col-md-6'f>r>t<'row'<'col-md-6'i><'col-md-6'p>>", "pagingType": "full_numbers", "displayStart": <%= [0, nb_bus_entries - 50].max %>, <% end %> "pageLength": 50, "order": [], "columnDefs": [ { "targets": [ <%= @account_id.blank? ? 5 : 4 %> ], "visible": false, "searchable": true } ] }); $('#notifications-table').dataTable({ <% if nb_notifications_entries <= 50 %> "dom": "<'row'<'col-md-6'><'col-md-6'f>r>t", "paging": "false", <% else %> "dom": "<'row'<'col-md-6'><'col-md-6'f>r>t<'row'<'col-md-6'i><'col-md-6'p>>", "pagingType": "full_numbers", "displayStart": 0, <% end %> "pageLength": 50, "order": [], "columnDefs": [ { "targets": [ <%= @account_id.blank? ? 5 : 4 %> ], "visible": false, "searchable": true } ] }); }); <% end %>