From 492d77ece3bf6fa2dd3ad5e1b68a4aeedc8f87fb Mon Sep 17 00:00:00 2001 From: vanshuhassija Date: Wed, 9 Aug 2023 15:07:09 +0530 Subject: [PATCH] AMBARI-25980 Hbase Summary Page make links inactive for inactive servers --- .../templates/main/service/info/summary.hbs | 4 ++-- .../app/views/common/quick_view_link_view.js | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/ambari-web/app/templates/main/service/info/summary.hbs b/ambari-web/app/templates/main/service/info/summary.hbs index f9e3131ce56..8efcf427136 100644 --- a/ambari-web/app/templates/main/service/info/summary.hbs +++ b/ambari-web/app/templates/main/service/info/summary.hbs @@ -96,9 +96,9 @@ {{/if}} {{#each quickLinks in group.links}} -
{{quickLinks.publicHostNameLabel}}
+
{{quickLinks.publicHostNameLabel}}
{{#each quickLinks}} - {{label}} + {{label}} {{/each}} {{/each}} diff --git a/ambari-web/app/views/common/quick_view_link_view.js b/ambari-web/app/views/common/quick_view_link_view.js index 12815546776..de18810b575 100644 --- a/ambari-web/app/views/common/quick_view_link_view.js +++ b/ambari-web/app/views/common/quick_view_link_view.js @@ -520,6 +520,15 @@ App.QuickLinksView = Em.View.extend({ } else { quickLinks.set('publicHostNameLabel', host.publicHostName); } + if(host.hasOwnProperty("started")){ + quickLinks.set("serverComponentStopped",!host.started); + } + if(host.started&&host.status&&host.status===Em.I18n.t('quick.links.label.active')){ + quickLinks.set("activeClass","text-success"); + } + else{ + quickLinks.set("activeClass","") + } quickLinksArray.push(quickLinks); }, this); return quickLinksArray; @@ -623,8 +632,16 @@ App.QuickLinksView = Em.View.extend({ * @method processHbaseHosts */ processHbaseHosts: function (hosts, response) { + var activeHbaseServers=this.get('content.hostComponents') + .filterProperty('componentName', 'HBASE_MASTER') + .filterProperty('workStatus', 'STARTED') + .mapProperty('hostName'); return hosts.map(function (host) { + let isActiveServerHost=false; var isActiveMaster; + if(host&&host.hostName){ + isActiveServerHost=activeHbaseServers.includes(host.hostName); + } response.items.filterProperty('Hosts.host_name', host.hostName).filter(function (item) { var hbaseMaster = item.host_components.findProperty('HostRoles.component_name', 'HBASE_MASTER'); isActiveMaster = hbaseMaster && Em.get(hbaseMaster, 'metrics.hbase.master.IsActiveMaster'); @@ -636,6 +653,7 @@ App.QuickLinksView = Em.View.extend({ if (isActiveMaster === 'false') { host.status = Em.I18n.t('quick.links.label.standby'); } + host.started=isActiveServerHost; return host; }, this); },