Author: yusaku
Date: Sat Jan 19 01:33:07 2013
New Revision: 1435446

URL: http://svn.apache.org/viewvc?rev=1435446&view=rev
Log:
AMBARI-1223. Confirm Hosts page: It looks like hosts disappear if you are on 
"Fail" filter and click on "Retry Failed" button. (yusaku)

Modified:
    incubator/ambari/trunk/CHANGES.txt
    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/routes/installer.js
    incubator/ambari/trunk/ambari-web/app/templates/wizard/step3.hbs

Modified: incubator/ambari/trunk/CHANGES.txt
URL: 
http://svn.apache.org/viewvc/incubator/ambari/trunk/CHANGES.txt?rev=1435446&r1=1435445&r2=1435446&view=diff
==============================================================================
--- incubator/ambari/trunk/CHANGES.txt (original)
+++ incubator/ambari/trunk/CHANGES.txt Sat Jan 19 01:33:07 2013
@@ -17,6 +17,9 @@ Trunk (unreleased changes):
 
  IMPROVEMENTS
 
+ AMBARI-1223. Confirm Hosts page: It looks like hosts disappear if you are
+ on "Fail" filter and click on "Retry Failed" button. (yusaku)
+
  AMBARI-1222. DAG, Jobs Timeline, and Tasks graphs UI cleanup. (yusaku)
 
  AMBARI-1221. There is no default sort order on Hosts table and the order

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=1435446&r1=1435445&r2=1435446&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 
Sat Jan 19 01:33:07 2013
@@ -245,6 +245,8 @@ App.WizardStep3Controller = Em.Controlle
   },
 
   retrySelectedHosts: function () {
+    //to display all hosts
+    this.set('category', 'All');
     if (!this.get('isRetryDisabled')) {
       this.set('isRetryDisabled', true);
       var selectedHosts = this.get('bootHosts').filterProperty('bootStatus', 
'FAILED');
@@ -267,6 +269,28 @@ App.WizardStep3Controller = Em.Controlle
     this.doBootstrap();
   },
 
+  isInstallInProgress: function(){
+    var bootStatuses = this.get('bootHosts').getEach('bootStatus');
+    if(bootStatuses.length &&
+      (bootStatuses.contains('REGISTERING') ||
+        bootStatuses.contains('DONE') ||
+        bootStatuses.contains('RUNNING') ||
+        bootStatuses.contains('PENDING'))){
+      return true;
+    }
+    return false;
+  }.property('[email protected]'),
+
+  disablePreviousSteps: function(){
+    if(this.get('isInstallInProgress')){
+      App.router.get('installerController').setLowerStepsDisable(3);
+      this.set('isSubmitDisabled', true);
+    } else {
+      
App.router.get('installerController.isStepDisabled').findProperty('step', 
1).set('value', false);
+      
App.router.get('installerController.isStepDisabled').findProperty('step', 
2).set('value', false);
+    }
+  }.observes('isInstallInProgress'),
+
   doBootstrap: function () {
     if (this.get('stopBootstrap')) {
       return;
@@ -298,10 +322,11 @@ App.WizardStep3Controller = Em.Controlle
             for (var i = 0; i < hosts.length; i++) {
 
               var isValidHost = data.hostsStatus.someProperty('hostName', 
hosts[i].get('name'));
-
-              if (!isValidHost) {
-                hosts[i].set('bootStatus', 'FAILED');
-                hosts[i].set('bootLog', 'Registration with the server 
failed.');
+              if(hosts[i].get('bootStatus') !== 'REGISTERED'){
+                if (!isValidHost) {
+                  hosts[i].set('bootStatus', 'FAILED');
+                  hosts[i].set('bootLog', 'Registration with the server 
failed.');
+                }
               }
             }
           }

Modified: incubator/ambari/trunk/ambari-web/app/messages.js
URL: 
http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/messages.js?rev=1435446&r1=1435445&r2=1435446&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/messages.js (original)
+++ incubator/ambari/trunk/ambari-web/app/messages.js Sat Jan 19 01:33:07 2013
@@ -121,6 +121,8 @@ Em.I18n.translations = {
   'installer.step3.hosts.retry.popup.body':'Are you sure you want to retry 
discovery of the selected host(s)?',
   'installer.step3.hostInformation.popup.header':'Error in retrieving host 
Information',
   'installer.step3.hostInformation.popup.body' : 'All bootstrapped hosts 
registered but unable to retrieve cpu and memory related information',
+  'installer.step3.hosts.noHosts':'No hosts to display',
+
   'installer.step4.header':'Choose Services',
   'installer.step4.body':'Choose which services you want to install on your 
cluster.',
   'installer.step4.mapreduceCheck.popup.header':'MapReduce Needed',

Modified: incubator/ambari/trunk/ambari-web/app/routes/installer.js
URL: 
http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/routes/installer.js?rev=1435446&r1=1435445&r2=1435446&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/routes/installer.js (original)
+++ incubator/ambari/trunk/ambari-web/app/routes/installer.js Sat Jan 19 
01:33:07 2013
@@ -148,7 +148,12 @@ module.exports = Em.Route.extend({
       controller.loadAllPriorSteps();
       controller.connectOutlet('wizardStep3', controller.get('content'));
     },
-    back: Em.Router.transitionTo('step2'),
+    back: function(event){
+      //if install not in progress
+      if(!event.context){
+        Em.Router.transitionTo('step2');
+      }
+    },
     next: function (router, context) {
       var installerController = router.get('installerController');
       var wizardStep3Controller = router.get('wizardStep3Controller');

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=1435446&r1=1435445&r2=1435446&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/templates/wizard/step3.hbs (original)
+++ incubator/ambari/trunk/ambari-web/app/templates/wizard/step3.hbs Sat Jan 19 
01:33:07 2013
@@ -81,7 +81,7 @@
         </thead>
 
         <tbody>
-
+        {{#if visibleHosts.length}}
         {{#each host in visibleHosts}}
         {{#view App.WizardHostView categoryBinding="controller.category" 
hostInfoBinding="host"}}
         <td>
@@ -108,6 +108,11 @@
         </td>
         {{/view}}
         {{/each}}
+        {{else}}
+        <tr>
+            <td colspan="5"><p>{{t installer.step3.hosts.noHosts}}</p></td>
+        </tr>
+        {{/if}}
 
         </tbody>
 
@@ -120,7 +125,7 @@
     </div>
   </div>
   <div class="btn-area">
-    <a class="btn pull-left" {{action back}}>&larr; Back</a>
+    <a class="btn pull-left" {{bindAttr disabled="isInstallInProgress"}} 
{{action back isInstallInProgress}}>&larr; Back</a>
     <a class="btn btn-success pull-right" {{bindAttr 
disabled="isSubmitDisabled"}} {{action submit target="controller"}}>Next 
&rarr;</a>
   </div>
 </div>
\ No newline at end of file


Reply via email to