Revision e54016da
Added by Marek Hulán over 8 years ago
app/controllers/hosts_controller.rb | ||
---|---|---|
format.html do
|
||
@hosts = search.includes(included_associations).paginate(:page => params[:page])
|
||
# SQL optimizations queries
|
||
@last_reports = Report.where(:host_id => @hosts.map(&:id)).group(:host_id).maximum(:id)
|
||
@last_report_ids = Report.where(:host_id => @hosts.map(&:id)).group(:host_id).maximum(:id)
|
||
@last_reports = Report.where(:id => @last_report_ids.values)
|
||
# rendering index page for non index page requests (out of sync hosts etc)
|
||
@hostgroup_authorizer = Authorizer.new(User.current, :collection => @hosts.map(&:hostgroup_id).compact.uniq)
|
||
render :index if title and (@title = title)
|
||
... | ... | |
end
|
||
|
||
def review_before_build
|
||
@build = @host.build_status
|
||
@build = @host.build_status_checker
|
||
render :layout => false
|
||
end
|
||
|
Also available in: Unified diff
Fixes #10782 - global host status
Introduce new global host status that is composed of host substatuses.Each substatus defines a mapping to the global one which can result in
three values
Plugins can add their own substatuses. These are automatically
propagated also to API.
Thanks to Tomas Strachota who wrote the original code.