Browse Source

AMBARI-1483. Reassign Master Wizard - Step 2. (yusaku)

git-svn-id: https://svn.apache.org/repos/asf/incubator/ambari/trunk@1449227 13f79535-47bb-0310-9956-ffa450edef68
Yusaku Sako 12 years ago
parent
commit
072eaae7e8

+ 2 - 0
CHANGES.txt

@@ -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

+ 18 - 0
ambari-web/app/controllers/wizard/step5_controller.js

@@ -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.Controller.extend({
   clearStep:function () {
     this.set('hosts', []);
     this.set('selectedServicesMasters', []);
+    this.set('servicesMasters', []);
   },
 
   loadStep:function () {
@@ -186,6 +198,12 @@ App.WizardStep5Controller = Em.Controller.extend({
     }, 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 () {

+ 1 - 0
ambari-web/app/messages.js

@@ -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.',

+ 18 - 1
ambari-web/app/routes/reassign_master_routes.js

@@ -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 () {
     }
   }),
 

+ 1 - 0
ambari-web/app/templates/main/service/reassign.hbs

@@ -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>

+ 2 - 2
ambari-web/app/templates/wizard/step5.hbs

@@ -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}}

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

@@ -227,6 +227,12 @@ App.db.setMasterToReassign = function (masterComponent) {
   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