瀏覽代碼

AMBARI-1145. Cluster Management refactoring. (yusaku)

git-svn-id: https://svn.apache.org/repos/asf/incubator/ambari/trunk@1431815 13f79535-47bb-0310-9956-ffa450edef68
Yusaku Sako 12 年之前
父節點
當前提交
6baec08553

+ 3 - 3
ambari-web/app/controllers/wizard/step10_controller.js

@@ -48,8 +48,8 @@ App.WizardStep10Controller = Em.Controller.extend({
       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.Controller.extend({
     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',

+ 16 - 4
ambari-web/app/controllers/wizard/step3_controller.js

@@ -27,10 +27,19 @@ App.WizardStep3Controller = Em.Controller.extend({
   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.Controller.extend({
       return item.get(field) == value;
     });
   },
+
   categories: function () {
     var self = this;
     self.categoryObject.reopen({
@@ -68,7 +78,9 @@ App.WizardStep3Controller = Em.Controller.extend({
 
     return categories;
   }.property(),
+
   category: false,
+
   allChecked: false,
 
   onAllChecked: function () {
@@ -266,7 +278,6 @@ App.WizardStep3Controller = Em.Controller.extend({
       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.Controller.extend({
               _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.Controller.extend({
 
         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);

+ 5 - 0
ambari-web/app/initialize.js

@@ -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');

+ 5 - 3
ambari-web/app/styles/application.less

@@ -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 {