You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by yu...@apache.org on 2013/02/20 23:26:12 UTC

svn commit: r1448444 - in /incubator/ambari/trunk: ./ ambari-web/app/ ambari-web/app/controllers/ ambari-web/app/controllers/main/host/ ambari-web/app/controllers/main/service/

Author: yusaku
Date: Wed Feb 20 22:26:11 2013
New Revision: 1448444

URL: http://svn.apache.org/r1448444
Log:
AMBARI-1450. Remove hard-coded stack version. (yusaku)

Modified:
    incubator/ambari/trunk/CHANGES.txt
    incubator/ambari/trunk/ambari-web/app/app.js
    incubator/ambari/trunk/ambari-web/app/controllers/installer.js
    incubator/ambari/trunk/ambari-web/app/controllers/main/host/add_controller.js
    incubator/ambari/trunk/ambari-web/app/controllers/main/service/add_controller.js
    incubator/ambari/trunk/ambari-web/app/controllers/wizard.js

Modified: incubator/ambari/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/CHANGES.txt?rev=1448444&r1=1448443&r2=1448444&view=diff
==============================================================================
--- incubator/ambari/trunk/CHANGES.txt (original)
+++ incubator/ambari/trunk/CHANGES.txt Wed Feb 20 22:26:11 2013
@@ -43,6 +43,8 @@ Trunk (unreleased changes):
 
  IMPROVEMENTS
 
+ AMBARI-1450. Remove hard-coded stack version. (yusaku)
+
  AMABRI-1458. Externalize strings from views to messages.js. (yusaku)
 
  AMBARI-1437. Update stack version. (yusaku)

Modified: incubator/ambari/trunk/ambari-web/app/app.js
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/app.js?rev=1448444&r1=1448443&r2=1448444&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/app.js (original)
+++ incubator/ambari/trunk/ambari-web/app/app.js Wed Feb 20 22:26:11 2013
@@ -31,6 +31,12 @@ module.exports = Em.Application.create({
   isAdmin : function(){
     var user = this.db && this.db.getUser();
     return user ? user.admin : false;
+  }.property(),
+  /**
+   * return url prefix with number value of version of HDP stack
+   */
+  stackVersionURL:function(){
+    return '/stacks/HDP/version/' + App.defaultStackVersion.replace(/HDP-/g, '');
   }.property()
 });
 

Modified: incubator/ambari/trunk/ambari-web/app/controllers/installer.js
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/controllers/installer.js?rev=1448444&r1=1448443&r2=1448444&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/controllers/installer.js (original)
+++ incubator/ambari/trunk/ambari-web/app/controllers/installer.js Wed Feb 20 22:26:11 2013
@@ -404,7 +404,7 @@ App.InstallerController = App.WizardCont
 
   loadAdvancedConfig: function (serviceName) {
     var self = this;
-    var url = (App.testMode) ? '/data/wizard/stack/hdp/version01/' + serviceName + '.json' : App.apiPrefix + '/stacks/HDP/version/1.2.0/services/' + serviceName; // TODO: get this url from the stack selected by the user in Install Options page
+    var url = (App.testMode) ? '/data/wizard/stack/hdp/version01/' + serviceName + '.json' : App.apiPrefix + App.get('stackVersionURL') + '/services/' + serviceName; // TODO: get this url from the stack selected by the user in Install Options page
     var method = 'GET';
     var serviceComponents;
     $.ajax({

Modified: incubator/ambari/trunk/ambari-web/app/controllers/main/host/add_controller.js
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/controllers/main/host/add_controller.js?rev=1448444&r1=1448443&r2=1448444&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/controllers/main/host/add_controller.js (original)
+++ incubator/ambari/trunk/ambari-web/app/controllers/main/host/add_controller.js Wed Feb 20 22:26:11 2013
@@ -139,7 +139,7 @@ App.AddHostController = App.WizardContro
    */
   loadServicesFromServer: function() {
     var displayOrderConfig = require('data/services');
-    var apiUrl = '/stacks/HDP/version/1.2.0';
+    var apiUrl = App.get('stackVersionURL');
     var apiService = this.loadServiceComponents(displayOrderConfig, apiUrl);
     //
     apiService.forEach(function(item, index){

Modified: incubator/ambari/trunk/ambari-web/app/controllers/main/service/add_controller.js
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/controllers/main/service/add_controller.js?rev=1448444&r1=1448443&r2=1448444&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/controllers/main/service/add_controller.js (original)
+++ incubator/ambari/trunk/ambari-web/app/controllers/main/service/add_controller.js Wed Feb 20 22:26:11 2013
@@ -115,7 +115,7 @@ App.AddServiceController = App.WizardCon
    */
   loadServicesFromServer: function() {
     var displayOrderConfig = require('data/services');
-    var apiUrl = '/stacks/HDP/version/1.2.0';
+    var apiUrl = App.get('stackVersionURL');
     var apiService = this.loadServiceComponents(displayOrderConfig, apiUrl);
     //
     apiService.forEach(function(item, index){
@@ -529,7 +529,7 @@ App.AddServiceController = App.WizardCon
    */
   loadAdvancedConfig: function (serviceName) {
     var self = this;
-    var url = (App.testMode) ? '/data/wizard/stack/hdp/version01/' + serviceName + '.json' : App.apiPrefix + '/stacks/HDP/version/1.2.0/services/' + serviceName; // TODO: get this url from the stack selected by the user in Install Options page
+    var url = (App.testMode) ? '/data/wizard/stack/hdp/version01/' + serviceName + '.json' : App.apiPrefix + App.get('stackVersionURL') +'/services/' + serviceName; // TODO: get this url from the stack selected by the user in Install Options page
     var method = 'GET';
     $.ajax({
       type: method,

Modified: incubator/ambari/trunk/ambari-web/app/controllers/wizard.js
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/controllers/wizard.js?rev=1448444&r1=1448443&r2=1448444&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/controllers/wizard.js (original)
+++ incubator/ambari/trunk/ambari-web/app/controllers/wizard.js Wed Feb 20 22:26:11 2013
@@ -507,7 +507,7 @@ App.WizardController = Em.Controller.ext
       return;
     }
     var displayOrderConfig = require('data/services');
-    var apiUrl = '/stacks/HDP/version/1.2.0';
+    var apiUrl = App.get('stackVersionURL');
     var apiService = this.loadServiceComponents(displayOrderConfig, apiUrl);
     this.set('content.services', apiService);
     App.db.setService(apiService);