Skip to content

Commit

Permalink
Add a topology view for a single physical infra provider
Browse files Browse the repository at this point in the history
  • Loading branch information
felipedf committed Jun 18, 2018
1 parent b254764 commit 01542e1
Show file tree
Hide file tree
Showing 6 changed files with 101 additions and 99 deletions.
2 changes: 1 addition & 1 deletion app/assets/javascripts/services/topology_service.js
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ ManageIQ.angular.app.service('topologyService', ['$location', '$http', 'miqServi
return controller.dataUrl;
}

var match = screenUrl.match(/(ems_container|show)\/([0-9]+)\?display=topology$/) ||
var match = screenUrl.match(/(ems_container|ems_physical_infra|show)\/([0-9]+)\?display=topology$/) ||
screenUrl.match(/(_topology)\/show\/([0-9]+)\/?$/);

if (match) {
Expand Down
59 changes: 1 addition & 58 deletions app/views/container_topology/show.html.haml
Original file line number Diff line number Diff line change
@@ -1,58 +1 @@
- tooltip_options = {"tooltip-placement" => "bottom", "uib-tooltip" => "{{vm.legendTooltip}}"}
.topology{'ng-controller' => "containerTopologyController as vm"}
.legend
%label#selected
%div{'ng-if' => "vm.kinds"}
%kubernetes-topology-icon{tooltip_options, :kind => "ContainerReplicator"}
%label
%i.pficon.pficon-replicator
= _("Replicators")
%kubernetes-topology-icon{tooltip_options, :kind => "ContainerGroup"}
%label
%i.fa.fa-cubes
= _("Pods")
%kubernetes-topology-icon{tooltip_options, :kind => "Container"}
%label
%i.fa.fa-cube
= _("Containers")
%kubernetes-topology-icon{tooltip_options, :kind => "ContainerService"}
%label
%i.pficon.pficon-service
= _("Services")
%kubernetes-topology-icon{tooltip_options, :kind => "ContainerRoute"}
%label
%i.pficon.pficon-route
= _("Routes")
%kubernetes-topology-icon{tooltip_options, :kind => "ContainerNode"}
%label
%i.pficon.pficon-container-node
= _("Nodes")
%kubernetes-topology-icon{tooltip_options, :kind => "Vm"}
%label
%i.pficon.pficon-virtual-machine
= _("VMs")
%kubernetes-topology-icon{tooltip_options, :kind => "Host"}
%label
%i.pficon.pficon-screen
= _("Hosts")

.alert.alert-info.alert-dismissable
%button.close{"aria-hidden" => "true", "data-dismiss" => "alert", :type => "button"}
%span.pficon.pficon-close
%span.pficon.pficon-info
%strong
= _("Click on the legend to show/hide entities, and double click/right click the entities in the graph to navigate to their summary pages.")
.alert.alert-warning.alert-dismissable
%button.close{"aria-hidden" => "true", "data-dismiss" => "alert", :type => "button"}
%span.pficon.pficon-close
%span.pficon.pficon-warning-triangle-o
%strong
= _("Note: displaying a very large number of objects in the topology display can adversely affect the performance of some web browsers.")
= render :partial => "shared/topology/not_found_vm"
%kubernetes-topology-graph{:items => "vm.items", :relations => "vm.relations", :kinds => "vm.kinds"}
:javascript
miq_bootstrap('.topology');
= render :partial => "ems_container/show_topology"
58 changes: 58 additions & 0 deletions app/views/ems_container/_show_topology.html.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
- tooltip_options = {"tooltip-placement" => "bottom", "uib-tooltip" => "{{vm.legendTooltip}}"}
.topology{'ng-controller' => "containerTopologyController as vm"}
.legend
%label#selected
%div{'ng-if' => "vm.kinds"}
%kubernetes-topology-icon{tooltip_options, :kind => "ContainerReplicator"}
%label
%i.pficon.pficon-replicator
= _("Replicators")
%kubernetes-topology-icon{tooltip_options, :kind => "ContainerGroup"}
%label
%i.fa.fa-cubes
= _("Pods")
%kubernetes-topology-icon{tooltip_options, :kind => "Container"}
%label
%i.fa.fa-cube
= _("Containers")
%kubernetes-topology-icon{tooltip_options, :kind => "ContainerService"}
%label
%i.pficon.pficon-service
= _("Services")
%kubernetes-topology-icon{tooltip_options, :kind => "ContainerRoute"}
%label
%i.pficon.pficon-route
= _("Routes")
%kubernetes-topology-icon{tooltip_options, :kind => "ContainerNode"}
%label
%i.pficon.pficon-container-node
= _("Nodes")
%kubernetes-topology-icon{tooltip_options, :kind => "Vm"}
%label
%i.pficon.pficon-virtual-machine
= _("VMs")
%kubernetes-topology-icon{tooltip_options, :kind => "Host"}
%label
%i.pficon.pficon-screen
= _("Hosts")

.alert.alert-info.alert-dismissable
%button.close{"aria-hidden" => "true", "data-dismiss" => "alert", :type => "button"}
%span.pficon.pficon-close
%span.pficon.pficon-info
%strong
= _("Click on the legend to show/hide entities, and double click/right click the entities in the graph to navigate to their summary pages.")
.alert.alert-warning.alert-dismissable
%button.close{"aria-hidden" => "true", "data-dismiss" => "alert", :type => "button"}
%span.pficon.pficon-close
%span.pficon.pficon-warning-triangle-o
%strong
= _("Note: displaying a very large number of objects in the topology display can adversely affect the performance of some web browsers.")
= render :partial => "shared/topology/not_found_vm"
%kubernetes-topology-graph{:items => "vm.items", :relations => "vm.relations", :kinds => "vm.kinds"}
:javascript
miq_bootstrap('.topology');
39 changes: 39 additions & 0 deletions app/views/ems_physical_infra/_show_topology.html.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
- tooltipOptions = {"tooltip-placement" => "bottom", "uib-tooltip" => "{{vm.legendTooltip}}"}
.topology{'ng-controller' => "physicalInfraTopologyController as vm"}
.legend
%label#selected
%div{'ng-if' => "vm.kinds"}
%kubernetes-topology-icon{tooltipOptions, :kind => "PhysicalRack"}
%label
%i.pficon.pficon-enterprise
= _("Physical Racks")
%kubernetes-topology-icon{tooltipOptions, :kind => "PhysicalServer"}
%label
%i.pficon.pficon-server-group
= _("Physical Servers")
%kubernetes-topology-icon{tooltipOptions, :kind => "PhysicalSwitch"}
%label
%i.ff.ff-network-switch
= _("Physical Switches")
%kubernetes-topology-icon{tooltipOptions, :kind => "Host"}
%label
%i.pficon.pficon-screen
= _("Hosts")
%kubernetes-topology-icon{tooltipOptions, :kind => "Vm"}
%label
%i.pficon.pficon-screen
= _("VMs")

.alert.alert-info.alert-dismissable
%button.close{"aria-hidden" => "true", "data-dismiss" => "alert", :type => "button"}
%span.pficon.pficon-close
%span.pficon.pficon-info
%strong
= _("Click on the legend to show/hide entities, and double click/right click the entities in the graph to navigate to their summary pages.")
= render :partial => "shared/topology/not_found_vm"
%kubernetes-topology-graph{:items => "vm.items", :relations => "vm.relations", :kinds => "vm.kinds"}
:javascript
miq_bootstrap('.topology');
40 changes: 1 addition & 39 deletions app/views/physical_infra_topology/show.html.haml
Original file line number Diff line number Diff line change
@@ -1,39 +1 @@
- tooltipOptions = {"tooltip-placement" => "bottom", "uib-tooltip" => "{{vm.legendTooltip}}"}
.topology{'ng-controller' => "physicalInfraTopologyController as vm"}
.legend
%label#selected
%div{'ng-if' => "vm.kinds"}
%kubernetes-topology-icon{tooltipOptions, :kind => "PhysicalRack"}
%label
%i.pficon.pficon-enterprise
= _("Physical Racks")
%kubernetes-topology-icon{tooltipOptions, :kind => "PhysicalServer"}
%label
%i.pficon.pficon-server-group
= _("Physical Servers")
%kubernetes-topology-icon{tooltipOptions, :kind => "PhysicalSwitch"}
%label
%i.ff.ff-network-switch
= _("Physical Switches")
%kubernetes-topology-icon{tooltipOptions, :kind => "Host"}
%label
%i.pficon.pficon-screen
= _("Hosts")
%kubernetes-topology-icon{tooltipOptions, :kind => "Vm"}
%label
%i.pficon.pficon-screen
= _("VMs")

.alert.alert-info.alert-dismissable
%button.close{"aria-hidden" => "true", "data-dismiss" => "alert", :type => "button"}
%span.pficon.pficon-close
%span.pficon.pficon-info
%strong
= _("Click on the legend to show/hide entities, and double click/right click the entities in the graph to navigate to their summary pages.")
= render :partial => "shared/topology/not_found_vm"
%kubernetes-topology-graph{:items => "vm.items", :relations => "vm.relations", :kinds => "vm.kinds"}
:javascript
miq_bootstrap('.topology');
= render :partial => "ems_physical_infra/show_topology"
2 changes: 1 addition & 1 deletion app/views/shared/views/ems_common/_show.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@
- elsif @showtype == 'ad_hoc_metrics'
= render :partial => 'show_ad_hoc_metrics'
- elsif @showtype == 'topology'
= render :file => 'container_topology/show'
= render :partial => 'show_topology'

0 comments on commit 01542e1

Please sign in to comment.