You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by on...@apache.org on 2015/08/13 17:33:26 UTC
ambari git commit: AMBARI-12764. ASW. Assign Masters Page. Click "+"
takes 3 seconds (only JS processing) to display combobox with new component's
host (onechiporenko)
Repository: ambari
Updated Branches:
refs/heads/branch-2.1 e1951d4f9 -> 9fdd7e54f
AMBARI-12764. ASW. Assign Masters Page. Click "+" takes 3 seconds (only JS processing) to display combobox with new component's host (onechiporenko)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/9fdd7e54
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/9fdd7e54
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/9fdd7e54
Branch: refs/heads/branch-2.1
Commit: 9fdd7e54fb99010caf8973a99992b280672fd6bf
Parents: e1951d4
Author: Oleg Nechiporenko <on...@apache.org>
Authored: Thu Aug 13 18:28:03 2015 +0300
Committer: Oleg Nechiporenko <on...@apache.org>
Committed: Thu Aug 13 18:28:03 2015 +0300
----------------------------------------------------------------------
ambari-web/app/mixins/common/blueprint.js | 14 +++++++++-----
.../mixins/wizard/assign_master_components.js | 19 +++++++++++--------
2 files changed, 20 insertions(+), 13 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/9fdd7e54/ambari-web/app/mixins/common/blueprint.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/mixins/common/blueprint.js b/ambari-web/app/mixins/common/blueprint.js
index 4889b3d..a006b9c 100644
--- a/ambari-web/app/mixins/common/blueprint.js
+++ b/ambari-web/app/mixins/common/blueprint.js
@@ -18,14 +18,18 @@
var App = require('app');
var blueprintUtils = require('utils/blueprint');
+var dataManipulation = require('utils/data_manipulation');
App.BlueprintMixin = Em.Mixin.create({
+
/**
- * returns blueprint for all currenlty installed master, slave and client components
+ * returns blueprint for all currently installed master, slave and client components
+ * @method getCurrentMasterSlaveBlueprint
*/
getCurrentMasterSlaveBlueprint: function () {
var components = App.HostComponent.find();
var hosts = components.mapProperty("hostName").uniq();
+ var mappedComponents = dataManipulation.groupPropertyValues(components, 'hostName');
var res = {
blueprint: { host_groups: [] },
@@ -33,13 +37,13 @@ App.BlueprintMixin = Em.Mixin.create({
};
hosts.forEach(function (host, i) {
- var group_name = 'host-group-' + (i+1);
+ var group_name = 'host-group-' + (i + 1);
res.blueprint.host_groups.push({
name: group_name,
- components: components.filterProperty("hostName", host).mapProperty("componentName").map(function (c) {
- return { name: c };
- })
+ components: mappedComponents[host] ? mappedComponents[host].map(function (c) {
+ return { name: Em.get(c, 'componentName') };
+ }) : []
});
res.blueprint_cluster_binding.host_groups.push({
http://git-wip-us.apache.org/repos/asf/ambari/blob/9fdd7e54/ambari-web/app/mixins/wizard/assign_master_components.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/mixins/wizard/assign_master_components.js b/ambari-web/app/mixins/wizard/assign_master_components.js
index d3d674a..0ba5eb1 100644
--- a/ambari-web/app/mixins/wizard/assign_master_components.js
+++ b/ambari-web/app/mixins/wizard/assign_master_components.js
@@ -597,9 +597,9 @@ App.AssignMasterComponents = Em.Mixin.create({
/**
* Get recommendations info from API
- * @return {undefined}
- * @param function(componentInstallationobjects, this) callback
- * @param bool includeMasters
+ * @param {function}callback
+ * @param {boolean} includeMasters
+ * @method loadComponentsRecommendationsFromServer
*/
loadComponentsRecommendationsFromServer: function(callback, includeMasters) {
var self = this;
@@ -608,7 +608,8 @@ App.AssignMasterComponents = Em.Mixin.create({
// Don't do AJAX call if recommendations has been already received
// But if user returns to previous step (selecting services), stored recommendations will be cleared in routers' next handler and AJAX call will be made again
callback(self.createComponentInstallationObjects(), self);
- } else {
+ }
+ else {
var selectedServices = App.StackService.find().filterProperty('isSelected').mapProperty('serviceName');
var installedServices = App.StackService.find().filterProperty('isInstalled').mapProperty('serviceName');
var services = installedServices.concat(selectedServices).uniq();
@@ -625,9 +626,11 @@ App.AssignMasterComponents = Em.Mixin.create({
if (includeMasters) {
// Made partial recommendation request for reflect in blueprint host-layout changes which were made by user in UI
data.recommendations = self.getCurrentBlueprint();
- } else if (!self.get('isInstallerWizard')) {
- data.recommendations = self.getCurrentMasterSlaveBlueprint();
}
+ else
+ if (!self.get('isInstallerWizard')) {
+ data.recommendations = self.getCurrentMasterSlaveBlueprint();
+ }
return App.ajax.send({
name: 'wizard.loadrecommendations',
@@ -636,8 +639,8 @@ App.AssignMasterComponents = Em.Mixin.create({
success: 'loadRecommendationsSuccessCallback',
error: 'loadRecommendationsErrorCallback'
}).then(function () {
- callback(self.createComponentInstallationObjects(), self);
- });
+ callback(self.createComponentInstallationObjects(), self);
+ });
}
},