incubator-ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jspei...@apache.org
Subject svn commit: r1441261 - in /incubator/ambari/trunk: CHANGES.txt ambari-web/app/controllers/wizard/step2_controller.js ambari-web/app/messages.js
Date Thu, 31 Jan 2013 23:37:25 GMT
Author: jspeidel
Date: Thu Jan 31 23:37:24 2013
New Revision: 1441261

URL: http://svn.apache.org/viewvc?rev=1441261&view=rev
Log:
AMBARI-1327. Add Hosts: Remove existing hosts display

Modified:
    incubator/ambari/trunk/CHANGES.txt
    incubator/ambari/trunk/ambari-web/app/controllers/wizard/step2_controller.js
    incubator/ambari/trunk/ambari-web/app/messages.js

Modified: incubator/ambari/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/CHANGES.txt?rev=1441261&r1=1441260&r2=1441261&view=diff
==============================================================================
--- incubator/ambari/trunk/CHANGES.txt (original)
+++ incubator/ambari/trunk/CHANGES.txt Thu Jan 31 23:37:24 2013
@@ -38,6 +38,8 @@ Trunk (unreleased changes):
 
  IMPROVEMENTS
  
+ AMBARI-1327. Add Hosts. Remove existig hosts display. (Alexandr Antonenko via jspeidel)
+
  AMBARI-1326. Remake clearFilters function in app_view (part 3). (srimanth)
  
  AMBARI-1305. Make sure that Ambari Web renders all elements correctly when

Modified: incubator/ambari/trunk/ambari-web/app/controllers/wizard/step2_controller.js
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/controllers/wizard/step2_controller.js?rev=1441261&r1=1441260&r2=1441261&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/controllers/wizard/step2_controller.js (original)
+++ incubator/ambari/trunk/ambari-web/app/controllers/wizard/step2_controller.js Thu Jan 31
23:37:24 2013
@@ -25,7 +25,7 @@ App.WizardStep2Controller = Em.Controlle
   isPattern: false,
   bootRequestId:  null,
   hasSubmitted: false,
-
+  inputtedAgainHostNames: [],
   hostNames: function () {
     return this.get('content.installOptions.hostNames');
   }.property('content.installOptions.hostNames'),
@@ -54,11 +54,14 @@ App.WizardStep2Controller = Em.Controlle
   updateHostNameArr: function(){
     this.hostNameArr = this.get('hostNames').trim().split(new RegExp("\\s+", "g"));
     this.patternExpression();
+    this.get('inputtedAgainHostNames').clear();
     var installedHostNames = App.Host.find().mapProperty('hostName');
     var tempArr = [];
     for (i = 0; i < this.hostNameArr.length; i++) {
       if (!installedHostNames.contains(this.hostNameArr[i])) {
         tempArr.push(this.hostNameArr[i]);
+      } else {
+        this.get('inputtedAgainHostNames').push(this.hostNameArr[i]);
       }
     }
     this.set('hostNameArr', tempArr);
@@ -164,7 +167,7 @@ App.WizardStep2Controller = Em.Controlle
     this.updateHostNameArr();
 
     if (!this.hostNameArr.length) {
-      this.set('hostsError', Em.I18n.t('installer.step2.hostName.error.required'));
+      this.set('hostsError', Em.I18n.t('installer.step2.hostName.error.already_installed'));
       return false;
     }
 
@@ -173,8 +176,21 @@ App.WizardStep2Controller = Em.Controlle
       this.hostNamePatternPopup(this.hostNameArr);
       return false;
     }
-
-    this.proceedNext();
+    if (this.get('inputtedAgainHostNames').length) {
+      var self = this;
+      App.ModalPopup.show({
+        header: 'Warning',
+        onPrimary: function () {
+          self.proceedNext();
+          this.hide();
+        },
+        bodyClass: Ember.View.extend({
+          template: Ember.Handlebars.compile('<p>These hosts are already installed
on the cluster and will be ignored:</p><p>' + self.get('inputtedAgainHostNames').join(',
') + '</p><p>Do you want to continue?</p>')
+        })
+      });
+    } else {
+      this.proceedNext();
+    }
   },
   /**
    * check is there a pattern expression in host name textarea

Modified: incubator/ambari/trunk/ambari-web/app/messages.js
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/messages.js?rev=1441261&r1=1441260&r2=1441261&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/messages.js (original)
+++ incubator/ambari/trunk/ambari-web/app/messages.js Thu Jan 31 23:37:24 2013
@@ -76,6 +76,7 @@ Em.I18n.translations = {
   'installer.step2.hostPattern.tooltip.title':'Pattern Expressions',
   'installer.step2.hostPattern.tooltip.content':'You can use pattern expressions to specify
a number of target hosts. For example, to specify host01.domain thru host10.domain, enter
host[01-10].domain in the target hosts textarea.',
   'installer.step2.hostName.error.required':'You must specify at least one host name',
+  'installer.step2.hostName.error.already_installed':'all these hosts are already installed',
   'installer.step2.hostName.error.notRequired':'Host Names will be ignored if not using SSH
to automatically configure hosts',
   'installer.step2.hostName.error.invalid':'Invalid Host Name(s)',
   'installer.step2.hostName.pattern.header':'Host name pattern expressions',



Mime
View raw message