Repository: ambari Updated Branches: refs/heads/trunk 8ee1cce1e -> 03c757c63
AMBARI-5136 Installer - Install, Start and Test: list of hosts are disappeared after retry. (atkach) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/03c757c6 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/03c757c6 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/03c757c6 Branch: refs/heads/trunk Commit: 03c757c63a5bfcc1dfc64d6a3a221d1a4d4e64a8 Parents: 8ee1cce Author: atkach <[email protected]> Authored: Wed Mar 19 14:22:10 2014 +0200 Committer: atkach <[email protected]> Committed: Wed Mar 19 14:22:10 2014 +0200 ---------------------------------------------------------------------- .../app/controllers/wizard/step9_controller.js | 35 ++++++++++++-------- ambari-web/app/templates/wizard/step9.hbs | 6 ++-- 2 files changed, 25 insertions(+), 16 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/03c757c6/ambari-web/app/controllers/wizard/step9_controller.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/wizard/step9_controller.js b/ambari-web/app/controllers/wizard/step9_controller.js index 40eb5d9..7df8661 100644 --- a/ambari-web/app/controllers/wizard/step9_controller.js +++ b/ambari-web/app/controllers/wizard/step9_controller.js @@ -39,10 +39,9 @@ App.WizardStep9Controller = Em.Controller.extend({ hosts: [], /* - * Array of above hosts that should be made visible depending upon "Host State Filter" chosen <Possible filter values: - * All, In Progress, Warning, Success and Fail> + * Indicate whether to show the message(that there are no hosts to display) instead of list of hosts */ - visibleHosts: [], + isAnyHostDisplayed: true, /** * overall progress of <Install,Start and Test> page shown as progress bar on the top of the page @@ -236,16 +235,26 @@ App.WizardStep9Controller = Em.Controller.extend({ */ updateVisibleHosts: function () { var targetStatus = this.get('category.hostStatus'); - var visibleHosts = (targetStatus === 'all') ? this.get('hosts') : this.get('hosts').filter(function (_host) { - if (targetStatus == 'inProgress') { - return (_host.get('status') == 'info' || _host.get('status') == 'pending' || _host.get('status') == 'in_progress'); - } else if (targetStatus === 'failed') { - return (_host.get('status') === 'failed' || _host.get('status') === 'heartbeat_lost'); - } else { - return (_host.get('status') == targetStatus); - } - }, this); - this.set('visibleHosts', visibleHosts); + var isAnyHostDisplayed = false; + if (targetStatus === 'all') { + isAnyHostDisplayed = true; + this.get('hosts').setEach('isVisible', true); + } else { + this.get('hosts').forEach(function (_host) { + var isVisible = false; + var status = _host.get('status'); + if (targetStatus == 'inProgress') { + isVisible = (status == 'info' || status == 'pending' || status == 'in_progress'); + } else if (targetStatus === 'failed') { + isVisible = (status === 'failed' || status === 'heartbeat_lost'); + } else { + isVisible = (status == targetStatus); + } + isAnyHostDisplayed = (isAnyHostDisplayed || isVisible); + _host.set('isVisible', isVisible); + }, this) + } + this.set('isAnyHostDisplayed', isAnyHostDisplayed); }.observes('category'), /** http://git-wip-us.apache.org/repos/asf/ambari/blob/03c757c6/ambari-web/app/templates/wizard/step9.hbs ---------------------------------------------------------------------- diff --git a/ambari-web/app/templates/wizard/step9.hbs b/ambari-web/app/templates/wizard/step9.hbs index e3b2a48..b17ad66 100644 --- a/ambari-web/app/templates/wizard/step9.hbs +++ b/ambari-web/app/templates/wizard/step9.hbs @@ -75,9 +75,9 @@ </thead> <tbody> - {{#if controller.visibleHosts.length}} - {{#each host in controller.visibleHosts}} - {{#view App.HostStatusView objBinding="host" controllerBinding="controller"}} + {{#if isAnyHostDisplayed}} + {{#each host in hosts}} + {{#view App.HostStatusView objBinding="host" controllerBinding="controller" classBinding="host.isVisible::hidden"}} <td> {{host.name}} </td>
