Project

General

Profile

« Previous | Next » 

Revision 4e42b118

Added by Ohad Levy over 14 years ago

  • ID 4e42b118e9d745c077904e81f7c3aeeca4b88524

added basic pagination

View differences:

.gitmodules
[submodule "vendor/plugins/active_scaffold_list_filter"]
path = vendor/plugins/active_scaffold_list_filter
url = git://github.com/tvongaza/active_scaffold_list_filters.git
[submodule "vendor/plugins/will_paginate"]
path = vendor/plugins/will_paginate
url = git://github.com/mislav/will_paginate.git
app/controllers/dashboard_controller.rb
end
def errors
hosts = Host.recent.with_error.paginate(:page => params[:page], :order => 'last_report DESC')
render :partial => "hosts/minilist", :layout => true, :locals => {
:hosts => Host.recent.with_error,
:hosts => hosts,
:header => "Hosts with errors" }
end
def active
hosts = Host.recent.with_changes.paginate(:page => params[:page], :order => 'last_report DESC')
render :partial => "hosts/minilist", :layout => true, :locals => {
:hosts => Host.recent.with_changes,
:hosts => hosts,
:header => "Active Hosts" }
end
def OutOfSync
hosts = Host.out_of_sync.paginate(:page => params[:page], :order => 'last_report DESC')
render :partial => "hosts/minilist", :layout => true, :locals => {
:hosts => Host.out_of_sync,
:hosts => hosts,
:header => "Hosts which didnt run puppet in the last #{SETTINGS[:puppet_interval]} minutes" }
end
app/views/hosts/_minilist.html.erb
<% end -%>
</div>
<%= link_to "Back", :back %>
<%= will_paginate hosts %>
public/stylesheets/style.css
p {
line-height: 150%;
}
#header {height:4.3em;margin:0;background-color:#406480;color:#E6DFCF;padding: 4px 8px 0px 6px; position:relative;}
#header {height:3.7em;margin:0;background-color:#406480;color:#E6DFCF;padding: 4px 8px 0px 6px; position:relative;}
#header a {
float:right;
......
.fieldWithErrors {
border: solid 1px #f00;
}
/* host show page */
#title, td.last_row { font-weight: bold; }
#host_overview {
float:right;
width:30%
}
#host_overview table { border: 1px solid #ccc; }
#host_overview table th{ text-align: left; }
.pagination { float: right }
#host_report {
border-bottom: 1px solid #ccc;
float: left;
width:70%
}
#border-it { border: 2px solid #ddd; }
vendor/plugins/will_paginate
Subproject commit 3d531e169db92a16a9a8974f0ae6edf52e52659e

Also available in: Unified diff