Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AMBARI-25980 Hbase Summary Page make links inactive for inactive servers #3738

Open
wants to merge 1 commit into
base: branch-2.7
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions ambari-web/app/templates/main/service/info/summary.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,9 @@
</h5>
{{/if}}
{{#each quickLinks in group.links}}
<h6>{{quickLinks.publicHostNameLabel}}</h6>
<h6 {{bindAttr class="quickLinks.activeClass"}}>{{quickLinks.publicHostNameLabel}}</h6>
{{#each quickLinks}}
<a {{bindAttr href="url"}} target="_blank" rel="noopener noreferrer">{{label}}</a>
<a {{bindAttr href="url" disabled="quickLinks.serverComponentStopped"}} target="_blank" rel="noopener noreferrer">{{label}}</a>
{{/each}}
{{/each}}
</div>
Expand Down
18 changes: 18 additions & 0 deletions ambari-web/app/views/common/quick_view_link_view.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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');
Expand All @@ -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);
},
Expand Down