Author: yusaku
Date: Fri Mar 8 00:07:45 2013
New Revision: 1454180
URL: http://svn.apache.org/r1454180
Log:
AMBARI-1578. Add host wizard - support assignment of "ZooKeeper Server" and
"HBase Master". (yusaku)
Modified:
incubator/ambari/trunk/ambari-web/app/controllers/wizard/step6_controller.js
Modified:
incubator/ambari/trunk/ambari-web/app/controllers/wizard/step6_controller.js
URL:
http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/controllers/wizard/step6_controller.js?rev=1454180&r1=1454179&r2=1454180&view=diff
==============================================================================
---
incubator/ambari/trunk/ambari-web/app/controllers/wizard/step6_controller.js
(original)
+++
incubator/ambari/trunk/ambari-web/app/controllers/wizard/step6_controller.js
Fri Mar 8 00:07:45 2013
@@ -254,7 +254,6 @@ App.WizardStep6Controller = Em.Controlle
/**
* Load all data needed for this module. Then it automatically renders in
template
- * @return {Ember.Set}
*/
render: function () {
var hostsObj = Em.Set.create();
@@ -301,12 +300,26 @@ App.WizardStep6Controller = Em.Controlle
* @return {*}
*/
renderSlaves: function(hostsObj) {
+ var self = this;
var allHosts = this.getHostNames();
+ var headers = this.get('headers');
var slaveComponents = this.get('content.slaveComponentHosts');
if (!slaveComponents) { // we are at this page for the first time
+ var client_is_set = false;
hostsObj.forEach(function(host) {
- host.isMaster = this.hasMasterComponents(host.hostName);
- }, this);
+ host.isMaster = self.hasMasterComponents(host.hostName);
+ var checkboxes = host.get('checkboxes');
+ checkboxes.setEach('checked', !host.isMaster);
+ checkboxes.findProperty('title', headers.findProperty('name',
'CLIENT').get('label')).set('checked', false);
+ // First not Master should have Client (only first!)
+ if (!client_is_set) {
+ var checkboxDatanode = checkboxes.findProperty('title',
headers.findProperty('name', 'DATANODE').get('label'));
+ if (checkboxDatanode && checkboxDatanode.get('checked')) {
+ checkboxes.findProperty('title', headers.findProperty('name',
'CLIENT').get('label')).set('checked', true);
+ client_is_set = true;
+ }
+ }
+ });
}
else {
this.get('headers').forEach(function(header) {