Revision cdd8bb6f
Added by Paul Kelly about 14 years ago
- ID cdd8bb6f9dedcfc2eccd882ad79c5ac637c6bcf5
app/controllers/hosts_controller.rb | ||
---|---|---|
before_filter :require_ssl, :except => [ :query, :externalNodes, :lookup ]
|
||
before_filter :find_hosts, :only => :query
|
||
before_filter :ajax_methods, :only => [:environment_selected, :architecture_selected, :os_selected]
|
||
before_filter :load_tabs, :manage_tabs, :only => :index
|
||
|
||
helper :hosts
|
||
|
||
def index
|
||
... | ... | |
assign_parameter "operatingsystem"
|
||
end
|
||
|
||
# list AJAX methods
|
||
def fact_selected
|
||
@fact_name_id = params[:search_fact_values_fact_name_id_eq].to_i
|
||
@fact_values = FactValue.find(:all, :select => 'DISTINCT value', :conditions => {
|
||
:fact_name_id => @fact_name_id }, :order => 'value ASC') if @fact_name_id > 0
|
||
render :partial => 'fact_selected', :layout => false
|
||
end
|
||
|
||
#returns a yaml file ready to use for puppet external nodes script
|
||
#expected a fqdn parameter to provide hostname to lookup
|
||
#see example script in extras directory
|
||
... | ... | |
redirect_to :controller => "reports", :action => "show", :id => Report.maximum('id', :conditions => {:host_id => params[:id]})
|
||
end
|
||
|
||
# shows all reports for a certian host
|
||
# shows all reports for a certain host
|
||
def reports
|
||
@host = Host.find(params[:id])
|
||
end
|
Also available in: Unified diff
Fixes #183 - Adds searchbar facility to hosts
Qualified the fact_selected partial
Added a reset button
Added popup help
Beautification and grooming