瀏覽代碼

AMBARI-902. Fix ZooKeeper badge allocation logic for single host and muliple hosts installation in step5 installer wizard. (Jaimin Jetly via yusaku)

git-svn-id: https://svn.apache.org/repos/asf/incubator/ambari/branches/AMBARI-666@1402285 13f79535-47bb-0310-9956-ffa450edef68
Yusaku Sako 12 年之前
父節點
當前提交
17a6f58fb8
共有 2 個文件被更改,包括 40 次插入33 次删除
  1. 4 0
      AMBARI-666-CHANGES.txt
  2. 36 33
      ambari-web/app/views/installer/step5_view.js

+ 4 - 0
AMBARI-666-CHANGES.txt

@@ -360,6 +360,10 @@ AMBARI-666 branch (unreleased changes)
 
   BUG FIXES
 
+  AMBARI-902. Fix ZooKeeper badge allocation logic for single host and 
+  muliple hosts installation in step5 installer wizard. (Jaimin Jetly via
+  yusaku)
+
   AMBARI-896. Resolve all navigation related issues for Step6 (Slave and
   Client component) of installer wizard. (Jaimin Jetly via yusaku)
 

+ 36 - 33
ambari-web/app/views/installer/step5_view.js

@@ -21,51 +21,54 @@ var App = require('app');
 
 App.InstallerStep5View = Em.View.extend({
 
-	templateName: require('templates/installer/step5'),
-
-	didInsertElement: function () {
-		var controller = this.get('controller');
-		controller.loadStep();
-		if (controller.lastZooKeeper()) {
-			controller.lastZooKeeper().set('showAddControl',true);
-		}
-	}
+  templateName: require('templates/installer/step5'),
 
+  didInsertElement: function () {
+    var controller = this.get('controller');
+    controller.loadStep();
+    if (controller.lastZooKeeper()) {
+      if (controller.get("selectedServicesMasters").filterProperty("component_name", "ZooKeeper").length < controller.get("hosts.length")) {
+        controller.lastZooKeeper().set('showAddControl', true);
+      } else {
+        controller.lastZooKeeper().set('showRemoveControl', false);
+      }
+    }
+  }
 });
 
 App.SelectHostView = Em.Select.extend({
-	content: [],
-	zId: null,
-	selectedHost: null,
-	serviceName: null,
+  content: [],
+  zId: null,
+  selectedHost: null,
+  serviceName: null,
 
-	change: function () {
-		this.get('controller').assignHostToMaster(this.get("serviceName"), this.get("value"), this.get("zId"));
-	},
+  change: function () {
+    this.get('controller').assignHostToMaster(this.get("serviceName"), this.get("value"), this.get("zId"));
+  },
 
-	didInsertElement: function () {
-		this.set("value", this.get("selectedHost"));
-	}
+  didInsertElement: function () {
+    this.set("value", this.get("selectedHost"));
+  }
 });
 
 App.AddControlView = Em.View.extend({
-	componentName: null,
-	tagName: "span",
-	classNames: ["badge", "badge-important"],
-	template: Ember.Handlebars.compile('+'),
+  componentName: null,
+  tagName: "span",
+  classNames: ["badge", "badge-important"],
+  template: Ember.Handlebars.compile('+'),
 
-	click: function (event) {
-		this.get('controller').addZookeepers();
-	}
+  click: function (event) {
+    this.get('controller').addZookeepers();
+  }
 });
 
 App.RemoveControlView = Em.View.extend({
-	zId: null,
-	tagName: "span",
-	classNames: ["badge", "badge-important"],
-	template: Ember.Handlebars.compile('-'),
+  zId: null,
+  tagName: "span",
+  classNames: ["badge", "badge-important"],
+  template: Ember.Handlebars.compile('-'),
 
-	click: function (event) {
-		this.get('controller').removeZookeepers(this.get("zId"));
-	}
+  click: function (event) {
+    this.get('controller').removeZookeepers(this.get("zId"));
+  }
 });