Project

General

Profile

« Previous | Next » 

Revision 82e47ae0

Added by Amos Benari about 12 years ago

  • ID 82e47ae0f86994702c3a084cc6150250a81034ee

updates UI to bootstrap v2

View differences:

app/helpers/hosts_helper.rb
# method that reformat the hostname column by adding the status icons
def name_column(record)
if record.build
style ="notice"
style ="label-info"
label = "Pending Installation"
short = "B"
elsif record.respond_to?(:enabled) && !record.enabled
......
short = "N"
elsif record.no_report
label = "Out of sync"
style = "warning"
style = "label-warning"
short = "S"
elsif record.error?
label = "Error"
style = "important"
style = "lable-important"
short = "E"
elsif record.changes?
label = "Active"
style = "notice"
style = "label-info"
short = "A"
elsif record.pending?
label = "Pending"
style = "warning"
style = "label-warning"
short = "P"
else
label = "No changes"
style = "success"
style = "label-success"
short = "O"
end
content_tag(:span, short, {:rel => "twipsy", :class => "label " + style, :"data-original-title" => label} ) +
link_to(trunc(" #{record}",36), host_path(record))
link_to(trunc(" #{record}",32), host_path(record))
end
def days_ago time
......
def report_status_chart name, title, subtitle, data, options = {}
content_tag(:div, nil,
{ :id => name,
:class => 'span11 host_chart',
:class => 'span7 host_chart',
:'chart-name' => name,
:'chart-title' => title,
:'chart-subtitle' => subtitle,
......
def runtime_chart name, title, subtitle, data, options = {}
content_tag(:div, nil,
{ :id => name,
:class => 'span11 host_chart',
:class => 'span7 host_chart',
:'chart-name' => name,
:'chart-title' => title,
:'chart-subtitle' => subtitle,
......
form_tag @host, :id => 'days_filter', :method => :get do
content_tag(:span, "Reports from the last ") +
select(nil, 'range', 1..days_ago(@host.reports.first.reported_at),
{:selected => @range}, {:class=>"mini", :onchange =>"$('#days_filter').submit();$(this).disabled();"}).html_safe +
{:selected => @range}, {:class=>"span1", :onchange =>"$('#days_filter').submit();$(this).disabled();"}).html_safe +
" days - #{@host.reports.recent(@range.days.ago).count} reports found"
end
end

Also available in: Unified diff