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/22 22:41:14 UTC

svn commit: r1449227 - in /incubator/ambari/trunk: ./ ambari-web/app/ ambari-web/app/controllers/wizard/ ambari-web/app/routes/ ambari-web/app/templates/main/service/ ambari-web/app/templates/wizard/ ambari-web/app/utils/

Author: yusaku
Date: Fri Feb 22 21:41:13 2013
New Revision: 1449227

URL: http://svn.apache.org/r1449227
Log:
AMBARI-1483. Reassign Master Wizard - Step 2. (yusaku)

Modified:
    incubator/ambari/trunk/CHANGES.txt
    incubator/ambari/trunk/ambari-web/app/controllers/wizard/step5_controller.js
    incubator/ambari/trunk/ambari-web/app/messages.js
    incubator/ambari/trunk/ambari-web/app/routes/reassign_master_routes.js
    incubator/ambari/trunk/ambari-web/app/templates/main/service/reassign.hbs
    incubator/ambari/trunk/ambari-web/app/templates/wizard/step5.hbs
    incubator/ambari/trunk/ambari-web/app/utils/db.js

Modified: incubator/ambari/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/CHANGES.txt?rev=1449227&r1=1449226&r2=1449227&view=diff
==============================================================================
--- incubator/ambari/trunk/CHANGES.txt (original)
+++ incubator/ambari/trunk/CHANGES.txt Fri Feb 22 21:41:13 2013
@@ -12,6 +12,8 @@ Trunk (unreleased changes):
 
  NEW FEATURES
 
+ AMBARI-1483. Reassign Master Wizard - Step 2. (yusaku)
+
  AMBARI-1482. Reassign Master Wizard - Step 1. (yusaku)
 
  AMBARI-1481. Stack Upgrade Wizard - Step 2 (confirm and check all master

Modified: incubator/ambari/trunk/ambari-web/app/controllers/wizard/step5_controller.js
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/controllers/wizard/step5_controller.js?rev=1449227&r1=1449226&r2=1449227&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/controllers/wizard/step5_controller.js (original)
+++ incubator/ambari/trunk/ambari-web/app/controllers/wizard/step5_controller.js Fri Feb 22 21:41:13 2013
@@ -21,9 +21,20 @@ var App = require('app');
 App.WizardStep5Controller = Em.Controller.extend({
 
   name:"wizardStep5Controller",
+  title: function () {
+    if (this.get('content.controllerName') == 'reassignMasterController') {
+      return Em.I18n.t('installer.step5.reassign.header');
+    }
+    return Em.I18n.t('installer.step5.header');
+  }.property('content.controllerName'),
+
+  isReassignWizard: function () {
+    return this.get('content.controllerName') == 'reassignMasterController';
+  }.property(),
 
   hosts:[],
 
+  servicesMasters:[],
   selectedServicesMasters:[],
 
   components:require('data/service_components'),
@@ -31,6 +42,7 @@ App.WizardStep5Controller = Em.Controlle
   clearStep:function () {
     this.set('hosts', []);
     this.set('selectedServicesMasters', []);
+    this.set('servicesMasters', []);
   },
 
   loadStep:function () {
@@ -186,6 +198,12 @@ App.WizardStep5Controller = Em.Controlle
     }, this);
 
     this.set("selectedServicesMasters", result);
+    if (this.get('isReassignWizard')) {
+      var component = result.findProperty('component_name', this.get('content.reassign.component_name')).set('isInstalled', false);
+      this.set('servicesMasters', [component]);
+    } else {
+      this.set('servicesMasters', result);
+    }
   },
 
   hasHiveServer: function () {

Modified: incubator/ambari/trunk/ambari-web/app/messages.js
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/messages.js?rev=1449227&r1=1449226&r2=1449227&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/messages.js (original)
+++ incubator/ambari/trunk/ambari-web/app/messages.js Fri Feb 22 21:41:13 2013
@@ -287,6 +287,7 @@ Em.I18n.translations = {
   'installer.step4.monitoringCheck.popup.body':'You did not select Nagios and/or Ganglia.  If both are not selected, monitoring and alerts will not function properly.  Is this OK?',
 
   'installer.step5.header':'Assign Masters',
+  'installer.step5.reassign.header':'Select Target Host',
   'installer.step5.attention':' hosts not running master services',
   'installer.step5.body':'Assign master components to hosts you want to run them on.',
   'installer.step5.body.hive':'<i class="icon-asterisks">&#10037</i> HiveServer2, Hive Metastore, and WebHCat Server will be co-hosted on the same server.',

Modified: incubator/ambari/trunk/ambari-web/app/routes/reassign_master_routes.js
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/routes/reassign_master_routes.js?rev=1449227&r1=1449226&r2=1449227&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/routes/reassign_master_routes.js (original)
+++ incubator/ambari/trunk/ambari-web/app/routes/reassign_master_routes.js Fri Feb 22 21:41:13 2013
@@ -64,7 +64,24 @@ module.exports = Em.Route.extend({
       })
     },
     next: function (router) {
-      //router.transitionTo('step2');
+      router.transitionTo('step2');
+    }
+  }),
+
+  step2: Em.Route.extend({
+    route: '/step2',
+    connectOutlets: function (router) {
+      console.log('in reassignMaster.step2:connectOutlets');
+      var controller = router.get('reassignMasterController');
+      controller.setCurrentStep('2');
+      controller.dataLoading().done(function () {
+        controller.loadAllPriorSteps();
+        controller.connectOutlet('wizardStep5', controller.get('content'));
+      })
+
+    },
+    back: Em.Router.transitionTo('step1'),
+    next: function () {
     }
   }),
 

