ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yus...@apache.org
Subject git commit: AMBARI-3848. Remove Host JS Error in 'add host wizard'. (xiwang via yusaku)
Date Fri, 22 Nov 2013 00:52:33 GMT
Updated Branches:
  refs/heads/trunk ceaa02b23 -> 85206b97a


AMBARI-3848. Remove Host JS Error in 'add host wizard'. (xiwang via yusaku)


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

Branch: refs/heads/trunk
Commit: 85206b97a63491b1d4dd229d433a48a5f7561672
Parents: ceaa02b
Author: Yusaku Sako <yusaku@hortonworks.com>
Authored: Thu Nov 21 16:46:01 2013 -0800
Committer: Yusaku Sako <yusaku@hortonworks.com>
Committed: Thu Nov 21 16:46:24 2013 -0800

----------------------------------------------------------------------
 ambari-web/app/controllers/installer.js                |  7 +++----
 ambari-web/app/controllers/main/host/add_controller.js | 13 +++++++++++++
 2 files changed, 16 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/85206b97/ambari-web/app/controllers/installer.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/installer.js b/ambari-web/app/controllers/installer.js
index b669a25..dbb0923 100644
--- a/ambari-web/app/controllers/installer.js
+++ b/ambari-web/app/controllers/installer.js
@@ -75,13 +75,12 @@ App.InstallerController = App.WizardController.extend({
    * @param hosts Array of hosts, which we want to delete
    */
   removeHosts: function (hosts) {
-    //todo Replace this code with real logic
-    var DBhosts = this.getDBProperty('hosts');
+    var dbHosts = this.getDBProperty('hosts');
     hosts.forEach(function (_hostInfo) {
       var host = _hostInfo.hostName;
-      delete DBhosts[host];
+      delete dbHosts[host];
     });
-    this.setDBProperty('hosts', DBhosts);
+    this.setDBProperty('hosts', dbHosts);
   },
 
   /**

http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/85206b97/ambari-web/app/controllers/main/host/add_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/host/add_controller.js b/ambari-web/app/controllers/main/host/add_controller.js
index 8251781..dc66cca 100644
--- a/ambari-web/app/controllers/main/host/add_controller.js
+++ b/ambari-web/app/controllers/main/host/add_controller.js
@@ -92,6 +92,19 @@ App.AddHostController = App.WizardController.extend({
   },
 
   /**
+   * Remove host from model. Used at <code>Confirm hosts</code> step
+   * @param hosts Array of hosts, which we want to delete
+   */
+  removeHosts: function (hosts) {
+    var dbHosts = this.getDBProperty('hosts');
+    hosts.forEach(function (_hostInfo) {
+      var host = _hostInfo.hostName;
+      delete dbHosts[host];
+    });
+    this.setDBProperty('hosts', dbHosts);
+  },
+
+  /**
    * Load services data from server.
    */
   loadServicesFromServer: function() {


Mime
View raw message