Bladeren bron

AMBARI-1145. Cluster Management refactoring. (yusaku)

git-svn-id: https://svn.apache.org/repos/asf/incubator/ambari/trunk@1431775 13f79535-47bb-0310-9956-ffa450edef68
Yusaku Sako 12 jaren geleden
bovenliggende
commit
6f0f66a81b

+ 1 - 1
ambari-web/app/controllers/main/host/add_controller.js

@@ -23,7 +23,7 @@ App.AddHostController = App.WizardController.extend({
 
   name: 'addHostController',
 
-  totalSteps: 7,
+  totalSteps: 6,
 
   /**
    * Used for hiding back button in wizard

+ 2 - 2
ambari-web/app/controllers/main/service/item.js

@@ -93,7 +93,7 @@ App.MainServiceItemController = Em.Controller.extend({
               self.content.set('workStatus', App.Service.Health.live);
             }, 10000);
           } else {
-            App.router.get('clusterController').loadUpdatedStatus();
+            App.router.get('clusterController').loadUpdatedStatusDelayed(500);
             App.router.get('backgroundOperationsController.eventsArray').push({
               "when": function (controller) {
                 var result = (controller.getOperationsForRequestId(requestId).length == 0);
@@ -146,7 +146,7 @@ App.MainServiceItemController = Em.Controller.extend({
               self.content.set('workStatus', App.Service.Health.dead);
             }, 10000);
           } else {
-            App.router.get('clusterController').loadUpdatedStatus();
+            App.router.get('clusterController').loadUpdatedStatusDelayed(500);
             App.router.get('backgroundOperationsController.eventsArray').push({
               "when": function (controller) {
                 var result = (controller.getOperationsForRequestId(requestId).length == 0);

+ 12 - 3
ambari-web/app/controllers/wizard.js

@@ -191,6 +191,7 @@ App.WizardController = Em.Controller.extend({
    * Temporary function for wizardStep9, before back-end integration
    */
   setInfoForStep9: function () {
+
     var hostInfo = App.db.getHosts();
     for (var index in hostInfo) {
       hostInfo[index].status = "pending";
@@ -230,7 +231,7 @@ App.WizardController = Em.Controller.extend({
   saveClusterStatus: function (clusterStatus) {
     var oldStatus = this.toObject(this.get('content.cluster'));
     clusterStatus = jQuery.extend(oldStatus, clusterStatus);
-    if(clusterStatus.requestId &&
+    if (clusterStatus.requestId &&
       clusterStatus.oldRequestsId.indexOf(clusterStatus.requestId) === -1){
       clusterStatus.oldRequestsId.push(clusterStatus.requestId);
     }
@@ -247,6 +248,8 @@ App.WizardController = Em.Controller.extend({
       return;
     }
 
+    this.set('content.cluster.requestId', null);
+
     var self = this;
     var clusterName = this.get('content.cluster.name');
     var url;
@@ -376,6 +379,12 @@ App.WizardController = Em.Controller.extend({
     console.log(this.get('name') + ": saved " + name, value);
   },
 
+  clear: function () {
+    this.set('content', Ember.Object.create({'controllerName': this.get('content.controllerName')}));
+    this.set('currentStep', 0);
+    this.clearStorageData();
+  },
+
   clusterStatusTemplate : {
     name: "",
     status: "PENDING",
@@ -400,12 +409,12 @@ App.WizardController = Em.Controller.extend({
     App.db.setAllHostNamesPattern(undefined);
   },
 
-  installOptionsTemplate : {
+  installOptionsTemplate: {
     hostNames: "", //string
     manualInstall: false, //true, false
     useSsh: true, //bool
     isJavaHome : false, //bool
-    javaHome: '', //string
+    javaHome: App.defaultJavaHome, //string
     localRepo: false, //true, false
     sshKey: "", //string
     bootRequestId: null //string

+ 10 - 1
ambari-web/app/controllers/wizard/step2_controller.js

@@ -66,7 +66,16 @@ App.WizardStep2Controller = Em.Controller.extend({
     return result;
   },
 
+  checkHosts: function() {
+    if (this.get('hostNames').trim() !== '') {
+      App.db.setStep2WizardFirstRun(false);
+    }
+  }.observes('hostNames'),
+
   hostsError: function () {
+    if (App.db.getStep2WizardFirstRun()) {
+      return null;
+    }
     if (this.get('hasSubmitted') && this.get('hostNames').trim() === '') {
       return Em.I18n.t('installer.step2.hostName.error.required');
     } else if (this.isAllHostNamesValid() === false) {
@@ -217,7 +226,7 @@ App.WizardStep2Controller = Em.Controller.extend({
   },
 
   isSubmitDisabled: function () {
-    return (this.get('hostsError') || this.get('sshKeyError'));
+    return (this.get('hostsError') || this.get('sshKeyError') || (this.get('hostNames').trim() === '' && App.db.getStep2WizardFirstRun()));
   }.property('hostsError', 'sshKeyError'),
 
   saveHosts: function(){

+ 3 - 0
ambari-web/app/controllers/wizard/step8_controller.js

@@ -1099,6 +1099,9 @@ App.WizardStep8Controller = Em.Controller.extend({
         console.log("STEP8: name of the global property is: " + _globalSiteObj.name);
         console.log("STEP8: value of the global property is: " + _globalSiteObj.value);
       }
+      if (_globalSiteObj.name == 'java64_home') {
+        globalSiteProperties['java64_home'] = this.get('content.installOptions.javaHome');
+      }
     }, this);
     return {"type": "global", "tag": "version1", "properties": globalSiteProperties};
   },

+ 1 - 1
ambari-web/app/data/service_configs.js

@@ -117,7 +117,7 @@ module.exports = [
     serviceName: 'MISC',
     displayName: 'Misc',
     configCategories: [
-      App.ServiceConfigCategory.create({ name: 'General'}),
+      /*App.ServiceConfigCategory.create({ name: 'General'}),*/
       App.ServiceConfigCategory.create({ name: 'Users and Groups'})
     ],
     configs: configProperties.filterProperty('serviceName', 'MISC')

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

@@ -25,6 +25,7 @@ App.alwaysGoToInstaller = false;
 App.apiPrefix = '/api/v1';
 App.defaultStackVersion = 'HDP-1.2.0';
 App.defaultLocalStackVersion = 'HDPLocal-1.2.0';
+App.defaultJavaHome = '/usr/jdk/jdk1.6.0_31';
 App.addServicesEnabled = false;
 // default AJAX timeout
 App.timeout = 20000;

+ 25 - 16
ambari-web/app/mappers/service_mapper.js

@@ -14,6 +14,7 @@
  * License for the specific language governing permissions and limitations under
  * the License.
  */
+var stringUtils = require('utils/string_utils');
 
 App.servicesMapper = App.QuickDataMapper.create({
   servicesSortOrder: [
@@ -149,6 +150,17 @@ App.servicesMapper = App.QuickDataMapper.create({
         var finalConfig = jQuery.extend({}, this.config);
         var finalJson = [];
         item.host_components = [];
+//        var json = this.parseIt(item, this.config);
+//        if(App.Service.find().someProperty('id', json.id)){
+//          var fieldsToUpdate = [
+//            'work_status',
+//            'components',
+//            'host_components'
+//          ]
+//          this.updateRecord(App.Service.find().findProperty('id', json.id), json, fieldsToUpdate);
+//          return;
+//        }
+
         if (this.get('model').find(item.ServiceInfo.service_name).get('isLoaded')) {
           this.update(item);
           return;
@@ -464,24 +476,21 @@ App.servicesMapper = App.QuickDataMapper.create({
     finalJson.quick_links = [13, 14, 15, 16, 17, 18];
     return finalJson;
   },
-  _update: function(model, json){
-    var content = model.find();
-    var addArray = [];
-    for(var i in json){
-      var item = json[i];
-      var oldItem = content.findProperty('id', item.id);
-      if(oldItem){
-
-        for(var field in item){ ///<--
-          if(field !== 'id'){
-            oldItem.set(field, item[field]);  //<--
-          }
+  updateRecord: function (record, json, fieldsToUpdate) {
+    for (var field in fieldsToUpdate) {
+      if (json[field] !== undefined) {
+        if(json[field] instanceof Array){
+          this.updateHasMany(record, stringUtils.underScoreToCamelCase(field), json[field]);
+        } else {
+          record.set(stringUtils.underScoreToCamelCase(field), json[field]);
         }
-
-      } else {
-        addArray.push(item);
       }
     }
-    App.store.loadMany(model, addArray);
+  },
+  updateHasMany: function(record, field, items ){
+    record.get(field).clear();
+    items.forEach(function (item) {
+      record.get(field).pushObject(record.get(field).type.find().findProperty('id', item));
+    });
   }
 });

+ 3 - 2
ambari-web/app/messages.js

@@ -98,17 +98,18 @@ Em.I18n.translations = {
     'hosts in your cluster. In these situations, you must set up a version of the repository that your machines can ' +
     'access locally and this is called a <b>Local Software Repository</b>',
   'installer.step2.javaHome.label' : 'Path to 64-bit JDK',
+  'installer.step2.javaHome.label2' : 'on all hosts',
   'installer.step2.javaHome.tooltip.title' : 'JAVA_HOME',
   'installer.step2.javaHome.tooltip.content' : 'Path to 64-bit JAVA_HOME. /usr/jdk/jdk1.6.0_31 is the default used by Ambari. You can override this to a specific path that contains the JDK. <br/> Note: the path must be valid on <b>ALL</b> hosts in your cluster.',
   'installer.step2.useSsh.provide' : 'Provide your',
-  'installer.step2.useSsh.provide_id_rsa' : '(id_rsa for root) and use SSH to automatically',
+  'installer.step2.useSsh.provide_id_rsa' : '(id_rsa for root) and use SSH to automatically register hosts',
   'installer.step2.useSsh.tooltip.title':'SSH Private Key',
   'installer.step2.useSsh.tooltip.content':'The <b>SSH Private Key File</b> is used for the root access to the target hosts in your cluster.',
   'installer.step2.manualInstall.tooltip.title':'Not Using SSH (Manual Install)',
   'installer.step2.manualInstall.tooltip.content':'If you do not wish Ambari to automatically configure the target hosts via SSH,' +
     ' you have the option of configuring them yourself.  This involves installing and starting Ambari Agent on each of your target hosts.',
   'installer.step2.manualInstall.popup.header':'Before You Proceed',
-  'installer.step2.manualInstall.popup.body':'You must install Ambari Agents on each host you want to manage before you proceed.  <a href="#" target="_blank">Learn more</a>',
+  'installer.step2.manualInstall.popup.body':'You must install Ambari Agents on each host you want to manage before you proceed.',
 
   'installer.step3.header':'Confirm Hosts',
   'installer.step3.body':'Registering your hosts.<br>' +

+ 7 - 3
ambari-web/app/router.js

@@ -35,9 +35,13 @@ App.Router = Em.Router.extend({
 
 
   clearAllSteps: function() {
-    this.set('installerController.content', []);
-    this.set('installerController.currentStep', 0);
-    this.set('wizardStep2Controller.hasSubmitted', false);
+    this.get('installerController').clear();
+    this.get('addHostController').clear();
+    this.get('addServiceController').clear();
+    for (i = 1; i<11; i++) {
+      this.set('wizardStep' + i + 'Controller.hasSubmitted', false);
+      this.set('wizardStep' + i + 'Controller.isDisabled', true);
+    }
   },
 
   /**

+ 20 - 35
ambari-web/app/routes/add_host_routes.js

@@ -24,6 +24,7 @@ module.exports = Em.Route.extend({
 
     Ember.run.next(function () {
       var addHostController = router.get('addHostController');
+      App.db.setStep2WizardFirstRun(true);
       App.router.get('updateController').set('isWorking', false);
       App.ModalPopup.show({
         classNames: ['full-width-modal'],
@@ -149,6 +150,10 @@ module.exports = Em.Route.extend({
         addHostController.get('content').set('serviceConfigProperties', null);
         App.db.setServiceConfigProperties(null);
         addHostController.loadAdvancedConfigs();
+        var wizardStep7Controller = router.get('wizardStep7Controller');
+        wizardStep7Controller.set('content', addHostController.get('content'));
+        wizardStep7Controller.loadStep();
+        addHostController.saveServiceConfigProperties(wizardStep7Controller);
         router.transitionTo('step4');
       }
     }
@@ -156,20 +161,21 @@ module.exports = Em.Route.extend({
 
   step4: Em.Route.extend({
     route: '/step4',
-    connectOutlets: function (router) {
+    connectOutlets: function (router, context) {
       console.log('in addHost.step4:connectOutlets');
       var controller = router.get('addHostController');
       controller.setCurrentStep('4');
       controller.dataLoading().done(function () {
         controller.loadAllPriorSteps();
-        controller.connectOutlet('wizardStep7', controller.get('content'));
+        controller.connectOutlet('wizardStep8', controller.get('content'));
       })
     },
     back: Em.Router.transitionTo('step3'),
     next: function (router) {
       var addHostController = router.get('addHostController');
-      var wizardStep7Controller = router.get('wizardStep7Controller');
-      addHostController.saveServiceConfigProperties(wizardStep7Controller);
+      var wizardStep8Controller = router.get('wizardStep8Controller');
+      addHostController.installServices();
+      addHostController.setInfoForStep9();
       router.transitionTo('step5');
     }
   }),
@@ -180,43 +186,22 @@ module.exports = Em.Route.extend({
       console.log('in addHost.step5:connectOutlets');
       var controller = router.get('addHostController');
       controller.setCurrentStep('5');
-      controller.dataLoading().done(function () {
-        controller.loadAllPriorSteps();
-        controller.connectOutlet('wizardStep8', controller.get('content'));
-      })
-    },
-    back: Em.Router.transitionTo('step4'),
-    next: function (router) {
-      var addHostController = router.get('addHostController');
-      var wizardStep8Controller = router.get('wizardStep8Controller');
-      addHostController.installServices();
-      addHostController.setInfoForStep9();
-      router.transitionTo('step6');
-    }
-  }),
-
-  step6: Em.Route.extend({
-    route: '/step6',
-    connectOutlets: function (router, context) {
-      console.log('in addHost.step6:connectOutlets');
-      var controller = router.get('addHostController');
-      controller.setCurrentStep('6');
       controller.dataLoading().done(function () {
         controller.loadAllPriorSteps();
         if (!App.testMode) {              //if test mode is ON don't disable prior steps link.
-          controller.setLowerStepsDisable(6);
+          controller.setLowerStepsDisable(5);
         }
         controller.connectOutlet('wizardStep9', controller.get('content'));
       })
     },
-    back: Em.Router.transitionTo('step5'),
+    back: Em.Router.transitionTo('step4'),
     retry: function(router,context) {
       var addHostController = router.get('addHostController');
       var wizardStep9Controller = router.get('wizardStep9Controller');
       if (!wizardStep9Controller.get('isSubmitDisabled')) {
         if (wizardStep9Controller.get('content.cluster.status') !== 'START FAILED') {
-        addHostController.installServices(true);
-        addHostController.setInfoForStep9();
+          addHostController.installServices(true);
+          addHostController.setInfoForStep9();
         } else {
           wizardStep9Controller.set('content.cluster.isCompleted', false);
         }
@@ -230,22 +215,22 @@ module.exports = Em.Route.extend({
       var addHostController = router.get('addHostController');
       var wizardStep9Controller = router.get('wizardStep9Controller');
       addHostController.saveInstalledHosts(wizardStep9Controller);
-      router.transitionTo('step7');
+      router.transitionTo('step6');
     }
   }),
 
-  step7: Em.Route.extend({
-    route: '/step7',
+  step6: Em.Route.extend({
+    route: '/step6',
     connectOutlets: function (router, context) {
-      console.log('in addHost.step7:connectOutlets');
+      console.log('in addHost.step6:connectOutlets');
       var controller = router.get('addHostController');
-      controller.setCurrentStep('7');
+      controller.setCurrentStep('6');
       controller.dataLoading().done(function () {
         controller.loadAllPriorSteps();
         controller.connectOutlet('wizardStep10', controller.get('content'));
       })
     },
-    back: Em.Router.transitionTo('step6'),
+    back: Em.Router.transitionTo('step5'),
     complete: function (router, context) {
       if (true) {   // this function will be moved to installerController where it will validate
         var addHostController = router.get('addHostController');

+ 5 - 1
ambari-web/app/styles/application.less

@@ -279,6 +279,9 @@ h1 {
         color: #ccc;
       }
     }
+    .java-home {
+      margin-bottom: 10px
+    }
   }
   #confirm-hosts {
     #host-filter {
@@ -534,8 +537,9 @@ a:focus {
 .sixty-percent-width-modal {
   .modal {
     width: 60%;
-    margin: -45% 0 0 -30%;
+    margin: 0 0 0 -30%;
     max-height: 526px;
+    top:5%;
   }
 
   .modal-body{

+ 0 - 0
ambari-web/app/templates/main/service/alert_notification_popup.hbs → ambari-web/app/templates/main/dashboard/alert_notification_popup.hbs


+ 3 - 1
ambari-web/app/templates/main/dashboard/service/hbase.hbs

@@ -27,7 +27,9 @@
     {{view App.MainDashboardServiceHealthView serviceBinding="view.service"}}
     <a {{action selectService view.service href=true}}>{{view.service.displayName}}</a>
     {{#if view.criticalAlertsCount}}
-      <a {{action selectService view.service href=true}} class="label label-important">{{view.criticalAlertsCount}}</a>
+      <a href="#" class="label label-important" {{action "showAlertsPopup" view.service target="view.parentView"}}>
+        {{view.criticalAlertsCount}}
+      </a>
     {{/if}}
   </div>
   <div class="summary span">

+ 3 - 1
ambari-web/app/templates/main/dashboard/service/hdfs.hbs

@@ -27,7 +27,9 @@
     {{view App.MainDashboardServiceHealthView serviceBinding="view.service"}}
     <a {{action selectService view.service href=true}}>{{view.service.displayName}}</a>
     {{#if view.criticalAlertsCount}}
-      <a {{action selectService view.service href=true}} class="label label-important">{{view.criticalAlertsCount}}</a>
+      <a href="#" class="label label-important" {{action "showAlertsPopup" view.service target="view.parentView"}}>
+        {{view.criticalAlertsCount}}
+      </a>
     {{/if}}
   </div>
   <div class="summary span">

+ 3 - 1
ambari-web/app/templates/main/dashboard/service/hive.hbs

@@ -22,7 +22,9 @@
     {{view App.MainDashboardServiceHealthView serviceBinding="view.service"}}
     <a {{action selectService view.service href=true}}>{{view.service.displayName}}</a>
     {{#if view.criticalAlertsCount}}
-      <a {{action selectService view.service href=true}} class="label label-important">{{view.criticalAlertsCount}}</a>
+      <a href="#" class="label label-important" {{action "showAlertsPopup" view.service target="view.parentView"}}>
+        {{view.criticalAlertsCount}}
+      </a>
     {{/if}}
   </div>
   <div class="summary span">

+ 3 - 1
ambari-web/app/templates/main/dashboard/service/mapreduce.hbs

@@ -27,7 +27,9 @@
     {{view App.MainDashboardServiceHealthView serviceBinding="view.service"}}
     <a {{action selectService view.service href=true}}>{{view.service.displayName}}</a>
     {{#if view.criticalAlertsCount}}
-      <a {{action selectService view.service href=true}} class="label label-important">{{view.criticalAlertsCount}}</a>
+      <a href="#" class="label label-important" {{action "showAlertsPopup" view.service target="view.parentView"}}>
+        {{view.criticalAlertsCount}}
+      </a>
     {{/if}}
   </div>
   <div class="summary span">

+ 3 - 1
ambari-web/app/templates/main/dashboard/service/oozie.hbs

@@ -22,7 +22,9 @@
     {{view App.MainDashboardServiceHealthView serviceBinding="view.service"}}
     <a {{action selectService view.service href=true}}>{{view.service.displayName}}</a>
     {{#if view.criticalAlertsCount}}
-      <a {{action selectService view.service href=true}} class="label label-important">{{view.criticalAlertsCount}}</a>
+      <a href="#" class="label label-important" {{action "showAlertsPopup" view.service target="view.parentView"}}>
+        {{view.criticalAlertsCount}}
+      </a>
     {{/if}}
   </div>
   <div class="summary span">

+ 3 - 1
ambari-web/app/templates/main/dashboard/service/zookeeper.hbs

@@ -22,7 +22,9 @@
     {{view App.MainDashboardServiceHealthView serviceBinding="view.service"}}
     <a {{action selectService view.service href=true}}>{{view.service.displayName}}</a>
     {{#if view.criticalAlertsCount}}
-      <a {{action selectService view.service href=true}} class="label label-important">{{view.criticalAlertsCount}}</a>
+      <a href="#" class="label label-important" {{action "showAlertsPopup" view.service target="view.parentView"}}>
+        {{view.criticalAlertsCount}}
+      </a>
     {{/if}}
   </div>
   <div class="summary span">

+ 3 - 4
ambari-web/app/templates/main/host/add.hbs

@@ -31,10 +31,9 @@
               <li {{bindAttr class="isStep1:active view.isStep1Disabled:disabled"}}><a href="javascript:void(null);"  {{action gotoStep1 target="controller"}}>{{t installer.step2.header}}</a></li>
               <li {{bindAttr class="isStep2:active view.isStep2Disabled:disabled"}}><a href="javascript:void(null);"  {{action gotoStep2 target="controller"}}>{{t installer.step3.header}}</a></li>
               <li {{bindAttr class="isStep3:active view.isStep3Disabled:disabled"}}><a href="javascript:void(null);"  {{action gotoStep3 target="controller"}}>{{t installer.step6.header}}</a></li>
-              <li {{bindAttr class="isStep4:active view.isStep4Disabled:disabled"}}><a href="javascript:void(null);"  {{action gotoStep4 target="controller"}}>{{t installer.step7.header}}</a></li>
-              <li {{bindAttr class="isStep5:active view.isStep5Disabled:disabled"}}><a href="javascript:void(null);"  {{action gotoStep5 target="controller"}}>{{t installer.step8.header}}</a></li>
-              <li {{bindAttr class="isStep6:active view.isStep6Disabled:disabled"}}><a href="javascript:void(null);"  {{action gotoStep6 target="controller"}}>{{t installer.step9.header}}</a></li>
-              <li {{bindAttr class="isStep7:active view.isStep7Disabled:disabled"}}><a href="javascript:void(null);"  {{action gotoStep7 target="controller"}}>{{t installer.step10.header}}</a></li>
+              <li {{bindAttr class="isStep4:active view.isStep4Disabled:disabled"}}><a href="javascript:void(null);"  {{action gotoStep4 target="controller"}}>{{t installer.step8.header}}</a></li>
+              <li {{bindAttr class="isStep5:active view.isStep5Disabled:disabled"}}><a href="javascript:void(null);"  {{action gotoStep5 target="controller"}}>{{t installer.step9.header}}</a></li>
+              <li {{bindAttr class="isStep6:active view.isStep6Disabled:disabled"}}><a href="javascript:void(null);"  {{action gotoStep6 target="controller"}}>{{t installer.step10.header}}</a></li>
             </ul>
           </div>
         </div>

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

@@ -20,7 +20,7 @@
   {{view App.MainDashboardServiceHealthView class="service-health" serviceBinding="view.content"}}&nbsp;
   <span>{{unbound view.content.displayName}}</span>
   {{#if view.alertsCount}}
-    <span class="label operations-count" {{action "showAlertsPopup" view.content on="click" target="view.parentView.parentView"}}>
+    <span class="label operations-count">
       {{view.alertsCount}}
     </span>
   {{/if}}

+ 7 - 4
ambari-web/app/templates/wizard/step2.hbs

@@ -89,7 +89,7 @@
   <div class="advancedOptions">
     <h5>{{t installer.step2.advancedOptions.header}}</h5>
 
-    <label {{bindAttr class=":checkbox content.installOptions.localRepo::disabled"}}>
+    <label {{bindAttr class=":checkbox"}}>
       {{view Ember.Checkbox checkedBinding="content.installOptions.localRepo"}}
 
       {{t installer.step2.localRepo.label_use}}
@@ -101,18 +101,21 @@
       {{t installer.step2.localRepo.label_instead}}
     </label>
 
-    <label {{bindAttr class=":checkbox content.installOptions.isJavaHome::disabled"}}>
+    <label {{bindAttr class=":checkbox"}}>
+      <div class="java-home">
       {{view Ember.Checkbox checkedBinding="content.installOptions.isJavaHome"}}
         {{t installer.step2.javaHome.label}}
         <a href="javascript:void(null)"
            rel="popover"
           {{translateAttr title="installer.step2.javaHome.tooltip.title" data-content="installer.step2.javaHome.tooltip.content"}}>
             {{t installer.step2.javaHome.tooltip.title}}</a>
-        {{view App.WizardTextField valueBinding="content.installOptions.javaHome" placeholder="/usr/jdk/jdk1.6.0_31"}}
+        {{t installer.step2.javaHome.label2}}
+      </div>
+      {{view App.WizardTextField valueBinding="content.installOptions.javaHome" placeholder="/usr/jdk/jdk1.6.0_31"}}
     </label>
   </div>
   <div class="btn-area">
-    {{#unless view.parentView.controller.hideBackButton }}
+    {{#unless view.parentView.controller.hideBackButton}}
     <a class="btn pull-left" {{action back}}>&larr; Back</a>
     {{/unless}}
     <a class="btn btn-success pull-right" {{bindAttr disabled="isSubmitDisabled"}} {{action evaluateStep target="controller"}}>

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

@@ -212,6 +212,14 @@ App.db.setCluster = function (status) {
   localStorage.setObject('ambari', App.db.data);
 };
 
+
+App.db.setStep2WizardFirstRun = function(status) {
+  App.db.data = localStorage.getObject('ambari');
+  App.db.data.Installer.step2WizardFirstRun = status;
+  console.log('db.setStep2WizardFirstRun called: ' + status);
+  localStorage.setObject('ambari', App.db.data);
+};
+
 /**
  * Set current step value for specified Wizard Type
  * @param wizardType
@@ -356,4 +364,10 @@ App.db.getCluster = function () {
   return App.db.data.Installer.clusterStatus;
 };
 
+App.db.getStep2WizardFirstRun = function() {
+  App.db.data = localStorage.getObject('ambari');
+  console.log('TRACE: Entering db:setStep2WizardFirstRun function');
+  return App.db.data.Installer.step2WizardFirstRun;
+};
+
 module.exports = App.db;

+ 10 - 0
ambari-web/app/utils/string_utils.js

@@ -51,5 +51,15 @@ module.exports = {
     }
     return str;
 
+  },
+  underScoreToCamelCase: function(string){
+    var result = string.split('');
+    for(var i = 0; i < result.length; i++){
+      if(result[i] === '_'){
+        result[i] = result[i+1].toUpperCase();
+        result.splice(i+1,1);
+      }
+    }
+    return result.join('');
   }
 }

+ 46 - 1
ambari-web/app/views/main/dashboard.js

@@ -85,5 +85,50 @@ App.MainDashboardView = Em.View.extend({
 
   gangliaUrl: function () {
     return App.router.get('clusterController.gangliaUrl') + "/?r=hour&cs=&ce=&m=&s=by+name&c=HDPSlaves&tab=m&vn=";
-  }.property('App.router.clusterController.gangliaUrl')
+  }.property('App.router.clusterController.gangliaUrl'),
+
+  showAlertsPopup: function (event) {
+    App.ModalPopup.show({
+      header: this.t('services.alerts.headingOfList'),
+      bodyClass: Ember.View.extend({
+        service: event.context,
+        warnAlerts: function () {
+          var allAlerts = App.router.get('clusterController.alerts');
+          var serviceId = this.get('service.serviceName');
+          if (serviceId) {
+            return allAlerts.filterProperty('serviceType', serviceId).filterProperty('isOk', false);
+          }
+          return 0;
+        }.property('App.router.clusterController.alerts'),
+
+        warnAlertsCount: function () {
+          return this.get('warnAlerts').length;
+        }.property('warnAlerts'),
+
+        nagiosUrl: function () {
+          return App.router.get('clusterController.nagiosUrl');
+        }.property('App.router.clusterController.nagiosUrl'),
+
+        closePopup: function () {
+          this.get('parentView').hide();
+        },
+
+        selectService: function () {
+          App.router.transitionTo('services.service.summary', event.context)
+          this.closePopup();
+        },
+        templateName: require('templates/main/dashboard/alert_notification_popup')
+      }),
+      primary: 'Close',
+      onPrimary: function() {
+        this.hide();
+      },
+      secondary : null,
+      didInsertElement: function () {
+        this.$().find('.modal-footer').addClass('align-center');
+        this.$().children('.modal').css({'margin-top': '-350px'});
+      }
+    });
+    event.stopPropagation();
+  }
 });

+ 1 - 44
ambari-web/app/views/main/service.js

@@ -19,48 +19,5 @@
 var App = require('app');
 
 App.MainServiceView = Em.View.extend({
-  templateName:require('templates/main/service'),
-
-  showAlertsPopup: function (event) {
-    App.ModalPopup.show({
-      header: this.t('services.alerts.headingOfList'),
-      bodyClass: Ember.View.extend({
-        service: event.context,
-        warnAlerts: function () {
-          var allAlerts = App.router.get('clusterController.alerts');
-          var serviceId = this.get('service.serviceName');
-          if (serviceId) {
-            return allAlerts.filterProperty('serviceType', serviceId).filterProperty('isOk', false);
-          }
-          return 0;
-        }.property('App.router.clusterController.alerts'),
-
-        warnAlertsCount: function () {
-          return this.get('warnAlerts').length;
-        }.property('warnAlerts'),
-
-        nagiosUrl: function () {
-          return App.router.get('clusterController.nagiosUrl');
-        }.property('App.router.clusterController.nagiosUrl'),
-
-        closePopup: function () {
-          this.get('parentView').hide();
-        },
-
-        selectService: function () {
-          App.router.transitionTo('services.service.summary', event.context)
-          this.closePopup();
-        },
-        templateName: require('templates/main/service/alert_notification_popup')
-      }),
-      primary: 'Close',
-      onPrimary: function() {
-        this.hide();
-      },
-      secondary : null,
-      didInsertElement: function () {
-        this.$().find('.modal-footer').addClass('align-center');
-      }
-    });
-  }
+  templateName:require('templates/main/service')
 });