Modified: incubator/ambari/trunk/ambari-web/app/templates/main/service/reassign.hbs
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/templates/main/service/reassign.hbs?rev=1449227&r1=1449226&r2=1449227&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/templates/main/service/reassign.hbs (original)
+++ incubator/ambari/trunk/ambari-web/app/templates/main/service/reassign.hbs Fri Feb 22 21:41:13 2013
@@ -26,6 +26,7 @@
             <ul class="nav nav-pills nav-stacked">
               <li class="nav-header">{{t services.reassign.header}}</li>
               <li {{bindAttr class="isStep1:active view.isStep1Disabled:disabled"}}><a href="javascript:void(null);"  {{action gotoStep1 target="controller"}}>{{t installer.step11.header}}</a></li>
+              <li {{bindAttr class="isStep2:active view.isStep2Disabled:disabled"}}><a href="javascript:void(null);"  {{action gotoStep2 target="controller"}}>{{t installer.step5.reassign.header}}</a></li>
             </ul>
           </div>
         </div>

Modified: incubator/ambari/trunk/ambari-web/app/templates/wizard/step5.hbs
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/templates/wizard/step5.hbs?rev=1449227&r1=1449226&r2=1449227&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/templates/wizard/step5.hbs (original)
+++ incubator/ambari/trunk/ambari-web/app/templates/wizard/step5.hbs Fri Feb 22 21:41:13 2013
@@ -16,7 +16,7 @@
 * limitations under the License.
 }}
 
-<h2>{{t installer.step5.header}}</h2>
+<h2>{{title}}</h2>
 <div class="alert alert-info">
   {{t installer.step5.body}}
   {{#if hasHiveServer}}
@@ -28,7 +28,7 @@
   <div class="select-hosts">
     <form class="form-horizontal">
       <!-- View for array controller -->
-      {{#each selectedServicesMasters}}
+      {{#each servicesMasters}}
       <div class="control-group">
         <label class="control-label">{{display_name}}:</label>
         {{#if isHiveCoHost}}

Modified: incubator/ambari/trunk/ambari-web/app/utils/db.js
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/utils/db.js?rev=1449227&r1=1449226&r2=1449227&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/utils/db.js (original)
+++ incubator/ambari/trunk/ambari-web/app/utils/db.js Fri Feb 22 21:41:13 2013
@@ -227,6 +227,12 @@ App.db.setMasterToReassign = function (m
   localStorage.setObject('ambari', App.db.data);
 };
 
+App.db.setMasterToReassign = function (masterComponent) {
+  App.db.data = localStorage.getObject('ambari');
+  App.db.data.ReassignMaster.masterComponent = masterComponent;
+  localStorage.setObject('ambari', App.db.data);
+};
+
 /**
  * Set current step value for specified Wizard Type
  * @param wizardType