Skip to content

Commit

Permalink
Merge pull request #656 from AparnaKarve/fix_physical_infra_topology
Browse files Browse the repository at this point in the history
Fix Topology graph for Physical Infra Providers
(cherry picked from commit ecc60b7)
  • Loading branch information
himdel authored and simaishi committed Apr 5, 2017
1 parent f8d2217 commit 3c36649
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 29 deletions.
3 changes: 3 additions & 0 deletions app/assets/javascripts/services/topology_service.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ ManageIQ.angular.app.service('topologyService', function() {
case "ContainerManager":
entity_url = "ems_container";
break;
case "PhysicalInfraManager":
entity_url = "ems_physical_infra";
break;
case "NetworkManager":
entity_url = "ems_network";
break;
Expand Down
9 changes: 2 additions & 7 deletions app/services/physical_infra_topology_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,7 @@ def build_topology

included_relations = [
:tags,
:ems_clusters => [
:tags,
:hosts,
],
:physical_servers => [:tags],
]

entity_relationships = {:PhysicalInfraManager => build_entity_relationships(included_relations)}
Expand Down Expand Up @@ -58,15 +55,13 @@ def entity_status(entity)
case entity
when ManageIQ::Providers::PhysicalInfraManager
entity.authentications.blank? ? _('Unknown') : entity.authentications.first.status.try(:capitalize)
when Host
entity.state ? entity.state.downcase.capitalize : _('Unknown')
else
_('Unknown')
end
end

def build_kinds
kinds = [:PhysicalInfraManager, :EmsCluster, :Host]
kinds = [:PhysicalInfraManager, :PhysicalServer, :Tag]
build_legend_kinds(kinds)
end
end
2 changes: 2 additions & 0 deletions app/services/ui_service_mixin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,15 @@ def icons
:CloudTenant => {:type => "glyph", :icon => "\uE904", :fontfamily => "PatternFlyIcons-webfont"}, # pficon-cloud-tenant
:LoadBalancer => {:type => "glyph", :icon => "\uE637", :fontfamily => "IcoMoon"}, # product-load_balancer
:Tag => {:type => "glyph", :icon => "\uF02b", :fontfamily => "FontAwesome"}, # fa-tag
:PhysicalServer => {:type => "glyph", :icon => "\uE91a", :fontfamily => "PatternFlyIcons-webfont"}, # product-physical_server
:Openstack => {:type => "image", :icon => provider_icon(:Openstack)},
:Amazon => {:type => "image", :icon => provider_icon(:Amazon)},
:Azure => {:type => "image", :icon => provider_icon(:Azure)},
:Google => {:type => "image", :icon => provider_icon(:Google)},
:Microsoft => {:type => "image", :icon => provider_icon(:Microsoft)},
:Redhat => {:type => "image", :icon => provider_icon(:Redhat)},
:Vmware => {:type => "image", :icon => provider_icon(:Vmware)},
:Lenovo => {:type => "image", :icon => provider_icon(:Lenovo)},
:Nuage => {:type => "image", :icon => provider_icon(:Nuage_Network)},
}
end
Expand Down
28 changes: 6 additions & 22 deletions app/views/physical_infra_topology/show.html.haml
Original file line number Diff line number Diff line change
@@ -1,35 +1,19 @@
- tooltipOptions = {"tooltip-placement" => "bottom-right", "tooltip" => "{{legendTooltip}}"}
.physical_infra_topology{'ng-controller' => "physicalInfraTopologyController"}
.container_topology{'ng-controller' => "physicalInfraTopologyController"}
.row.toolbar-pf
.col-md-12
= render :partial => "shared/topology_header"
.legend
%label#selected
%div{'ng-if' => "kinds"}
%kubernetes-topology-icon{tooltipOptions, :kind => "Host"}
%svg.kube-topology
%g.EntityLegend.PhysicalInfra.Host
%circle{:r => "17"}
-# pficon-host
%text{:y => "8"} 
%label
= _("Nodes")
%kubernetes-topology-icon{tooltipOptions, :kind => "EmsCluster"}
%kubernetes-topology-icon{tooltipOptions, :kind => "PhysicalServer"}
%svg.kube-topology
%g.EntityLegend.PhysicalInfra
%circle{:r => "17"}
-# pficon-cluster
%text{:y => "9"} 
%label
= _("Roles")
%kubernetes-topology-icon{tooltipOptions, :kind => "Tag"}
%svg.kube-topology
%g.EntityLegend.Network.FloatingIp
%circle{:r => "17"}
-# pficon-cloud-tenant
%text{:y => "9"} 
-# pficon-physical_servers
%text{:y => "9"} 
%label
= _("Tags")
= _("Physical Servers")

.alert.alert-info.alert-dismissable
%button.close{"aria-hidden" => "true", "data-dismiss" => "alert", :type => "button"}
Expand All @@ -40,4 +24,4 @@
%kubernetes-topology-graph{:items => "items", :relations => "relations", :kinds => "kinds"}
:javascript
miq_bootstrap('.physical_infra_topology', 'physicalInfraTopologyApp');
miq_bootstrap('.container_topology', 'physicalInfraTopologyApp');

0 comments on commit 3c36649

Please sign in to comment.