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 21, 2017
1 parent 117d578 commit eb9b128
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 10 deletions.
10 changes: 5 additions & 5 deletions app/assets/stylesheets/patternfly_overrides.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/// begin layout styling
/// ===================================================================

/// this media query makes the left column and the main area independently
/// this media query makes the left column and the main area independently
/// scrollable and sets the paging_div at the bottom of the column

@media (min-width: $screen-sm) {
Expand Down Expand Up @@ -383,7 +383,7 @@ table.table.table-summary-screen tbody td img {
}

.flobj { position: absolute;z-index: auto;width: 72px;}
.flobj p { margin: 5px 0 0 0;padding: 0;color: #e3e4e4;vertical-align: middle;text-align:center;text-transform: none;text-shadow: 0 0 3px #000;font: normal 16px OpenSansSemibold,Arial,Helvetica,sans-serif !important;}
.flobj p { margin: 5px 0 0 0;padding: 0;color: #e3e4e4;vertical-align: middle;text-align:center;text-transform: none;text-shadow: 0 0 3px #000;font: normal 16px OpenSansSemibold,Arial,Helvetica,sans-serif;}
.a72 { padding: 3px 0 0 5px; width: 28px; height: 28px;font-size: 1.3em;line-height: 1.8em;}
.b72 { padding: 3px 0 0 37px; font-size: 1.3em;line-height: 1.8em;}
.c72 { padding: 38px 0 0 5px; width: 31px; height: 31px;font-size: 1.3em;line-height: 1.7em;}
Expand Down Expand Up @@ -480,7 +480,7 @@ table.table td {
word-break: break-all
}

#gtl_div table.table td { // Enable word wrapping
#gtl_div table.table td { // Enable word wrapping
word-break: normal !important;
}

Expand Down Expand Up @@ -548,7 +548,7 @@ table.table tbody td img {
border: none;
}

// override font-weight for dropdowns within table headers
// override font-weight for dropdowns within table headers

.table thead th select {
font-weight: normal
Expand Down Expand Up @@ -701,7 +701,7 @@ td.action > .btn.btn-default {
overflow-x: hidden;
}

/// error modal
/// error modal

.error-modal-miq {
& .error-icon {
Expand Down
3 changes: 2 additions & 1 deletion app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,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
17 changes: 14 additions & 3 deletions app/helpers/quadicon_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -441,9 +441,9 @@ def flobj_img_small(image = nil, cls = '')
flobj_img_simple(image, cls, 64)
end

def flobj_p_simple(cls, text)
def flobj_p_simple(cls, text, test_style = nil)
content_tag(:div, :class => "flobj #{cls}") do
content_tag(:p, text)
content_tag(:p, text, :style => test_style)
end
end

Expand Down Expand Up @@ -558,11 +558,22 @@ 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.container_nodes.size
else
item.hosts.size
end
output << flobj_p_simple("a72", item_count)
# reduce font-size of the item_count so it will fit in its quadrant
output << flobj_p_simple("a72", item_count, item_count.to_s.size > 2 ? "font-size: 12px;" : "")
output << flobj_p_simple("b72", item.total_miq_templates) if item.kind_of?(EmsCloud)

output << if item.kind_of?(::ManageIQ::Providers::ContainerManager)
if item.enabled?
flobj_img_simple("svg/currentstate-on.svg", "b72")
else
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 eb9b128

Please sign in to comment.