diff options
author | Adam Jacob <adam@opscode.com> | 2010-02-26 16:03:55 -0800 |
---|---|---|
committer | Adam Jacob <adam@opscode.com> | 2010-02-26 16:03:55 -0800 |
commit | b63be18279aa4a191089de83ee00b42f33637acf (patch) | |
tree | 63e79b0d4143c7ba8aa677d34d1b0379fea90720 | |
parent | ee65c8eccbad3e14c37276b0ba30b1a49f3a05e3 (diff) | |
parent | 20d016bd3bb1ccfbc65fbbb9e0d62b11db12f86f (diff) | |
download | chef-b63be18279aa4a191089de83ee00b42f33637acf.tar.gz |
Merge branch 'CHEF-989' of git://github.com/nuoyan/chef into nuoyan/CHEF-989
7 files changed, 29 insertions, 25 deletions
diff --git a/chef-server-webui/app/controllers/search.rb b/chef-server-webui/app/controllers/search.rb index db45538b75..7965eed2ae 100644 --- a/chef-server-webui/app/controllers/search.rb +++ b/chef-server-webui/app/controllers/search.rb @@ -40,7 +40,7 @@ class ChefServerWebui::Search < ChefServerWebui::Application @s = Chef::Search::Query.new query = params[:q].nil? ? "*:*" : (params[:q].empty? ? "*:*" : params[:q]) @results = @s.search(params[:id], query) - @type = if params[:id].to_s == "node" || params[:id].to_s == "role" + @type = if params[:id].to_s == "node" || params[:id].to_s == "role" || params[:id].to_s == "client" params[:id] else "databag" @@ -51,8 +51,9 @@ class ChefServerWebui::Search < ChefServerWebui::Application end @results render - rescue StandardError => e - @_message = { :error => "Unable to find the #{params[:id]}. (#{$!})" } + rescue => e + Chef::Log.error("#{e}\n#{e.backtrace.join("\n")}") + @_message = { :error => "Unable to find the #{params[:id]}." } @search_indexes = @s.list_indexes render :index end diff --git a/chef-server-webui/app/helpers/application_helper.rb b/chef-server-webui/app/helpers/application_helper.rb index 1fe2f4fe5c..93c0cf4932 100644 --- a/chef-server-webui/app/helpers/application_helper.rb +++ b/chef-server-webui/app/helpers/application_helper.rb @@ -134,7 +134,7 @@ module Merb #for showing search result def determine_name(type, object) case type - when :node, :role + when :node, :role, :client object.name else params[:id] diff --git a/chef-server-webui/app/views/clients/index.html.haml b/chef-server-webui/app/views/clients/index.html.haml index ba7df0e3bb..6d9c0a742b 100644 --- a/chef-server-webui/app/views/clients/index.html.haml +++ b/chef-server-webui/app/views/clients/index.html.haml @@ -7,12 +7,13 @@ .inner %table.table %tr - %th.first Name + %th.first{:colspan => 2} Name + %th %th.last - even = false; - @clients_list.each do |client| %tr{ :class => even ? "even" : "odd" } - %td= link_to(client[0], slice_url(:client, client[0])) + %td{:colspan => 2}= link_to(client[0], slice_url(:client, client[0])) %td = link_to('Edit', slice_url(:edit_client, client[0])) | diff --git a/chef-server-webui/app/views/databags/index.html.haml b/chef-server-webui/app/views/databags/index.html.haml index ad5f0c5a5c..7e880061ec 100644 --- a/chef-server-webui/app/views/databags/index.html.haml +++ b/chef-server-webui/app/views/databags/index.html.haml @@ -7,11 +7,12 @@ .inner %table.table %tr - %th.first Databag Name - %th.last + %th.first{:colspan => 2} Databag Name + %th + %th.last - @databags.sort.each_with_index do |databag, index| %tr{:class => "#{index % 2 == 1 ? 'odd' : 'even'}"} - %td= link_to databag[0], slice_url(:databag, { :id => databag[0] }) + %td{:colspan => 2}= link_to databag[0], slice_url(:databag, { :id => databag[0] }) %td = link_to('Edit', slice_url(:databag, :id => databag[0])) | diff --git a/chef-server-webui/app/views/databags/show.html.haml b/chef-server-webui/app/views/databags/show.html.haml index 61c574dbb5..abee8c0a15 100644 --- a/chef-server-webui/app/views/databags/show.html.haml +++ b/chef-server-webui/app/views/databags/show.html.haml @@ -7,11 +7,12 @@ .inner %table.table %tr - %th.first Databag Items + %th.first{:colspan => 2} Databag Items + %th %th.last - @databag.sort.each_with_index do |databag_item_uri, index| %tr{:class => "#{index % 2 == 1 ? 'odd' : 'even'}"} - %td= link_to databag_item_uri[0], slice_url(:databag_databag_item, :id => databag_item_uri[0], :databag_id => @databag_name) + %td{:colspan => 2}= link_to databag_item_uri[0], slice_url(:databag_databag_item, :id => databag_item_uri[0], :databag_id => @databag_name) %td = link_to('Edit', slice_url(:edit_databag_databag_item, :id => databag_item_uri[0], :databag_id => @databag_name)) | diff --git a/chef-server-webui/app/views/roles/index.html.haml b/chef-server-webui/app/views/roles/index.html.haml index ed1677bf06..ee38369d8e 100644 --- a/chef-server-webui/app/views/roles/index.html.haml +++ b/chef-server-webui/app/views/roles/index.html.haml @@ -7,13 +7,13 @@ .inner %table.table %tr - %th.first Name - %th + %th.first{:colspan => 2} Name + %th %th.last - even = false; - @role_list.each do |role| %tr{ :class => even ? "even" : "odd" } - %td= link_to(role[0], slice_url(:role, role[0])) + %td{:colspan => 2}= link_to(role[0], slice_url(:role, role[0])) %td = link_to('Edit', slice_url(:edit_role, role[0])) | diff --git a/chef-server-webui/app/views/users/index.html.haml b/chef-server-webui/app/views/users/index.html.haml index 532b583d10..69db307d23 100644 --- a/chef-server-webui/app/views/users/index.html.haml +++ b/chef-server-webui/app/views/users/index.html.haml @@ -7,14 +7,14 @@ .inner %table.table %tr - %th.first User Name - %th.last - - even = false - - @users.sort.each do |user, user_url| - %tr{:class => even ? "even": "odd" } - %td= link_to user, slice_url(:users_show, :user_id => user) - %td - = link_to('Edit', slice_url(:users_edit, :user_id => user)) - | - = link_to('Delete', slice_url(:users_delete, :user_id => user), :method => "delete", :confirm => "Really delete User #{user}? There is no undo.") -
\ No newline at end of file + %th.first{:colspan => 2} Username + %th + %th.last + - even = false + - @users.sort.each do |user, user_url| + %tr{:class => even ? "even": "odd" } + %td{:colspan => 2}= link_to user, slice_url(:users_show, :user_id => user) + %td + = link_to('Edit', slice_url(:users_edit, :user_id => user)) + | + = link_to('Delete', slice_url(:users_delete, :user_id => user), :method => "delete", :confirm => "Really delete User #{user}? There is no undo.") |