Skip to content

Commit

Permalink
Followup to ManageIQ#1663: quadicon and dashboard fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Ari Zellner committed Aug 20, 2017
1 parent f3c6e7c commit a504165
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 2 deletions.
3 changes: 2 additions & 1 deletion app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ def pp_choices
:miq_template => true,
:physical_server => true,
:storage => true,
:vm => true
:vm => true,
:ems_container => true
},
:views => { # List view setting, by resource type
:authkeypaircloud => "list",
Expand Down
1 change: 1 addition & 0 deletions app/controllers/configuration_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -547,6 +547,7 @@ def get_form_vars
when "ui_1" # Visual Settings tab
@edit[:new][:quadicons][:ems] = params[:quadicons_ems] == "true" if params[:quadicons_ems]
@edit[:new][:quadicons][:ems_cloud] = params[:quadicons_ems_cloud] == "true" if params[:quadicons_ems_cloud]
@edit[:new][:quadicons][:ems_container] = params[:quadicons_ems_container] == "true" if params[:quadicons_ems_container]
@edit[:new][:quadicons][:host] = params[:quadicons_host] == "true" if params[:quadicons_host]
@edit[:new][:quadicons][:vm] = params[:quadicons_vm] == "true" if params[:quadicons_vm]
@edit[:new][:quadicons][:physical_server] = params[:quadicons_physical_server] == "true" if params[:quadicons_physical_server]
Expand Down
10 changes: 10 additions & 0 deletions app/helpers/quadicon_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -558,11 +558,21 @@ def render_ext_management_system_quadicon(item, options)
item_count = case item
when EmsPhysicalInfra then item.physical_servers.size
when EmsCloud then item.total_vms
when ::ManageIQ::Providers::ContainerManager then item.containers.size
else
item.hosts.size
end
output << flobj_p_simple("a72", item_count)
output << flobj_p_simple("b72", item.total_miq_templates) if item.kind_of?(EmsCloud)

if item.kind_of?(::ManageIQ::Providers::ContainerManager)
if item.enabled?
output << flobj_img_simple("svg/currentstate-on.svg", "b72")
else
output << flobj_img_simple("svg/currentstate-paused.svg", "b72")
end
end

output << flobj_img_simple("svg/vendor-#{h(item.image_name)}.svg", "c72")
output << flobj_img_simple(img_for_auth_status(item), "d72")
output << flobj_img_simple('100/shield.png', "g72") unless item.get_policies.empty?
Expand Down
1 change: 1 addition & 0 deletions app/views/configuration/_ui_1.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
-# Host Item is commented (condition set as false) until we have host item quads
- [[role_allows?(:feature => "ems_infra_show_list"), ui_lookup(:table => "ems_infra"), "ems"],
[role_allows?(:feature => "ems_cloud_show_list"), ui_lookup(:table => "ems_cloud"), "ems_cloud"],
[role_allows?(:feature => "ems_container_show_list"), ui_lookup(:table => "ems_container"), "ems_container"],
[role_allows?(:feature => "host_show_list"), _("Host"), "host"],
[role_allows?(:feature => "storage_show_list"), ui_lookup(:table => "storages"), "storage"],
[true, _("VM"), "vm"],
Expand Down
2 changes: 1 addition & 1 deletion app/views/ems_container/_show_dashboard.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
= render :partial => "layouts/flash_msg"
.row.row-tile-pf
.col-xs-12.col-sm-12.col-md-2
.card-pf.card-pf-accented.card-pf-aggregate-status.provider-status-card
.card-pf.card-pf-accented.card-pf-aggregate-status.provider-status-card{"ng-if" => "isSingleProvider"}
%h2.card-pf-title
%img.provider-icon-small{"ng-src" =>"{{providerTypeIconImage}}"}
{{providerTypeName}}
Expand Down

0 comments on commit a504165

Please sign in to comment.