Updated Branches: refs/heads/branch-1.4 1533957ca -> 4c5ad03a2
AMBARI-2978. HDFS Summary: JournalNodes should not show if none is installed (total is 0). (Aleksandr Kovalenko via yusaku) Project: http://git-wip-us.apache.org/repos/asf/incubator-ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ambari/commit/4c5ad03a Tree: http://git-wip-us.apache.org/repos/asf/incubator-ambari/tree/4c5ad03a Diff: http://git-wip-us.apache.org/repos/asf/incubator-ambari/diff/4c5ad03a Branch: refs/heads/branch-1.4 Commit: 4c5ad03a24d1872326506d0fb5eab772bd54ae25 Parents: 1533957 Author: Yusaku Sako <[email protected]> Authored: Wed Aug 21 10:56:13 2013 -0700 Committer: Yusaku Sako <[email protected]> Committed: Wed Aug 21 10:57:37 2013 -0700 ---------------------------------------------------------------------- .../templates/main/dashboard/service/hdfs.hbs | 28 +++++++++++--------- .../app/views/main/dashboard/service/hdfs.js | 6 ++++- 2 files changed, 20 insertions(+), 14 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/4c5ad03a/ambari-web/app/templates/main/dashboard/service/hdfs.hbs ---------------------------------------------------------------------- diff --git a/ambari-web/app/templates/main/dashboard/service/hdfs.hbs b/ambari-web/app/templates/main/dashboard/service/hdfs.hbs index 8e68727..895ec8a 100644 --- a/ambari-web/app/templates/main/dashboard/service/hdfs.hbs +++ b/ambari-web/app/templates/main/dashboard/service/hdfs.hbs @@ -58,19 +58,21 @@ </td> </tr> <!-- Journal Nodes --> - <tr> - <td>{{t dashboard.services.hdfs.journalnodes}}</td> - <td> - <span> - {{#view view.journalNodesLiveTextView}} - {{view.liveComponents}}/{{view.totalComponents}} - {{/view}} - </span> {{t services.service.summary.JournalNodesLive}} - <div class="summary-view-host"> - <a href="#" {{action filterHosts view.journalNodeComponent}}>{{view.journalNodeHostText}}</a> - </div> - </td> - </tr> + {{#if view.showJournalNodes}} + <tr> + <td>{{t dashboard.services.hdfs.journalnodes}}</td> + <td> + <span> + {{#view view.journalNodesLiveTextView}} + {{view.liveComponents}}/{{view.totalComponents}} + {{/view}} + </span> {{t services.service.summary.JournalNodesLive}} + <div class="summary-view-host"> + <a href="#" {{action filterHosts view.journalNodeComponent}}>{{view.journalNodeHostText}}</a> + </div> + </td> + </tr> + {{/if}} <!-- NameNode Uptime --> <tr> <td>{{t dashboard.services.hdfs.nodes.uptime}}</td> http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/4c5ad03a/ambari-web/app/views/main/dashboard/service/hdfs.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/dashboard/service/hdfs.js b/ambari-web/app/views/main/dashboard/service/hdfs.js index 89c04d3..d45b7b1 100644 --- a/ambari-web/app/views/main/dashboard/service/hdfs.js +++ b/ambari-web/app/views/main/dashboard/service/hdfs.js @@ -61,6 +61,10 @@ App.MainDashboardServiceHdfsView = App.MainDashboardServiceView.extend({ } }.property("service"), + showJournalNodes: function () { + return App.HostComponent.find().filterProperty('componentName', 'JOURNALNODE').get('length') > 0; + }.property('service.hostComponents.@each'), + journalNodeHostText: function () { if(this.get("service.journalNodes").content.length > 1){ return Em.I18n.t('services.service.summary.viewHosts'); @@ -165,7 +169,7 @@ App.MainDashboardServiceHdfsView = App.MainDashboardServiceView.extend({ return App.HostComponent.find().findProperty('componentName', 'DATANODE'); }.property(), - journalNodeComponent: function () { + journalNodeComponent: function () { return App.HostComponent.find().findProperty('componentName', 'JOURNALNODE'); }.property(),
