Project

General

Profile

« Previous | Next » 

Revision c030c794

Added by Bash Shell about 14 years ago

  • ID c030c794276e8d14b139b0710cb6ac1b5e167bb6

fixes #226 - Return OutofSync, Error Host list from Dashboard controller as YAML

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 didn't run puppet in the last #{SETTINGS[:puppet_interval]} minutes" }
}
format.yml { render :text => @search.map(&:name).to_yaml }
end
end
private

Also available in: Unified diff