Return-Path: X-Original-To: apmail-incubator-ambari-commits-archive@minotaur.apache.org Delivered-To: apmail-incubator-ambari-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 56E4910156 for ; Fri, 7 Jun 2013 18:30:52 +0000 (UTC) Received: (qmail 81812 invoked by uid 500); 7 Jun 2013 18:30:52 -0000 Delivered-To: apmail-incubator-ambari-commits-archive@incubator.apache.org Received: (qmail 81790 invoked by uid 500); 7 Jun 2013 18:30:52 -0000 Mailing-List: contact ambari-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: ambari-dev@incubator.apache.org Delivered-To: mailing list ambari-commits@incubator.apache.org Received: (qmail 81780 invoked by uid 99); 7 Jun 2013 18:30:52 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 07 Jun 2013 18:30:52 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 07 Jun 2013 18:30:50 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 01D4D2388847; Fri, 7 Jun 2013 18:30:31 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1490774 - in /incubator/ambari/trunk/ambari-web/app: controllers/wizard/step3_controller.js messages.js templates/wizard/step3.hbs views/wizard/step3_view.js Date: Fri, 07 Jun 2013 18:30:30 -0000 To: ambari-commits@incubator.apache.org From: yusaku@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20130607183031.01D4D2388847@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: yusaku Date: Fri Jun 7 18:30:30 2013 New Revision: 1490774 URL: http://svn.apache.org/r1490774 Log: AMBARI-2315. Misleading to say host checks ok when you have at least one failed register host. (Oleg Nechiporenko via yusaku) Modified: incubator/ambari/trunk/ambari-web/app/controllers/wizard/step3_controller.js incubator/ambari/trunk/ambari-web/app/messages.js incubator/ambari/trunk/ambari-web/app/templates/wizard/step3.hbs incubator/ambari/trunk/ambari-web/app/views/wizard/step3_view.js Modified: incubator/ambari/trunk/ambari-web/app/controllers/wizard/step3_controller.js URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/controllers/wizard/step3_controller.js?rev=1490774&r1=1490773&r2=1490774&view=diff ============================================================================== --- incubator/ambari/trunk/ambari-web/app/controllers/wizard/step3_controller.js (original) +++ incubator/ambari/trunk/ambari-web/app/controllers/wizard/step3_controller.js Fri Jun 7 18:30:30 2013 @@ -458,6 +458,17 @@ App.WizardStep3Controller = Em.Controlle } }, + allHostsComplete: function() { + var result = true; + this.get('bootHosts').forEach(function(host) { + var status = host.get('bootStatus'); + if (status != 'REGISTERED' && status != 'FAILED') { + result = false; + } + }); + return result; + }.property('bootHosts.@each.bootStatus'), + registerErrPopup: function (header, message) { App.ModalPopup.show({ header: header, @@ -643,9 +654,11 @@ App.WizardStep3Controller = Em.Controlle }, this); return isWarning; }.property('warnings'), + isWarningsBoxVisible: function(){ - return (App.testMode) ? true : !this.get('isSubmitDisabled'); - }.property('isSubmitDisabled'), + return (App.testMode) ? true : this.get('allHostsComplete'); + }.property('allHostsComplete'), + checksUpdateProgress:0, checksUpdateStatus: null, /** @@ -954,7 +967,7 @@ App.WizardStep3Controller = Em.Controlle back: function () { if (this.get('isInstallInProgress')) { - return false; + return; } App.router.send('back'); } Modified: incubator/ambari/trunk/ambari-web/app/messages.js URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/messages.js?rev=1490774&r1=1490773&r2=1490774&view=diff ============================================================================== --- incubator/ambari/trunk/ambari-web/app/messages.js (original) +++ incubator/ambari/trunk/ambari-web/app/messages.js Fri Jun 7 18:30:30 2013 @@ -329,7 +329,9 @@ Em.I18n.translations = { 'installer.step3.warnings.description':'Some warnings were encountered while performing checks against the above hosts.', 'installer.step3.warnings.linkText':'Click here to see the warnings.', 'installer.step3.noWarnings.linkText':'Click here to see the check results.', - 'installer.step3.warnings.noWarnings':'All host checks were successful.', + 'installer.step3.warnings.noWarnings':'All host checks passed on {0} registered hosts.', + 'installer.step3.warnings.fails':'Some warnings were encountered while performing checks against the {0} registered hosts above', + 'installer.step3.warnings.someWarnings':'All host checks passed on {0} registered hosts. Note: Host checks were skipped on {1} hosts that failed to register.', 'installer.step3.warnings.updateChecks.success':'Host Checks successfully updated', 'installer.step3.warnings.updateChecks.failed':'Host Checks update failed', 'installer.step3.removeSelected':'Remove Selected', Modified: incubator/ambari/trunk/ambari-web/app/templates/wizard/step3.hbs URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/templates/wizard/step3.hbs?rev=1490774&r1=1490773&r2=1490774&view=diff ============================================================================== --- incubator/ambari/trunk/ambari-web/app/templates/wizard/step3.hbs (original) +++ incubator/ambari/trunk/ambari-web/app/templates/wizard/step3.hbs Fri Jun 7 18:30:30 2013 @@ -125,17 +125,10 @@ {{#if isWarningsBoxVisible}} - {{#if isHostHaveWarnings}} -
- {{t installer.step3.warnings.description}}
- {{t installer.step3.warnings.linkText}} +
+ {{view.message}} + {{view.linkText}}
- {{else}} -
- {{t installer.step3.warnings.noWarnings}} - {{t installer.step3.noWarnings.linkText}} -
- {{/if}} {{/if}}
← {{t common.back}} Modified: incubator/ambari/trunk/ambari-web/app/views/wizard/step3_view.js URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/views/wizard/step3_view.js?rev=1490774&r1=1490773&r2=1490774&view=diff ============================================================================== --- incubator/ambari/trunk/ambari-web/app/views/wizard/step3_view.js (original) +++ incubator/ambari/trunk/ambari-web/app/views/wizard/step3_view.js Fri Jun 7 18:30:30 2013 @@ -26,7 +26,38 @@ App.WizardStep3View = Em.View.extend({ didInsertElement: function () { this.get('controller').navigateStep(); - } + }, + + message:'', + linkText: '', + status: '', + + monitorStatuses: function() { + var failedHosts = 0; + var hosts = this.get('controller.bootHosts'); + hosts.forEach(function(host) { + if (host.get('bootStatus') == 'FAILED') { + failedHosts++; + } + }); + if (this.get('controller.isHostHaveWarnings')) { + this.set('status', 'alert-warn'); + this.set('linkText', Em.I18n.t('installer.step3.warnings.linkText')); + this.set('message', Em.I18n.t('installer.step3.warnings.fails').format(hosts.length, failedHosts)); + } + else { + this.set('status', 'alert-success'); + this.set('linkText', Em.I18n.t('installer.step3.noWarnings.linkText')); + if (failedHosts == 0) { + // all are ok + this.set('message', Em.I18n.t('installer.step3.warnings.noWarnings').format(hosts.length)); + } + else { + // some failed + this.set('message', Em.I18n.t('installer.step3.warnings.someWarnings').format(hosts.length, failedHosts)); + } + } + }.observes('controller.isHostHaveWarnings', 'controller.bootHosts.@each.bootStatus') }); //todo: move it inside WizardStep3View