From d71fb2a5ebfe8f7a33a156ec0117a4734efcaae2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A1vid=20Hal=C3=A1sz?= Date: Wed, 11 Jul 2018 15:25:58 +0200 Subject: [PATCH] Display the original zone on summary screens of suspended providers --- app/helpers/ems_cloud_helper/textual_summary.rb | 3 ++- app/helpers/ems_container_helper/textual_summary.rb | 3 ++- app/helpers/ems_infra_helper/textual_summary.rb | 3 ++- app/helpers/ems_network_helper/textual_summary.rb | 3 ++- app/helpers/ems_physical_infra_helper/textual_summary.rb | 3 ++- app/helpers/ems_storage_helper/textual_summary.rb | 3 ++- 6 files changed, 12 insertions(+), 6 deletions(-) diff --git a/app/helpers/ems_cloud_helper/textual_summary.rb b/app/helpers/ems_cloud_helper/textual_summary.rb index 5986c3283535..5794645158ad 100644 --- a/app/helpers/ems_cloud_helper/textual_summary.rb +++ b/app/helpers/ems_cloud_helper/textual_summary.rb @@ -145,7 +145,8 @@ def textual_security_groups end def textual_zone - {:label => _("Managed by Zone"), :icon => "pficon pficon-zone", :value => @record.zone.name} + zone = @record.zone.visible? ? @record.zone : @record.backup_zone + {:label => _("Managed by Zone"), :icon => "pficon pficon-zone", :value => zone.name} end def textual_topology diff --git a/app/helpers/ems_container_helper/textual_summary.rb b/app/helpers/ems_container_helper/textual_summary.rb index 402005251105..c60e029aaee7 100644 --- a/app/helpers/ems_container_helper/textual_summary.rb +++ b/app/helpers/ems_container_helper/textual_summary.rb @@ -69,7 +69,8 @@ def textual_port end def textual_zone - {:label => _("Managed by Zone"), :icon => "pficon pficon-zone", :value => @record.zone.name} + zone = @record.zone.visible? ? @record.zone : @record.backup_zone + {:label => _("Managed by Zone"), :icon => "pficon pficon-zone", :value => zone.name} end def textual_topology diff --git a/app/helpers/ems_infra_helper/textual_summary.rb b/app/helpers/ems_infra_helper/textual_summary.rb index f7e931cdb0ee..ba88f0a3a465 100644 --- a/app/helpers/ems_infra_helper/textual_summary.rb +++ b/app/helpers/ems_infra_helper/textual_summary.rb @@ -170,7 +170,8 @@ def textual_orchestration_stacks end def textual_zone - {:label => _("Managed by Zone"), :icon => "pficon pficon-zone", :value => @record.zone.name} + zone = @record.zone.visible? ? @record.zone : @record.backup_zone + {:label => _("Managed by Zone"), :icon => "pficon pficon-zone", :value => zone.name} end def textual_host_default_vnc_port_range diff --git a/app/helpers/ems_network_helper/textual_summary.rb b/app/helpers/ems_network_helper/textual_summary.rb index deb24d904638..b5191d79783c 100644 --- a/app/helpers/ems_network_helper/textual_summary.rb +++ b/app/helpers/ems_network_helper/textual_summary.rb @@ -102,7 +102,8 @@ def textual_topology end def textual_zone - {:label => _("Managed by Zone"), :icon => "pficon pficon-zone", :value => @record.zone.try(:name)} + zone = @record.zone.visible? ? @record.zone : @record.backup_zone + {:label => _("Managed by Zone"), :icon => "pficon pficon-zone", :value => zone.name} end def textual_cloud_tenants diff --git a/app/helpers/ems_physical_infra_helper/textual_summary.rb b/app/helpers/ems_physical_infra_helper/textual_summary.rb index b863251b3e71..15ecf8a9ae84 100644 --- a/app/helpers/ems_physical_infra_helper/textual_summary.rb +++ b/app/helpers/ems_physical_infra_helper/textual_summary.rb @@ -94,7 +94,8 @@ def textual_vms end def textual_zone - {:label => _("Managed by Zone"), :icon => "pficon pficon-zone", :value => @record.zone.name} + zone = @record.zone.visible? ? @record.zone : @record.backup_zone + {:label => _("Managed by Zone"), :icon => "pficon pficon-zone", :value => zone.name} end def textual_topology diff --git a/app/helpers/ems_storage_helper/textual_summary.rb b/app/helpers/ems_storage_helper/textual_summary.rb index ae14e4c67592..15eded2d975f 100644 --- a/app/helpers/ems_storage_helper/textual_summary.rb +++ b/app/helpers/ems_storage_helper/textual_summary.rb @@ -60,7 +60,8 @@ def textual_parent_ems_cloud end def textual_zone - {:label => _("Managed by Zone"), :icon => "pficon pficon-zone", :value => @record.zone.try(:name)} + zone = @record.zone.visible? ? @record.zone : @record.backup_zone + {:label => _("Managed by Zone"), :icon => "pficon pficon-zone", :value => zone.name} end def textual_cloud_volumes