You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by at...@apache.org on 2014/06/06 19:41:10 UTC
git commit: AMBARI-6053 Add Host wizard get stuck on Confirm Hosts
step. (atkach)
Repository: ambari
Updated Branches:
refs/heads/trunk 34f659b5c -> 0a1aaaa4b
AMBARI-6053 Add Host wizard get stuck on Confirm Hosts step. (atkach)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/0a1aaaa4
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/0a1aaaa4
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/0a1aaaa4
Branch: refs/heads/trunk
Commit: 0a1aaaa4b64e8ca42ef3cf389abd1679def7c117
Parents: 34f659b
Author: atkach <at...@hortonworks.com>
Authored: Fri Jun 6 20:39:25 2014 +0300
Committer: atkach <at...@hortonworks.com>
Committed: Fri Jun 6 20:39:25 2014 +0300
----------------------------------------------------------------------
.../app/controllers/main/host/add_controller.js | 8 ++++----
.../app/controllers/wizard/step2_controller.js | 2 +-
.../app/controllers/wizard/step3_controller.js | 2 +-
ambari-web/app/views/main/host/add_view.js | 18 +++++++++++-------
4 files changed, 17 insertions(+), 13 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/0a1aaaa4/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 d318c62..54305ba 100644
--- a/ambari-web/app/controllers/main/host/add_controller.js
+++ b/ambari-web/app/controllers/main/host/add_controller.js
@@ -159,13 +159,13 @@ App.AddHostController = App.WizardController.extend({
var clients = [];
var serviceComponents = App.StackServiceComponent.find();
var clientComponents = [];
- var dbHosts = this.get('content.hosts');
+ var installedHosts = this.get('content.installedHosts');
- for (var hostName in dbHosts) {
- dbHosts[hostName].hostComponents.forEach(function (componentName) {
+ installedHosts.forEach(function (host) {
+ host.hostComponents.forEach(function (componentName) {
clientComponents[componentName] = true;
}, this);
- }
+ });
this.get('content.services').filterProperty('isSelected').forEach(function (_service) {
var client = serviceComponents.filterProperty('serviceName', _service.serviceName).findProperty('isClient');
http://git-wip-us.apache.org/repos/asf/ambari/blob/0a1aaaa4/ambari-web/app/controllers/wizard/step2_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/wizard/step2_controller.js b/ambari-web/app/controllers/wizard/step2_controller.js
index e6c5dd1..53153b5 100644
--- a/ambari-web/app/controllers/wizard/step2_controller.js
+++ b/ambari-web/app/controllers/wizard/step2_controller.js
@@ -145,7 +145,7 @@ App.WizardStep2Controller = Em.Controller.extend({
installedHostNames: function () {
if (this.get('content.controllerName') === 'addHostController') {
- return this.get('content.installedHosts').mapProperty('hostName');
+ return this.get('content.installedHosts').mapProperty('name');
} else {
return [];
}
http://git-wip-us.apache.org/repos/asf/ambari/blob/0a1aaaa4/ambari-web/app/controllers/wizard/step3_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/wizard/step3_controller.js b/ambari-web/app/controllers/wizard/step3_controller.js
index a131a7f..5fa1c8d 100644
--- a/ambari-web/app/controllers/wizard/step3_controller.js
+++ b/ambari-web/app/controllers/wizard/step3_controller.js
@@ -96,7 +96,7 @@ App.WizardStep3Controller = Em.Controller.extend({
* @type {string[]}
*/
hostsInCluster: function () {
- return this.get('content.installedHosts').getEach('hostName');
+ return this.get('content.installedHosts').getEach('name');
}.property('content.installedHosts'),
/**
http://git-wip-us.apache.org/repos/asf/ambari/blob/0a1aaaa4/ambari-web/app/views/main/host/add_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/host/add_view.js b/ambari-web/app/views/main/host/add_view.js
index 96dcf3a..84a4311 100644
--- a/ambari-web/app/views/main/host/add_view.js
+++ b/ambari-web/app/views/main/host/add_view.js
@@ -63,7 +63,7 @@ App.AddHostView = Em.View.extend({
loadHosts: function () {
App.ajax.send({
- name: 'hosts.all',
+ name: 'hosts.confirmed',
sender: this,
data: {},
success: 'loadHostsSuccessCallback',
@@ -72,17 +72,21 @@ App.AddHostView = Em.View.extend({
},
loadHostsSuccessCallback: function (response) {
- var hosts = [];
+ var installedHosts = [];
response.items.forEach(function (item) {
- hosts.push({
- hostName: item.Hosts.host_name,
+ installedHosts.push({
+ name: item.Hosts.host_name,
+ cpu: item.Hosts.cpu_count,
+ memory: item.Hosts.total_mem,
+ disk_info: item.Hosts.disk_info,
bootStatus: "REGISTERED",
- isInstalled: true
+ isInstalled: true,
+ hostComponents: item.host_components.mapProperty('HostRoles.component_name')
});
});
- this.get('controller').setDBProperty('installedHosts', hosts);
- this.set('controller.content.installedHosts', hosts);
+ this.get('controller').setDBProperty('installedHosts', installedHosts);
+ this.set('controller.content.installedHosts', installedHosts);
this.set('isLoaded', true);
},