incubator-ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yus...@apache.org
Subject svn commit: r1431815 - in /incubator/ambari/trunk/ambari-web/app: controllers/wizard/step10_controller.js controllers/wizard/step3_controller.js initialize.js styles/application.less
Date Fri, 11 Jan 2013 02:22:21 GMT
Author: yusaku
Date: Fri Jan 11 02:22:20 2013
New Revision: 1431815

URL: http://svn.apache.org/viewvc?rev=1431815&view=rev
Log:
AMBARI-1145. Cluster Management refactoring. (yusaku)

Modified:
    incubator/ambari/trunk/ambari-web/app/controllers/wizard/step10_controller.js
    incubator/ambari/trunk/ambari-web/app/controllers/wizard/step3_controller.js
    incubator/ambari/trunk/ambari-web/app/initialize.js
    incubator/ambari/trunk/ambari-web/app/styles/application.less

Modified: incubator/ambari/trunk/ambari-web/app/controllers/wizard/step10_controller.js
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/controllers/wizard/step10_controller.js?rev=1431815&r1=1431814&r2=1431815&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/controllers/wizard/step10_controller.js (original)
+++ incubator/ambari/trunk/ambari-web/app/controllers/wizard/step10_controller.js Fri Jan
11 02:22:20 2013
@@ -48,8 +48,8 @@ App.WizardStep10Controller = Em.Controll
       hostObj = hostObj.concat(_hosts.hosts);
     }, this);
     slaveHosts = hostObj.mapProperty('hostName').uniq();
-    var registeredHosts = masterHosts.concat(slaveHosts).uniq();
-    var registerHostsStatement = registeredHosts.length + ' hosts registered to the cluster.';
+    var registeredHosts = App.Host.find().mapProperty('hostName').concat(masterHosts.concat(slaveHosts)).uniq();
+    var registerHostsStatement = 'The cluster consists of ' + registeredHosts.length + '
hosts';
     var registerHostsObj = Ember.Object.create({
       id: 1,
       color: 'text-info',
@@ -71,7 +71,7 @@ App.WizardStep10Controller = Em.Controll
     var succeededHosts = hostsInfo.filterProperty('status', 'success');
     var warnedHosts = hostsInfo.filterProperty('status', 'warning').concat(hostsInfo.filterProperty('status',
'failed'));
     if (succeededHosts.length) {
-      var successStatement = succeededHosts.length + ' ' + ((succeededHosts.length > 1)
? 'hosts' : 'host') + ' installed and started services successfully.';
+      var successStatement = 'Installed and started services successfully on ' + succeededHosts.length
+ ' new ' + ((succeededHosts.length > 1) ? 'hosts' : 'host');
       this.get('clusterInfo').findProperty('id', 1).get('status').pushObject(Ember.Object.create({
         id: 1,
         color: 'text-success',

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=1431815&r1=1431814&r2=1431815&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 Jan 11
02:22:20 2013
@@ -27,10 +27,19 @@ App.WizardStep3Controller = Em.Controlle
   registrationTimeoutSecs: 120,
   stopBootstrap: false,
   isSubmitDisabled: true,
+
   categoryObject: Em.Object.extend({
     hostsCount: function () {
       var category = this;
-      var hosts = this.get('controller.hosts').filterProperty('bootStatus', category.get('hostsBootStatus'));
+      var hosts = this.get('controller.hosts').filter(function(_host) {
+        if (_host.get('bootStatus') == category.get('hostsBootStatus')) {
+          return true;
+        } else if (_host.get('bootStatus') == 'DONE' && category.get('hostsBootStatus')
== 'REGISTERING') {
+          return true;
+        } else {
+          return false;
+        }
+      }, this);
       return hosts.get('length');
     }.property('controller.hosts.@each.bootStatus'), // 'hosts.@each.bootStatus'
     label: function () {
@@ -42,6 +51,7 @@ App.WizardStep3Controller = Em.Controlle
       return item.get(field) == value;
     });
   },
+
   categories: function () {
     var self = this;
     self.categoryObject.reopen({
@@ -68,7 +78,9 @@ App.WizardStep3Controller = Em.Controlle
 
     return categories;
   }.property(),
+
   category: false,
+
   allChecked: false,
 
   onAllChecked: function () {
@@ -266,7 +278,6 @@ App.WizardStep3Controller = Em.Controlle
       type: 'GET',
       url: url,
       timeout: App.timeout,
-      cache: false,
       success: function (data) {
         if (data.hostsStatus !== null) {
           // in case of bootstrapping just one host, the server returns an object rather
than an array, so
@@ -356,7 +367,7 @@ App.WizardStep3Controller = Em.Controlle
               _host.set('bootStatus', 'REGISTERING');
               _host.set('bootLog', (_host.get('bootLog') != null ? _host.get('bootLog') :
'') + '\nRegistering with the server...');
               // update registration timestamp so that the timeout is computed from the last
host that finished bootstrapping
-              self.get('registrationStartedAt', new Date().getTime());
+              self.set('registrationStartedAt', new Date().getTime());
               stopPolling = false;
               break;
             case 'REGISTERING':
@@ -381,7 +392,8 @@ App.WizardStep3Controller = Em.Controlle
 
         if (stopPolling) {
           self.getHostInfo();
-        } else if (new Date().getTime() - self.get('registrationStartedAt') < self.get('registrationTimeoutSecs')
* 1000) {
+        } else if (hosts.someProperty('bootStatus', 'RUNNING') || new Date().getTime() -
self.get('registrationStartedAt') < self.get('registrationTimeoutSecs') * 1000) {
+          // we want to keep polling for registration status if any of the hosts are still
bootstrapping (so we check for RUNNING).
           window.setTimeout(function () {
             self.isHostsRegistered();
           }, 3000);

Modified: incubator/ambari/trunk/ambari-web/app/initialize.js
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/initialize.js?rev=1431815&r1=1431814&r2=1431815&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/initialize.js (original)
+++ incubator/ambari/trunk/ambari-web/app/initialize.js Fri Jan 11 02:22:20 2013
@@ -35,6 +35,11 @@ App.bgOperationsUpdateInterval = 6000;
 App.componentsUpdateInterval = 6000;
 App.contentUpdateInterval = 15000;
 
+// this is to make sure that IE does not cache data when making AJAX calls to the server
+$.ajaxSetup({
+  cache: false
+});
+
 require('messages');
 require('utils/base64');
 require('utils/data_table');

Modified: incubator/ambari/trunk/ambari-web/app/styles/application.less
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/styles/application.less?rev=1431815&r1=1431814&r2=1431815&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/styles/application.less (original)
+++ incubator/ambari/trunk/ambari-web/app/styles/application.less Fri Jan 11 02:22:20 2013
@@ -550,10 +550,12 @@ a:focus {
     margin: 0 0 0 -30%;
     max-height: 526px;
     top:5%;
-  }
-
-  .modal-body{
+    overflow: hidden;
 
+    .modal-body{
+      max-height: 461px;
+      overflow-y: auto;
+    }
   }
 
   .clear {



Mime
View raw message