Project

General

Profile

« Previous | Next » 

Revision b09b4515

Added by Ohad Levy about 14 years ago

  • ID b09b451583194c3bae7cafc2b5331f1319c4681a
Fixes #193 - move hosts controller away from AS
  • Remove active scaffold from hosts controller.
  • changed default host graphs from one day for up to one week
  • added dynamic dropdown boxes for host creation / edit page (e.g. for puppet classes, operating systems etc).
  • converted puppet class selection to a template, using it in hostgroups and hosts edit page.
  • Renamed puppetgroups to hostgroups for consistency
  • Added search option to list, this include search by facts as well

View differences:

app/helpers/hosts_helper.rb
link_to_if(Report.maximum('id', :conditions => {:host_id => record.id}), time, report_host_path(record))
end
def root_pass_form_column(record, field_name)
password_field_tag field_name, record.root_pass
end
# method that reformats the hostname column by adding the status icons
def name_column(record)
if record.build and not record.installed_at.nil?
......
link_to(record.shortname, host_path(record))
end
def disk_form_column(record, field_name)
text_area_tag field_name, record.disk, :cols => 120, :rows => 10
end
def comment_form_column(record, field_name)
text_area_tag field_name, record.comment, :cols => 120, :rows => 10
end
def options_for_association_conditions(association)
case association.name
when :media
{'medias.operatingsystem_id' => @record.operatingsystem_id}
when :ptable
{'ptables.operatingsystem_id' => @record.operatingsystem_id}
else
super
end
end
def days_ago time
((Time.now - time) / 1.day).round.to_i
end
def searching?
params[:search].empty?
end
end

Also available in: Unified diff