Return-Path: X-Original-To: apmail-incubator-ambari-commits-archive@minotaur.apache.org Delivered-To: apmail-incubator-ambari-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id EEBCC10428 for ; Fri, 22 Nov 2013 00:52:33 +0000 (UTC) Received: (qmail 67562 invoked by uid 500); 22 Nov 2013 00:52:33 -0000 Delivered-To: apmail-incubator-ambari-commits-archive@incubator.apache.org Received: (qmail 67539 invoked by uid 500); 22 Nov 2013 00:52:33 -0000 Mailing-List: contact ambari-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: ambari-dev@incubator.apache.org Delivered-To: mailing list ambari-commits@incubator.apache.org Received: (qmail 67532 invoked by uid 99); 22 Nov 2013 00:52:33 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 22 Nov 2013 00:52:33 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 901F290135B; Fri, 22 Nov 2013 00:52:33 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: yusaku@apache.org To: ambari-commits@incubator.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: git commit: AMBARI-3848. Remove Host JS Error in 'add host wizard'. (xiwang via yusaku) Date: Fri, 22 Nov 2013 00:52:33 +0000 (UTC) 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 Authored: Thu Nov 21 16:46:01 2013 -0800 Committer: Yusaku Sako 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 Confirm hosts 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() {