Revision 459e0feb
Added by Paul Kelly almost 14 years ago
- ID 459e0feb5c15f2ff8c175e2d46e372b4d83c6a4c
app/helpers/reports_helper.rb | ||
---|---|---|
module ReportsHelper
|
||
|
||
def host_column(record)
|
||
link_to record.host.shortname, reports_host_path(record.host)
|
||
end
|
||
|
||
def reported_at_column(record)
|
||
if record.error?
|
||
img = "hosts/warning"
|
||
... | ... | |
image_tag("#{img}.png", :size => "18x18") + " " +
|
||
link_to(time_ago_in_words(record.reported_at.getlocal), report_path(record))
|
||
end
|
||
|
||
def reports_since builder
|
||
choices = [30,60,90].map{|i| OpenStruct.new :name => "#{i} minutes ago", :value => i.minutes.ago }
|
||
choices += (1..7).map{|i| OpenStruct.new :name => "#{pluralize(i, 'day')} ago", :value => i.days.ago }
|
||
choices += [OpenStruct.new :name => "1 week ago", :value => 1.week.ago]
|
||
choices += [OpenStruct.new :name => "2 weeks ago", :value => 2.week.ago]
|
||
choices += [OpenStruct.new :name => "1 month ago", :value => 1.month.ago]
|
||
choices += [OpenStruct.new :name => "3 months ago", :value => 3.month.ago]
|
||
choices += [OpenStruct.new :name => "All Reports", :value => Report.first(:select => "created_at").created_at]
|
||
builder.collection_select :reported_at_gt, choices, :value, :name, {:include_blank => "Select a period"}
|
||
end
|
||
end
|
Also available in: Unified diff
Fixes #249 - Remove AS from reports
Added a searchbar for hostname, reporting period and the type of report.