You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by yu...@apache.org on 2014/02/04 22:43:12 UTC

git commit: AMBARI-4514. On Decom/Recom, sometimes it takes a long time for the background operations to appear. (xiwang via yusaku)

Updated Branches:
  refs/heads/trunk aa7ba4d27 -> e969f4388


AMBARI-4514. On Decom/Recom, sometimes it takes a long time for the background operations to appear. (xiwang via yusaku)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/e969f438
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/e969f438
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/e969f438

Branch: refs/heads/trunk
Commit: e969f4388af28dc0652dc74154fa9ebc95cf5f2f
Parents: aa7ba4d
Author: Yusaku Sako <yu...@hortonworks.com>
Authored: Tue Feb 4 13:42:43 2014 -0800
Committer: Yusaku Sako <yu...@hortonworks.com>
Committed: Tue Feb 4 13:42:43 2014 -0800

----------------------------------------------------------------------
 ambari-web/app/controllers/main/host/details.js | 32 ++++++++++++++------
 1 file changed, 22 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/e969f438/ambari-web/app/controllers/main/host/details.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/host/details.js b/ambari-web/app/controllers/main/host/details.js
index 7ac6522..10ba0cc 100644
--- a/ambari-web/app/controllers/main/host/details.js
+++ b/ambari-web/app/controllers/main/host/details.js
@@ -818,18 +818,30 @@ App.MainHostDetailsController = Em.Controller.extend({
     });
   },
 
-  decommissionAndStartSuccessCallback: function (response, request, data) {
-    console.log('Success in decommission callback:' + response);
-    if (!App.testMode) {
-      App.router.get('clusterController').loadUpdatedStatusDelayed(500);
-    }
-  },
-  decommissionSuccessCallback: function (response, request, data) {
-    console.log('Success in decommission callback:' + response);
-  },
   decommissionErrorCallback: function (request, ajaxOptions, error) {
     console.log('ERROR: '+ error);
   },
+  /**
+   * Success ajax response for Recommission/Decommission slaves
+   * @param data
+   * @param ajaxOptions
+   */
+  decommissionSuccessCallback: function(data, ajaxOptions) {
+    if(data && (data.Requests || data.resources[0].RequestSchedule) ) {
+      if (!App.testMode) {
+        App.router.get('clusterController').loadUpdatedStatusDelayed(500);
+      }
+      // load data (if we need to show this background operations popup) from persist
+      App.router.get('applicationController').dataLoading().done(function (initValue) {
+        if (initValue) {
+          App.router.get('backgroundOperationsController').showPopup();
+        }
+      });
+    }
+    else {
+      console.log('cannot get request id from ', data);
+    }
+  },
 
   doRecommissionAndStart:  function(hostName, serviceName, componentName, slaveType, startContext){
     var contextNameString_1 = 'hosts.host.' + slaveType.toLowerCase() + '.recommission';
@@ -875,7 +887,7 @@ App.MainHostDetailsController = Em.Controller.extend({
           }
         ]
       },
-      success: 'decommissionAndStartSuccessCallback',
+      success: 'decommissionSuccessCallback',
       error: 'decommissionErrorCallback'
     });
   },