Project

General

Profile

Actions

Feature #1647

open

Allow reports to be configured so only last report (per host) is displayed

Added by Adam Kosmin almost 12 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Reporting
Target version:
-
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

Of course, this should be optional. Here's my nasty hack to app/views/reports/_list.html.erb which gets the job done for me despite being hard-coded. Ideally, this would be a configuration option somewhere in the roles scope.

<% firsts = [] %>
  <% @reports.each do |report| %>
    <% unless firsts.include?(report.host) %>
      <% firsts << report.host %>
      <tr>
        <% unless params[:host_id] -%>
          <td><%= link_to h(report.host), host_reports_path(report.host) %></td>
        <% end -%>
        <td><%= reported_at_column(report) %></td>
        <td><%= report_event_column(report.applied, "notice") %></td>
        <td><%= report_event_column(report.restarted, "notice") %></td>
        <td><%= report_event_column(report.failed, "important") %></td>
        <td><%= report_event_column(report.failed_restarts, "warning") %></td>
        <td><%= report_event_column(report.skipped, "notice") %></td>
        <td align="right">
          <%= display_link_if_authorized "Destroy", hash_for_report_path(:id => report.id, :auth_action => :destroy), :confirm => "Delete report for #{report.host.name}?", :method => :delete %>
        </td>
      </tr>
    <% end %>
  <% end %>
</table>
<%= will_paginate @reports %>

No data to display

Actions

Also available in: Atom PDF