Project

General

Profile

Feature #226 » dash226.patch

Bash Shell, 05/02/2010 07:05 AM

View differences:

app/controllers/dashboard_controller.rb
def errors
@search = Host.recent.with_error.search(params[:search])
hosts = @search.paginate :page => params[:page]
render :partial => "hosts/minilist", :layout => true, :locals => {
:hosts => hosts,
:header => "Hosts with errors" }
respond_to do |format|
format.html {
hosts = @search.paginate :page => params[:page]
render :partial => "hosts/minilist", :layout => true, :locals => {
:hosts => hosts,
:header => "Hosts with errors" }
}
format.yml { render :text => @search.map(&:name).to_yaml }
end
end
def active
@search = Host.recent.with_changes.search(params[:search])
hosts = @search.paginate :page => params[:page]
render :partial => "hosts/minilist", :layout => true, :locals => {
:hosts => hosts,
:header => "Active Hosts" }
respond_to do |format|
format.html {
hosts = @search.paginate :page => params[:page]
render :partial => "hosts/minilist", :layout => true, :locals => {
:hosts => hosts,
:header => "Active Hosts" }
}
format.yml { render :text => @search.map(&:name).to_yaml }
end
end
def OutOfSync
@search = Host.out_of_sync.search(params[:search])
hosts = @search.paginate :page => params[:page]
render :partial => "hosts/minilist", :layout => true, :locals => {
:hosts => hosts,
:header => "Hosts which didnt run puppet in the last #{SETTINGS[:puppet_interval]} minutes" }
respond_to do |format|
format.html {
hosts = @search.paginate :page => params[:page]
render :partial => "hosts/minilist", :layout => true, :locals => {
:hosts => hosts,
:header => "Hosts which didnt run puppet in the last #{SETTINGS[:puppet_interval]} minutes" }
}
format.yml { render :text => @search.map(&:name).to_yaml }
end
end
private
(2-2/2)