You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
61 lines
2.6 KiB
61 lines
2.6 KiB
<style>
|
|
table, th, td {
|
|
border: 1px solid black;
|
|
border-collapse: collapse;
|
|
border-color: #96D4D4;
|
|
}
|
|
</style>
|
|
<div class="row justify-content-center">
|
|
<h4 class="mt-4 display-4">Mail Delivery Report</h4>
|
|
</div>
|
|
<%= form_with url: "/search", method: :get do |form| %>
|
|
<%= form.label :date_from, "From" %>
|
|
<%= form.date_field :date_from %>
|
|
<%= form.label :date_to, "To" %>
|
|
<%= form.date_field :date_to %>
|
|
<%= form.label :rcpt_to, "To" %>
|
|
<%= form.email_field :rcpt_to %>
|
|
<%= form.label :mail_from, "From" %>
|
|
<%= form.email_field :mail_from %>
|
|
<%= form.label :status, "Status" %>
|
|
<%= form.select :status , ['All', 'Sent','SoftFail', 'HardFail','Held'] %>
|
|
<%= form.submit "search" %>
|
|
<% end %>
|
|
<%= link_to "Download Report" ,:action => :export %>
|
|
|
|
<div class="container ">
|
|
<% if @mails.present? %>
|
|
<div class="row justify-content-center border p-2 border-dark rounded m-2 overflow-auto">
|
|
<table class="table table-bordered">
|
|
<thead>
|
|
<tr>
|
|
<th scope="col" style="text-align: center;">Message ID</th>
|
|
<th scope="col" style="text-align: center;">Sender</th>
|
|
<th scope="col" style="text-align: center;">Recipient</th>
|
|
<th scope="col" style="text-align: center;">Subject</th>
|
|
<th scope="col" style="text-align: center;">Date</th>
|
|
<th scope="col" style="text-align: center;">Time</th>
|
|
<th scope="col" style="text-align: center;">Size</th>
|
|
<th scope="col" style="text-align: center;">Status</th>
|
|
<th scope="col" style="text-align: center;">Delivery Details</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<% @mails.each(:as => :hash ) do |mail| %>
|
|
<tr>
|
|
<td style="text-align: center;"><%= mail['message_id'] %></td>
|
|
<td style="text-align: center;"><%= mail['mail_from'] %></td>
|
|
<td style="text-align: center;"><%= mail['rcpt_to'] %></td>
|
|
<td style="text-align: center;"><%= mail['subject'] %></td>
|
|
<td style="text-align: center;"><%= Time.at(mail['timestamp']).strftime('%d-%m-%Y') %></td>
|
|
<td style="text-align: center;"><%= Time.at(mail['timestamp']).strftime('%H:%M:%S') %></td>
|
|
<td style="text-align: center;"><%= mail['size'].to_f >= 1048576 ? "#{(mail['size'].to_d/1048576).round(2)} MB" : "#{(mail['size'].to_d/1024).round(2)} KB"%></td>
|
|
<td style="text-align: center;"><%= mail['status'] == "Sent"? "Delivered": mail['status'] %></td>
|
|
<td><%= mail['details'] %></td>
|
|
</tr>
|
|
<% end %>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<% end %>
|
|
</div>
|
|
|