Quellcode durchsuchen

AMBARI-2054. If "Install from Local Repository" selected in install wizard, Add Host wizard not working. (yusaku)

git-svn-id: https://svn.apache.org/repos/asf/incubator/ambari/trunk@1478192 13f79535-47bb-0310-9956-ffa450edef68
Yusaku Sako vor 12 Jahren
Ursprung
Commit
0c17d5dd4d
4 geänderte Dateien mit 16 neuen und 7 gelöschten Zeilen
  1. 3 0
      CHANGES.txt
  2. 6 0
      ambari-web/app/app.js
  3. 6 6
      ambari-web/app/controllers/wizard.js
  4. 1 1
      ambari-web/app/utils/ajax.js

+ 3 - 0
CHANGES.txt

@@ -823,6 +823,9 @@ Trunk (unreleased changes):
 
  BUG FIXES
 
+ AMBARI-2054. If "Install from Local Repository" selected in install wizard,
+ Add Host wizard not working. (yusaku)
+
  AMBARI-2053. Align "add hosts" button vertically with host health filter.
  (yusaku)
 

+ 6 - 0
ambari-web/app/app.js

@@ -34,6 +34,9 @@ module.exports = Em.Application.create({
    */
   stackVersionURL:function(){
     var stackVersion = this.get('currentStackVersion') || this.get('defaultStackVersion');
+    if(stackVersion.indexOf('HDPLocal') !== -1){
+      return '/stacks/HDPLocal/version/' + stackVersion.replace(/HDPLocal-/g, '');
+    }
     return '/stacks/HDP/version/' + stackVersion.replace(/HDP-/g, '');
   }.property('currentStackVersion'),
   
@@ -42,6 +45,9 @@ module.exports = Em.Application.create({
    */
   stack2VersionURL:function(){
     var stackVersion = this.get('currentStackVersion') || this.get('defaultStackVersion');
+    if(stackVersion.indexOf('HDPLocal') !== -1){
+      return '/stacks2/HDPLocal/versions/' + stackVersion.replace(/HDPLocal-/g, '');
+    }
     return '/stacks2/HDP/versions/' + stackVersion.replace(/HDP-/g, '');
   }.property('currentStackVersion'),
   clusterName: null,

+ 6 - 6
ambari-web/app/controllers/wizard.js

@@ -448,7 +448,7 @@ App.WizardController = Em.Controller.extend({
       name: 'wizard.service_components',
       sender: this,
       data: {
-        stackUrl: App.get('stackVersionURL')
+        stackUrl: App.get('stack2VersionURL')
       },
       success: 'loadServiceComponentsSuccessCallback',
       error: 'loadServiceComponentsErrorCallback'
@@ -459,7 +459,7 @@ App.WizardController = Em.Controller.extend({
   loadServiceComponentsSuccessCallback: function (jsonData) {
     var displayOrderConfig = require('data/services');
     console.log("TRACE: getService ajax call  -> In success function for the getServiceComponents call");
-    console.log("TRACE: jsonData.services : " + jsonData.services);
+    console.log("TRACE: jsonData.services : " + jsonData.items);
 
     // Creating Model
     var Service = Ember.Object.extend({
@@ -476,18 +476,18 @@ App.WizardController = Em.Controller.extend({
 
     // loop through all the service components
     for (var i = 0; i < displayOrderConfig.length; i++) {
-      var entry = jsonData.services.findProperty("name", displayOrderConfig[i].serviceName);
+      var entry = jsonData.items.findProperty("StackServices.service_name", displayOrderConfig[i].serviceName);
       if (entry) {
         var myService = Service.create({
-          serviceName: entry.name,
+          serviceName: entry.StackServices.service_name,
           displayName: displayOrderConfig[i].displayName,
           isDisabled: i === 0,
           isSelected: displayOrderConfig[i].isSelected,
           canBeSelected: displayOrderConfig[i].canBeSelected,
           isInstalled: false,
           isHidden: displayOrderConfig[i].isHidden,
-          description: entry.comment,
-          version: entry.version
+          description: entry.StackServices.comments,
+          version: entry.StackServices.service_version
         });
 
         data.push(myService);

+ 1 - 1
ambari-web/app/utils/ajax.js

@@ -578,7 +578,7 @@ var urls = {
     }
   },
   'wizard.service_components': {
-    'real': '{stackUrl}',
+    'real': '{stackUrl}/stackServices?fields=StackServices',
     'mock': '/data/wizard/stack/hdp/version/1.3.0.json',
     'format': function (data, opt) {
       return {