ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akovale...@apache.org
Subject ambari git commit: AMBARI-11390. Hosts - Set Rack doesn’t update rack in the UI, no feedback/confirmation (akovalenko)
Date Tue, 26 May 2015 15:04:06 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 614a74fbf -> 256f47ab1


AMBARI-11390. Hosts - Set Rack doesn’t update rack in the UI, no feedback/confirmation (akovalenko)


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

Branch: refs/heads/trunk
Commit: 256f47ab18488d5783567bf6bd5aea8371a99279
Parents: 614a74f
Author: Aleksandr Kovalenko <akovalenko@hortonworks.com>
Authored: Tue May 26 18:00:47 2015 +0300
Committer: Aleksandr Kovalenko <akovalenko@hortonworks.com>
Committed: Tue May 26 18:03:36 2015 +0300

----------------------------------------------------------------------
 ambari-web/app/utils/hosts.js | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/256f47ab/ambari-web/app/utils/hosts.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/utils/hosts.js b/ambari-web/app/utils/hosts.js
index c04d519..c559214 100644
--- a/ambari-web/app/utils/hosts.js
+++ b/ambari-web/app/utils/hosts.js
@@ -211,8 +211,10 @@ module.exports = {
             data: {
               hostNames: hostNames.join(','),
               requestInfo: operationData.message,
-              rackId: rackId
+              rackId: rackId,
+              hostNamesArray: hostNames
             },
+            success: 'successRackId',
             error: 'errorRackId'
           });
         }
@@ -222,6 +224,17 @@ module.exports = {
   },
 
   /**
+   * Success callback for set rack id request
+   */
+  successRackId: function (response, request, params) {
+    App.Host.find().forEach(function(host){
+      if (params.hostNamesArray.contains(host.get('hostName'))) {
+        host.set('rack', params.rackId)
+      }
+    });
+  },
+
+  /**
    * Warn user that the rack id will not be updated
    */
   errorRackId: function () {


Mime
View raw message