<%= 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)) %>
<% unless (@queues_entries['busEvents'] || []).empty? %>
Bus events
Created date |
Class name |
Event |
User token |
<% if @account_id.blank? %>
Account record id |
<% end %>
|
<% @queues_entries['busEvents'].each do |bus_event| %>
<% if bus_event['createdDate'].to_datetime < @now %>
<% else %>
<% end %>
<%= truncate_millis(bus_event['createdDate']) %> |
<%= truncate_class_name(bus_event['className']) %> |
<%= "#{JSON.pretty_generate(bus_event['event'])} ".html_safe %> |
<%= object_id_popover(bus_event['userToken'], 'left') %> |
<% if @account_id.blank? %>
<%= bus_event['searchKey1'] %> |
<% end %>
<%= bus_event['userToken'] %> |
<% end %>
<% end %>
<% unless (@queues_entries['notifications'] || []).empty? %>
Notifications
Effective date |
Queue name |
Event |
User token |
<% if @account_id.blank? %>
Account record id |
<% end %>
|
<% @queues_entries['notifications'].each do |notification| %>
<% if notification['effectiveDate'].to_datetime < @now %>
<% else %>
<% end %>
<%= truncate_millis(notification['effectiveDate']) %> |
<%= notification['queueName'] %>
|
<%= "#{JSON.pretty_generate(notification['event'])} ".html_safe %> |
<%= object_id_popover(notification['userToken'], 'left') %> |
<% if @account_id.blank? %>
<%= notification['searchKey1'] %> |
<% end %>
<%= notification['userToken'] %> |
<% end %>
<% end %>
<% 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 %>