Feature #259

Ability to search Hosts by Parameters

Added by Bash Shell 4 months ago. Updated 3 months ago.

Status:New Start:05/17/2010
Priority:Normal Due date:
Assigned to:- % Done:

0%

Category:Web Interface
Target version:0.1-6
Branch:

Description

It would be useful to add a Search by Parameter field to the search bar

Adding these two lines in _searchbar.erb seems to do it:

diff --git a/app/views/common/_searchbar.erb b/app/views/common/_searchbar.erb
index 91abe8b..c9adc52 100644
--- a/app/views/common/_searchbar.erb
+++ b/app/views/common/_searchbar.erb
@@ -20,6 +20,8 @@
           </span>
           <%= f.label :hostgroup, "Role" %>
           <%= f.collection_select :hostgroup_id_eq, Hostgroup.all, :id, :name, :include_blank => true %>
+          <%= f.label :parameter, "Parameter" %>
+          <%= f.text_field :host_parameters_name_like, :size => 10 %>
           <%= render :partial => 'common/fact_selected' %>
           <%= f.submit "Go" %> Save as tab: <%= text_field_tag :tab_name, "" %>
         <% end %>

This is useful as assigning parameters to individual hosts creates "drift" and there should be a way to search for such Parameters.


Related issues

related to Refactor #250: Remove activescaffold from the domain parameters page Closed 05/13/2010
follows Feature #248: Generalise the searchbar and tabs to support multiple controllers Closed 05/13/2010

History

Updated by Bash Shell 4 months ago

Or this:

diff --git a/app/views/common/_searchbar.erb b/app/views/common/_searchbar.erb
index 91abe8b..2534123 100644
--- a/app/views/common/_searchbar.erb
+++ b/app/views/common/_searchbar.erb
@@ -20,6 +20,8 @@
           </span>
           <%= f.label :hostgroup, "Role" %>
           <%= f.collection_select :hostgroup_id_eq, Hostgroup.all, :id, :name, :include_blank => true %>
+          <%= f.label :parameter, "Parameter" %>
+          <%= f.collection_select :host_parameters_name_like, Parameter.find(:all, :select => "DISTINCT name", :order => "name", :conditions => ['type="HostParameter"']), :name, :name, :include_blank => true %>
           <%= render :partial => 'common/fact_selected' %>
           <%= f.submit "Go" %> Save as tab: <%= text_field_tag :tab_name, "" %>
         <% end %>

This works too, but how can I improve?

Updated by Ohad Levy 4 months ago

@Paul, do you want to generalize your domain parameters to any type of parameters?
as we are limited with screen size (but have many options for searching) maybe we need to break down more search options, like two select drop boxes (like with facts).

Updated by Ohad Levy 3 months ago

  • Category set to Web Interface
  • Target version set to 0.1-6

Also available in: Atom PDF