Parcourir la source

AMBARI-815. Ensure data persistence during navigation, refresh and ensure necessary restrictions. (Jaimin Jetly via yusaku)

git-svn-id: https://svn.apache.org/repos/asf/incubator/ambari/branches/AMBARI-666@1394924 13f79535-47bb-0310-9956-ffa450edef68
Yusaku Sako il y a 12 ans
Parent
commit
d85333c510
41 fichiers modifiés avec 566 ajouts et 201 suppressions
  1. 3 0
      AMBARI-666-CHANGES.txt
  2. 0 1
      ambari-web/app/app.js
  3. 2 0
      ambari-web/app/controllers.js
  4. 3 0
      ambari-web/app/controllers/installer.js
  5. 39 0
      ambari-web/app/controllers/installer/step10_controller.js
  6. 9 4
      ambari-web/app/controllers/installer/step2_controller.js
  7. 26 16
      ambari-web/app/controllers/installer/step3_controller.js
  8. 34 6
      ambari-web/app/controllers/installer/step4_controller.js
  9. 9 5
      ambari-web/app/controllers/installer/step5_controller.js
  10. 63 7
      ambari-web/app/controllers/installer/step6_controller.js
  11. 68 31
      ambari-web/app/controllers/installer/step7_controller.js
  12. 43 0
      ambari-web/app/controllers/installer/step8_controller.js
  13. 74 17
      ambari-web/app/controllers/installer/step9_controller.js
  14. 6 26
      ambari-web/app/data/config_properties.js
  15. 13 13
      ambari-web/app/data/mock/step3_hosts.js
  16. 0 0
      ambari-web/app/data/mock/step3_pollData.js
  17. 5 0
      ambari-web/app/data/mock/step9_hosts.js
  18. 16 0
      ambari-web/app/data/mock/step9_pollData_1.js
  19. 16 0
      ambari-web/app/data/mock/step9_pollData_2.js
  20. 24 17
      ambari-web/app/data/service_configs.js
  21. 1 1
      ambari-web/app/messages.js
  22. 2 4
      ambari-web/app/models/hosts.js
  23. 31 1
      ambari-web/app/router.js
  24. 18 1
      ambari-web/app/routes/installer.js
  25. 10 10
      ambari-web/app/templates/installer.hbs
  26. 1 1
      ambari-web/app/templates/installer/master_hosts.hbs
  27. 6 3
      ambari-web/app/templates/installer/step10.hbs
  28. 2 2
      ambari-web/app/templates/installer/step3.hbs
  29. 0 4
      ambari-web/app/templates/installer/step5.hbs
  30. 4 6
      ambari-web/app/templates/installer/step7.hbs
  31. 1 1
      ambari-web/app/utils/db.js
  32. 2 2
      ambari-web/app/views.js
  33. 6 1
      ambari-web/app/views/installer/step10_view.js
  34. 1 1
      ambari-web/app/views/installer/step2_view.js
  35. 3 3
      ambari-web/app/views/installer/step3_view.js
  36. 1 1
      ambari-web/app/views/installer/step4_view.js
  37. 1 1
      ambari-web/app/views/installer/step5_view.js
  38. 1 1
      ambari-web/app/views/installer/step6_view.js
  39. 6 4
      ambari-web/app/views/installer/step7_view.js
  40. 7 1
      ambari-web/app/views/installer/step8_view.js
  41. 9 9
      ambari-web/app/views/installer/step9_view.js

+ 3 - 0
AMBARI-666-CHANGES.txt

@@ -12,6 +12,9 @@ AMBARI-666 branch (unreleased changes)
 
   NEW FEATURES
 
+  AMBARI-815. Ensure data persistence during navigation, refresh and
+  ensure necessary restrictions. (Jaimin Jetly via yusaku)
+
   AMBARI-806. Remove State object as configs/stack version/running state are
   handled as standalone entities. (hitesh)
 

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

@@ -20,7 +20,6 @@
 
 module.exports = Em.Application.create({
   name: 'Ambari Web',
-
   rootElement: '#wrapper',
 
   store: DS.Store.create({

+ 2 - 0
ambari-web/app/controllers.js

@@ -30,7 +30,9 @@ require('controllers/installer/step6_controller');
 require('controllers/installer/step5_controller');
 require('controllers/installer/step6_controller');
 require('controllers/installer/step7_controller');
+require('controllers/installer/step8_controller');
 require('controllers/installer/step9_controller');
+require('controllers/installer/step10_controller');
 require('controllers/main');
 require('controllers/main/admin');
 require('controllers/main/admin/item');

+ 3 - 0
ambari-web/app/controllers/installer.js

@@ -39,6 +39,9 @@ App.InstallerController = Em.Controller.extend({
         value: true
       }));
     }
+   // window.onbeforeunload = function () {
+     // return "You have not saved your document yet.  If you continue, your work will not be saved."
+    //}
   },
 
   setStepsEnable: function () {

+ 39 - 0
ambari-web/app/controllers/installer/step10_controller.js

@@ -0,0 +1,39 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+var App = require('app');
+
+App.InstallerStep10Controller = Em.ArrayController.extend({
+  name: 'installerStep10Controller',
+  content: [],
+
+  clearStep: function() {
+    this.clear();
+  },
+
+  loadStep: function() {
+    console.log("TRACE: Loading step10: Summary Page");
+    this.clearStep();
+
+  },
+
+  navigateStep: function() {
+    this.loadStep();
+  }
+});
+

+ 9 - 4
ambari-web/app/controllers/installer/step2_controller.js

@@ -47,13 +47,17 @@ App.InstallerStep2Controller = Em.Controller.extend({
     this.set('localRepoPath','');
   },
 
-  loadStep: function() {
+  navigateStep: function() {
     if (App.router.get('isFwdNavigation') === true) {
-      console.log("MASTER TRACE: Loading step2: Install Options");
-      this.clearStep();
+      this.loadStep();
     }
   },
 
+  loadStep: function() {
+    console.log("TRACE: Loading step2: Install Options");
+    this.clearStep();
+  },
+
   installType: function () {
     if (this.get('manualInstall') === true) {
       return 'manualDriven';
@@ -200,7 +204,8 @@ App.InstallerStep2Controller = Em.Controller.extend({
     for (var i = 0; i < this.hostNameArr.length; i++) {
       hostInfo[this.hostNameArr[i]] = {
         name: this.hostNameArr[i],
-        installType: this.get('installType')
+        installType: this.get('installType'),
+        bootStatus: 'pending'
       };
     }
     App.db.setHosts(hostInfo);

+ 26 - 16
ambari-web/app/controllers/installer/step3_controller.js

@@ -37,14 +37,24 @@ App.InstallerStep3Controller = Em.ArrayController.extend({
   }.observes('allChecked'),
 
   mockData: require('data/mock/step3_hosts'),
-  mockRetryData: require('data/mock/step3_retry_hosts'),
+  mockRetryData: require('data/mock/step3_pollData'),
 
-  loadStep: function () {
-    if (App.router.get('isFwdNavigation') === true) {
-      this.clear();
-      this.renderHosts(this.loadHosts());
+  navigateStep: function () {
+    if (App.router.get('isFwdNavigation') === true && !App.router.get('backBtnForHigherStep')) {
+      this.loadStep('pending');
       this.startBootstrap();
     }
+    App.router.set('backBtnForHigherStep', false);
+  },
+
+  loadStep: function (bootStatus) {
+    console.log("TRACE: Loading step3: Confirm Hosts");
+    this.clear();
+    var hosts = this.loadHosts();
+    if(bootStatus === 'pending') {
+    hosts.setEach('bootStatus','pending');
+    }
+    this.renderHosts(hosts);
   },
 
   /* Loads the hostinfo from localStorage on the insertion of view. It's being called from view */
@@ -53,7 +63,6 @@ App.InstallerStep3Controller = Em.ArrayController.extend({
     hostInfo = App.db.getHosts();
     var hosts = new Ember.Set();
     for (var index in hostInfo) {
-      hostInfo[index].status = "pending";
       hosts.add(hostInfo[index]);
       console.log("TRACE: host name is: " + hostInfo[index].name);
     }
@@ -67,7 +76,8 @@ App.InstallerStep3Controller = Em.ArrayController.extend({
     var self = this;
     hostsInfo.forEach(function (_hostInfo) {
       var hostInfo = App.HostInfo.create({
-        name: _hostInfo.name
+        name: _hostInfo.name,
+        bootStatus: _hostInfo.bootStatus
       });
 
       console.log('pushing ' + hostInfo.name);
@@ -84,12 +94,12 @@ App.InstallerStep3Controller = Em.ArrayController.extend({
     hostsFrmServer.forEach(function (_hostFrmServer) {
       var host = hostsFrmContent.findProperty('name', _hostFrmServer.name);
       if (host !== null && host !== undefined) { // check if hostname extracted from REST API data matches any hostname in content
-        host.set('status', _hostFrmServer.status);
+        host.set('bootStatus', _hostFrmServer.status);
         host.set('cpu', _hostFrmServer.cpu);
         host.set('memory', _hostFrmServer.memory);
       }
     });
-    result = !this.content.someProperty('status', 'pending');
+    result = !this.content.someProperty('bootStatus', 'pending');
     return result;
   },
 
@@ -97,15 +107,15 @@ App.InstallerStep3Controller = Em.ArrayController.extend({
   visibleHosts: function () {
     var result;
     if (this.get('category') === 'Succeeded') {
-      return (this.filterProperty('status', 'success'));
+      return (this.filterProperty('bootStatus', 'success'));
     } else if (this.get('category') === 'Failed') {
-      return (this.filterProperty('status', 'error'));
+      return (this.filterProperty('bootStatus', 'error'));
     } else if (this.get('category') === 'Hosts') {
       return this.content;
     }
   },
 
-  /* Below function removes a single element on the trsah icon click. Being called from view */
+  /* Below function removes a single element on the trash icon click. Being called from view */
   removeElement: function (hostInfo) {
     console.log('TRACE: In removeElement');
     var hosts = [hostInfo];
@@ -197,12 +207,12 @@ App.InstallerStep3Controller = Em.ArrayController.extend({
 
   saveHostInfoToDb: function () {
     var hostInfo = {};
-    var succededHosts = this.filterProperty('status', 'success');
-    succededHosts.forEach(function (_host) {
+    this.forEach(function (_host) {
       hostInfo[_host.name] = {
         name: _host.name,
         cpu: _host.cpu,
-        memory: _host.memory
+        memory: _host.memory,
+        bootStatus: _host.bootStatus
       };
     });
     App.db.setHosts(hostInfo);
@@ -249,7 +259,7 @@ App.InstallerStep3Controller = Em.ArrayController.extend({
       console.log('Retrying:  ' + _host.name);
     });
     if (this.parseHostInfo(mockHosts, selectedHosts)) {
-      this.saveHostInfoToDb();
+      // this.saveHostInfoToDb();
     }
   }
 

+ 34 - 6
ambari-web/app/controllers/installer/step4_controller.js

@@ -45,17 +45,45 @@ App.InstallerStep4Controller = Em.ArrayController.extend({
     }
   }.observes('@each.isSelected'),
 
-  loadStep: function () {
-    if (App.router.get('isFwdNavigation') === true) {
-      console.log("MASTER TRACE: Loading step4: Choose Services");
-      this.clear();
-      this.renderStep(this.rawContent);
+  navigateStep: function () {
+    if (App.router.get('isFwdNavigation') === true && !App.router.get('backBtnForHigherStep')) {
+      this.loadStepFromContent();
+    } else {
+      this.loadStepFromDb();
+    }
+    App.router.set('backBtnForHigherStep', false);
+  },
+
+  loadStepFromContent: function () {
+    console.log("TRACE: Loading from rawContent/API step4: Choose Services");
+    this.clear();
+    var rawContent = this.rawContent;
+    rawContent.setEach('isSelected', true);
+    this.renderStep(rawContent);
+  },
+
+  loadStepFromDb: function () {
+    console.log("TRACE: Loading form localStorage step4: Choose Services");
+    this.clear();
+    var rawContent = this.rawContent;
+    rawContent.setEach('isSelected', false);
+    var services = App.db.getSelectedServiceNames();
+    if (services !== undefined && services !== null) {
+      rawContent.forEach(function (_content) {
+        var serviceFound = services.contains(_content.serviceName);
+        if (serviceFound) {
+          _content.isSelected = true;
+        } else {
+          _content.isSelected = false;
+        }
+        console.log('TRACE: value of service is: ' + _content.serviceName);
+      });
+      this.renderStep(rawContent);
     }
   },
 
   renderStep: function (rawContent) {
     rawContent.forEach(function (item) {
-      item.isSelected = true;
       this.pushObject(Ember.Object.create(item));
     }, this);
   },

+ 9 - 5
ambari-web/app/controllers/installer/step5_controller.js

@@ -39,11 +39,15 @@ App.InstallerStep5Controller = Em.Controller.extend({
   },
 
   loadStep: function () {
+    console.log("TRACE: Loading step5: Assign Masters");
+    this.clearStep();
+    this.renderHostInfo(this.loadHostInfo());
+    this.renderComponents(this.loadComponents(this.loadServices()));
+  },
+
+  navigateStep: function () {
     if (App.router.get('isFwdNavigation') === true) {
-      console.log("TRACE: Loading step5: Assign Masters");
-      this.clearStep();
-      this.renderHostInfo(this.loadHostInfo());
-      this.renderComponents(this.loadComponents(this.loadServices()));
+      this.loadStep();
     }
   },
 
@@ -56,7 +60,7 @@ App.InstallerStep5Controller = Em.Controller.extend({
       hosts.add(hostInfo[index]);
       console.log("TRACE: host name is: " + hostInfo[index].name);
     }
-    return hosts;
+    return hosts.filterProperty('bootStatus','success');
   },
 
 

+ 63 - 7
ambari-web/app/controllers/installer/step6_controller.js

@@ -103,16 +103,72 @@ App.InstallerStep6Controller = Em.Controller.extend({
     this.get('hosts').setEach('isRegionServer', false);
   },
 
-  loadStep: function () {
-    if (App.router.get('isFwdNavigation') === true) {
-      console.log("TRACE: Loading step6: Assign Slaves");
-      this.set('hosts', []);
-      this.set('showHbase', this.isHbaseSelected());
+
+  clearStep: function () {
+    this.set('hosts', []);
+  },
+
+  loadStep: function (reload) {
+    console.log("TRACE: Loading step6: Assign Slaves");
+    this.clearStep();
+    this.set('showHbase', this.isHbaseSelected());
+    if (reload === true) {
       this.setSlaveHost(this.getHostNames());
+    } else {
+      this.loadSlaveHost(this.getSlaveHosts());
+    }
+  },
+
+  navigateStep: function () {
+    if (App.router.get('isFwdNavigation') === true && !App.router.get('backBtnForHigherStep')) {
+      this.loadStep(true);
     }
+    App.router.set('backBtnForHigherStep', false);
+  },
+
+  getSlaveHosts: function () {
+    var slaveHosts = App.db.getSlaveComponentHosts();
+    var hostNames = this.getHostNames();
+    var hostObjs = new Ember.Set();
+    hostNames.forEach(function (_hostName) {
+      hostObjs.add({
+        hostname: _hostName
+      });
+    });
+    var datanodes = slaveHosts.findProperty('componentName', 'DataNode');
+    datanodes.hosts.forEach(function (_datanode) {
+      var datanode = hostObjs.findProperty('hostname', _datanode.hostname);
+      if (datanode !== null) {
+        datanode.isDataNode = true;
+      }
+    });
+    var taskTrackers = slaveHosts.findProperty('componentName', 'TaskTracker');
+    taskTrackers.hosts.forEach(function (_taskTracker) {
+      var taskTracker = hostObjs.findProperty('hostname', _taskTracker.hostname);
+      if (taskTracker !== null) {
+        taskTracker.isTaskTracker = true;
+      }
+    });
+    if (this.isHbaseSelected()) {
+      var regionServers = slaveHosts.findProperty('componentName', 'RegionServer');
+      regionServers.hosts.forEach(function (_regionServer) {
+        var regionServer = hostObjs.findProperty('hostname', _regionServer.hostname);
+        if (regionServer !== null) {
+          regionServer.isRegionServer = true;
+        }
+      });
+    }
+    return hostObjs;
+  },
+
+  loadSlaveHost: function (hostObj) {
+    hostObj.forEach(function (_hostObj) {
+      this.get('hosts').pushObject(Ember.Object.create(_hostObj));
+    }, this);
   },
 
   setSlaveHost: function (hostNames) {
+
     hostNames.forEach(function (_hostName) {
       this.get('hosts').pushObject(Ember.Object.create({
         hostname: _hostName,
@@ -127,8 +183,8 @@ App.InstallerStep6Controller = Em.Controller.extend({
     var hostInfo = db.getHosts();
     var hostNames = [];
     for (var index in hostInfo) {
-      hostNames.push(hostInfo[index].name);
-
+      if (hostInfo[index].bootStatus === 'success')
+        hostNames.push(hostInfo[index].name);
     }
     return hostNames;
   },

+ 68 - 31
ambari-web/app/controllers/installer/step7_controller.js

@@ -47,6 +47,7 @@ App.InstallerStep7Controller = Em.ArrayController.extend({
   selectedServiceNames: [ 'HDFS', 'MAPREDUCE', 'GANGLIA', 'NAGIOS', 'HBASE', 'PIG', 'SQOOP', 'OOZIE', 'HIVE', 'ZOOKEEPER'],
   masterComponentHosts: require('data/mock/master_component_hosts'),
   slaveComponentHosts: [],
+  serviceConfigs: require('data/service_configs'),
 
   clearStep: function () {
     this.clear();
@@ -55,15 +56,47 @@ App.InstallerStep7Controller = Em.ArrayController.extend({
     this.slaveComponentHosts.clear();
   },
 
-  loadStep: function () {
-    if (App.router.get('isFwdNavigation') === true) {
-      this.clearStep();
-      this.renderConfigs(this.loadConfigs());
+  navigateStep: function () {
+    if (App.router.get('isFwdNavigation') === true && !App.router.get('backBtnForHigherStep')) {
+      this.loadStep();
+    } else {
+      this.loadStepFromDb();
     }
+    App.router.set('backBtnForHigherStep', false);
   },
 
-  loadConfigs: function () {
+  loadStep: function () {
+    console.log("TRACE: Loading step7: Configure Services");
+    this.clearStep();
+    this.loadConfigs();
+    this.renderServiceConfigs(this.serviceConfigs);
+  },
 
+  loadStepFromDb: function () {
+    console.log("TRACE: Loading step7 from localstorage data: Configure Services");
+    this.loadStep();
+    var storedServices = db.getServiceConfigProperties();
+    var configs = new Ember.Set();
+    var configProperties = new Ember.Set();
+    this.forEach(function (_content) {
+      _content.get('configs').forEach(function (_config) {
+        configs.add(_config);
+      }, this);
+    }, this);
+
+    var configProperties = new Ember.Set();
+    configs.forEach(function (_config) {
+      var temp = {name: _config.get('name'),
+        value: _config.get('value')};
+      configProperties.add(temp);
+      if (storedServices.someProperty('name', _config.get('name'))) {
+        var componentVal = storedServices.findProperty('name', _config.get('name'));
+        _config.set('value', componentVal.value)
+      }
+    }, this);
+  },
+
+  loadConfigs: function () {
     // load dependent data from the database
     var selectedServiceNamesInDB = db.getSelectedServiceNames();
     if (selectedServiceNamesInDB !== undefined) {
@@ -77,12 +110,9 @@ App.InstallerStep7Controller = Em.ArrayController.extend({
     if (slaveComponentHostsInDB != undefined) {
       this.set('slaveComponentHosts', slaveComponentHostsInDB);
     }
-    var serviceConfigs = require('data/service_configs');
-    return serviceConfigs;
-
   },
 
-  renderConfigs: function(serviceConfigs) {
+  renderServiceConfigs: function (serviceConfigs) {
     var self = this;
 
     serviceConfigs.forEach(function (_serviceConfig) {
@@ -94,27 +124,28 @@ App.InstallerStep7Controller = Em.ArrayController.extend({
       });
 
       if (self.selectedServiceNames.contains(serviceConfig.serviceName) || serviceConfig.serviceName === 'MISC') {
-        _serviceConfig.configs.forEach(function (_serviceConfigProperty) {
-          var serviceConfigProperty = App.ServiceConfigProperty.create(_serviceConfigProperty);
-          serviceConfigProperty.serviceConfig = serviceConfig;
-          serviceConfigProperty.initialValue();
-          serviceConfig.configs.pushObject(serviceConfigProperty);
-          serviceConfigProperty.validate();
-        });
-
-        console.log('pushing ' + serviceConfig.serviceName);
-        self.content.pushObject(serviceConfig);
+        self.renderComponentConfigs(_serviceConfig, serviceConfig);
       } else {
         console.log('skipping ' + serviceConfig.serviceName);
       }
-    });
+    }, this);
+  },
 
+  renderComponentConfigs: function (_componentConfig, componentConfig) {
+    _componentConfig.configs.forEach(function (_serviceConfigProperty) {
+      var serviceConfigProperty = App.ServiceConfigProperty.create(_serviceConfigProperty);
+      serviceConfigProperty.serviceConfig = componentConfig;
+      serviceConfigProperty.initialValue();
+      componentConfig.configs.pushObject(serviceConfigProperty);
+      serviceConfigProperty.validate();
+    }, this);
+
+    console.log('pushing ' + componentConfig.serviceName);
+    this.content.pushObject(componentConfig);
     this.set('selectedService', this.objectAt(0));
-
   },
 
 
-
   submit: function () {
     if (!this.get('isSubmitDisabled')) {
       // TODO:
@@ -122,17 +153,16 @@ App.InstallerStep7Controller = Em.ArrayController.extend({
       var serviceConfigProperties = [];
       this.content.forEach(function (_content) {
         var config = [];
-        config = _content.configs;
+        config = _content.get('configs');
         config.forEach(function (_configProperties) {
-          serviceConfigProperties.push(_configProperties);
-          console.log('TRACE: pushing: ' + _configProperties.name);
-          console.log('INFO: value: ' + _configProperties.value);
+          var configProperty = {name: _configProperties.get('name'),
+            value: _configProperties.get('value')};
+          serviceConfigProperties.push(configProperty);
         }, this);
 
       }, this);
       db.setServiceConfigProperties(serviceConfigProperties);
       App.router.send('next');
-      //App.get('router').transitionTo('step8');
     }
   },
 
@@ -158,7 +188,8 @@ App.InstallerStep7Controller = Em.ArrayController.extend({
     });
   }
 
-});
+})
+;
 
 App.SlaveComponentGroupsController = Ember.ArrayController.extend({
 
@@ -198,14 +229,20 @@ App.SlaveComponentGroupsController = Ember.ArrayController.extend({
   },
 
   hosts: function () {
-    if (this.get('selectedComponentName') !== null) {
-      return this.findProperty('componentName', this.get('selectedComponentName')).hosts;
+    if (this.get('selectedComponentName') !== null && this.get('selectedComponentName') !== undefined) {
+      var component = this.findProperty('componentName', this.get('selectedComponentName'));
+      if (component !== undefined && component !== null) {
+        return component.hosts;
+      }
     }
   }.property('@each.hosts', 'selectedComponentName'),
 
   groups: function () {
     if (this.get('selectedComponentName') !== null) {
-      return this.findProperty('componentName', this.get('selectedComponentName')).hosts.mapProperty('group').uniq();
+      var component = this.findProperty('componentName', this.get('selectedComponentName'));
+      if (component !== undefined && component !== null) {
+        return component.hosts.mapProperty('group').uniq();
+      }
     }
   }.property('@each.hosts', 'selectedComponentName')
 

+ 43 - 0
ambari-web/app/controllers/installer/step8_controller.js

@@ -0,0 +1,43 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+var App = require('app');
+
+App.InstallerStep8Controller = Em.ArrayController.extend({
+  name: 'installerStep8Controller',
+  content: [],
+
+  clearStep: function () {
+    this.clear();
+  },
+
+  loadStep: function () {
+    console.log("TRACE: Loading step8: Review Page");
+    this.clearStep();
+
+  },
+
+  navigateStep: function () {
+    if (App.router.get('isFwdNavigation') === true) {
+      this.loadStep();
+    }
+  }
+
+});
+
+

+ 74 - 17
ambari-web/app/controllers/installer/step9_controller.js

@@ -27,30 +27,66 @@ App.InstallerStep9Controller = Em.ArrayController.extend({
     return !this.get('isStepCompleted');
   }.property('isStepCompleted'),
 
-  status: 'info',
+  // status: 'info',
   mockHostData: require('data/mock/step9_hosts'),
   pollData_1: require('data/mock/step9_pollData_1'),
   pollData_2: require('data/mock/step9_pollData_2'),
   pollDataCounter: 0,
 
-  loadStep: function () {
-    if (App.router.get('isFwdNavigation') === true) {
-      console.log("TRACE: Loading step9: Install, Start and Test");
-      this.clear();
-      this.renderHosts(this.loadHosts());
+  status: function () {
+    if (this.everyProperty('status', 'success')) {
+      return 'success';
+    } else if (this.someProperty('status', 'failed')) {
+      return 'failed';
+    } else if (this.someProperty('status', 'warning')) {
+      return 'warning';
+    } else {
+      return 'info';
+    }
+  }.property('@each.status'),
+
+  navigateStep: function () {
+    if (App.router.get('isFwdNavigation') === true && !App.router.get('backBtnForHigherStep')) {
+      this.loadStep(true);
+      //TODO: uncomment following line after the hook up with the API call
+      //this.startPolling();
+    } else {
+      this.loadStep(false);
     }
+    App.router.set('backBtnForHigherStep', false);
+  },
+
+  clearStep: function () {
+    this.clear();
+    this.set('status', 'info');
+    this.set('progress', '0');
+    this.set('isStepCompleted', false);
   },
 
-  loadHosts: function () {
+  loadStep: function (restart) {
+    console.log("TRACE: Loading step9: Install, Start and Test");
+    this.clearStep();
+    this.renderHosts(this.loadHosts(restart));
+  },
+
+  loadHosts: function (restart) {
     var hostInfo = [];
     hostInfo = App.db.getHosts();
     var hosts = new Ember.Set();
     for (var index in hostInfo) {
-      hostInfo[index].status = "pending";
+      if (restart === true) {
+        //this.setInitialHostCondn(hostInfo[index]);
+        hostInfo[index].status = "pending";
+        hostInfo[index].message = 'Information';
+        hostInfo[index].progress = '0';
+      } else {
+        this.set('isStepCompleted', true);
+        this.set('progress', '100');
+      }
       hosts.add(hostInfo[index]);
       console.log("TRACE: host name is: " + hostInfo[index].name);
     }
-    return hosts;
+    return hosts.filterProperty('bootStatus', 'success');
   },
 
   renderHosts: function (hostsInfo) {
@@ -58,8 +94,9 @@ App.InstallerStep9Controller = Em.ArrayController.extend({
     hostsInfo.forEach(function (_hostInfo) {
       var hostInfo = App.HostInfo.create({
         name: _hostInfo.name,
+        status: _hostInfo.status,
         message: _hostInfo.message,
-        progress: '0'
+        progress: _hostInfo.progress
       });
 
       console.log('pushing ' + hostInfo.name);
@@ -119,7 +156,6 @@ App.InstallerStep9Controller = Em.ArrayController.extend({
     return result;
   },
 
-
   getFailedHostsForFailedRoles: function (polledData) {
     var hostArr = new Ember.Set();
     polledData.forEach(function (_polledData) {
@@ -178,12 +214,12 @@ App.InstallerStep9Controller = Em.ArrayController.extend({
         //exit();
       }
       if (actions !== null && actions !== undefined && actions.length !== 0) {
-        self.onSuccessPerHost(actions, _content);    // every action should be a success
-        self.onWarningPerHost(actions, _content);    // any action should be a faliure
-        self.onInProgressPerHost(actions, _content); // current running action for a host
+        this.onSuccessPerHost(actions, _content);    // every action should be a success
+        this.onWarningPerHost(actions, _content);    // any action should be a faliure
+        this.onInProgressPerHost(actions, _content); // current running action for a host
         totalProgress = totalProgress + self.progressPerHost(actions, _content);
       }
-    });
+    }, this);
     totalProgress = totalProgress / this.content.length;
     this.set('progress', totalProgress.toString());
     console.log("INFO: right now the progress is: " + this.get('progress'));
@@ -244,11 +280,32 @@ App.InstallerStep9Controller = Em.ArrayController.extend({
     // this.set('isStepCompleted',true);
   },
 
+  saveHostInfoToDb: function () {
+    var hostInfo = App.db.getHosts();
+    for (var index in hostInfo) {
+      hostInfo[index].status = "pending";
+      if (this.someProperty('name', hostInfo[index].name)) {
+        var host = this.findProperty('name', hostInfo[index].name);
+        hostInfo[index].status = host.status;
+        hostInfo[index].message = host.message;
+        hostInfo[index].progress = host.progress;
+      }
+      console.log("TRACE: host name is: " + hostInfo[index].name);
+    }
+    App.db.setHosts(hostInfo);
+  },
+
+
   submit: function () {
     if (!this.get('isSubmitDisabled')) {
-      //var erroneousHosts = hostResult.filterProperty('status', 'error');
+      this.saveHostInfoToDb();
+      App.get('router').transitionTo('step10');
+    }
+  },
 
-      App.get('router').transitionTo('step4');
+  back: function () {
+    if (!this.get('isSubmitDisabled')) {
+      App.router.send('back');
     }
   },
 

+ 6 - 26
ambari-web/app/data/config_properties.js

@@ -286,8 +286,8 @@ module.exports =
     },
     {
       "name": "hdfs_log_dir_prefix",
-      "displayName": "HDFS Log Dir Prefix",
-      "description": "The parent directory for HDFS log files.  The actual directory will be ${hdfs_log_dir_prefix}/${hdfs_user}",
+      "displayName": "Hadoop Log Dir Prefix",
+      "description": "The parent directory for Hadoop log files.  The HDFS log directory will be ${hadoop_log_dir_prefix} / ${hdfs_user} and the MapReduce log directory will be ${hadoop_log_dir_prefix} / ${mapred_user}.",
       "defaultValue": "/var/log/hadoop",
       "isReconfigurable": false,
       "displayType": "directory",
@@ -295,9 +295,9 @@ module.exports =
       "category": "Advanced"
     },
     {
-      "name": "hdfs_pid_dir_prefix",
-      "displayName": "HDFS PID Dir Prefix",
-      "description": "The parent directory in which the PID files for HDFS processes will be created.  The actual directory will be ${hdfs_log_dir_prefix}/${hdfs_user}",
+      "name": "hadoop_pid_dir_prefix",
+      "displayName": "Hadoop PID Dir Prefix",
+      "description": "The parent directory in which the PID files for Hadoop processes will be created.  The HDFS PID directory will be ${hadoop_pid_dir_prefix} / ${hdfs_user} and the MapReduce PID directory will be ${hadoop_pid_dir_prefix} / ${mapred_user}.",
       "defaultValue": "/var/run/hadoop",
       "isReconfigurable": false,
       "displayType": "directory",
@@ -537,26 +537,6 @@ module.exports =
       "isReconfigurable": false,
       "serviceName": "MAPREDUCE"
     },
-    {
-      "name": "mapred_log_dir_prefix",
-      "displayName": "MapReduce Log Dir Prefix",
-      "description": "The parent directory for MapReduce log files.  The actual directory will be ${mapred_log_dir_prefix}/${mapred_user}",
-      "defaultValue": "/var/log/hadoop",
-      "isReconfigurable": false,
-      "displayType": "directory",
-      "serviceName": "MAPREDUCE",
-      "category": "Advanced"
-    },
-    {
-      "name": "mapred_pid_dir_prefix",
-      "displayName": "MapReduce PID Dir Prefix",
-      "description": "The parent directory in which the PID files for MapReduce processes will be created.  The actual directory will be ${mapred_log_dir_prefix}/${mapred_user}",
-      "defaultValue": "/var/run/hadoop",
-      "isReconfigurable": false,
-      "displayType": "directory",
-      "serviceName": "MAPREDUCE",
-      "category": "Advanced"
-    },
     {
       "name": "scheduler_name",
       "displayName": "MapReduce Capacity Scheduler",
@@ -935,7 +915,7 @@ module.exports =
     },
     {
       "name": "oozie_data_dir",
-      "displayName": "Oozie DB directory",
+      "displayName": "Oozie Data Dir",
       "description": "Data directory in which the Oozie DB exists",
       "defaultValue": "",
       "isReconfigurable": false,

+ 13 - 13
ambari-web/app/data/mock/step3_hosts.js

@@ -1,80 +1,80 @@
 module.exports = new Ember.Set([
   {
     name: '192.168.1.1',
-    status: 'pending',
+    bootStatus: 'pending',
     cpu: '2',
     memory: '2'
   },
   {
     name: '192.168.1.2',
-    status: 'success',
+    bootStatus: 'success',
     cpu: '4',
     memory: '4'
   },
   {
     name: '192.168.1.3',
-    status: 'pending',
+    bootStatus: 'pending',
     cpu: '2',
     memory: '2'
   },
   {
     name: '192.168.1.4',
-    status: 'pending',
+    bootStatus: 'pending',
     cpu: '2',
     memory: '4'
   },
   {
     name: '192.168.1.5',
-    status: 'success',
+    bootStatus: 'success',
     cpu: '2',
     memory: '4'
   },
   {
     name: '192.168.1.6',
-    status: 'pending',
+    bootStatus: 'pending',
     cpu: '4',
     memory: '8'
   },
   {
     name: '192.168.1.7',
-    status: 'success',
+    bootStatus: 'success',
     cpu: '4',
     memory: '4'
 
   },
   {
     name: '192.168.1.8',
-    status: 'success',
+    bootStatus: 'success',
     cpu: '4',
     memory: '2'
   },
   {
     name: '192.168.1.9',
-    status: 'success',
+    bootStatus: 'success',
     cpu: '2',
     memory: '4'
   },
   {
     name: '192.168.1.10',
-    status: 'pending',
+    bootStatus: 'pending',
     cpu: '4',
     memory: '2'
   },
   {
     name: '192.168.1.11',
-    status: 'success',
+    bootStatus: 'success',
     cpu: '2',
     memory: '2'
   },
   {
     name: '192.168.1.12',
-    status: 'pending',
+    bootStatus: 'pending',
     cpu: '2',
     memory: '4'
   },
   {
     name: '192.168.1.13',
-    status: 'success',
+    bootStatus: 'success',
     cpu: '4',
     memory: '8'
   }

+ 0 - 0
ambari-web/app/data/mock/step3_retry_hosts.js → ambari-web/app/data/mock/step3_pollData.js


+ 5 - 0
ambari-web/app/data/mock/step9_hosts.js

@@ -78,5 +78,10 @@ module.exports = new Ember.Set([
     name: '192.168.1.12',
     progress: '0',
     message: 'starting'
+  },
+  {
+    name: '192.168.1.13',
+    progress: '0',
+    message: 'starting'
   }
 ]);

+ 16 - 0
ambari-web/app/data/mock/step9_pollData_1.js

@@ -306,5 +306,21 @@ module.exports = new Ember.Set([
     sf: '100',
     role: 'Pig Client',
     message: 'starting pig client'
+  },
+  {
+    actionId: '37',
+    name: '192.168.1.13',
+    status: 'inprogress',
+    sf: '100',
+    role: 'Pig Client',
+    message: 'starting pig client'
+  },
+  {
+    actionId: '38',
+    name: '192.168.1.13',
+    status: 'completed',
+    sf: '100',
+    role: 'Pig Client',
+    message: 'starting pig client'
   }
 ]);

+ 16 - 0
ambari-web/app/data/mock/step9_pollData_2.js

@@ -306,5 +306,21 @@ module.exports = new Ember.Set([
     sf: '100',
     role: 'Pig Client',
     message: 'completed 19%'
+  },
+  {
+    actionId: '37',
+    name: '192.168.1.13',
+    status: 'completed',
+    sf: '100',
+    role: 'Pig Client',
+    message: 'starting pig client'
+  },
+  {
+    actionId: '38',
+    name: '192.168.1.13',
+    status: 'completed',
+    sf: '100',
+    role: 'Pig Client',
+    message: 'starting pig client'
   }
 ]);

+ 24 - 17
ambari-web/app/data/service_configs.js

@@ -21,23 +21,6 @@ var App = require('app');
 var configProperties = App.ConfigProperties.create();
 
 module.exports = [
-  {
-    serviceName: 'NAGIOS',
-    displayName: 'Nagios',
-    configCategories: [
-      App.ServiceConfigCategory.create({ name: 'General'})
-    ],
-    configs: configProperties.filterProperty('serviceName', 'NAGIOS')
-  },
-  {
-    serviceName: 'HIVE',
-    displayName: 'Hive/HCat',
-    configCategories: [
-      App.ServiceConfigCategory.create({ name: 'Hive Metastore'}),
-      App.ServiceConfigCategory.create({ name: 'Advanced'})
-    ],
-    configs: configProperties.filterProperty('serviceName', 'HIVE')
-  },
   {
     serviceName: 'HDFS',
     displayName: 'HDFS',
@@ -50,6 +33,7 @@ module.exports = [
     ],
     configs: configProperties.filterProperty('serviceName', 'HDFS')
   },
+
   {
     serviceName: 'MAPREDUCE',
     displayName: 'MapReduce',
@@ -61,6 +45,17 @@ module.exports = [
     ],
     configs: configProperties.filterProperty('serviceName', 'MAPREDUCE')
   },
+
+  {
+    serviceName: 'HIVE',
+    displayName: 'Hive/HCat',
+    configCategories: [
+      App.ServiceConfigCategory.create({ name: 'Hive Metastore'}),
+      App.ServiceConfigCategory.create({ name: 'Advanced'})
+    ],
+    configs: configProperties.filterProperty('serviceName', 'HIVE')
+  },
+
   {
     serviceName: 'HBASE',
     displayName: 'HBase',
@@ -72,6 +67,7 @@ module.exports = [
     ],
     configs: configProperties.filterProperty('serviceName', 'HBASE')
   },
+
   {
     serviceName: 'ZOOKEEPER',
     displayName: 'ZooKeeper',
@@ -81,6 +77,7 @@ module.exports = [
     ],
     configs: configProperties.filterProperty('serviceName', 'ZOOKEEPER')
   },
+
   {
     serviceName: 'OOZIE',
     displayName: 'Oozie',
@@ -90,6 +87,16 @@ module.exports = [
     ],
     configs: configProperties.filterProperty('serviceName', 'OOZIE')
   },
+
+  {
+    serviceName: 'NAGIOS',
+    displayName: 'Nagios',
+    configCategories: [
+      App.ServiceConfigCategory.create({ name: 'General'})
+    ],
+    configs: configProperties.filterProperty('serviceName', 'NAGIOS')
+  },
+
   {
     serviceName: 'MISC',
     displayName: 'Misc',

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

@@ -94,7 +94,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.attention': 'more hosts without master service',
+  'installer.step5.attention': ' hosts not running master services',
   'installer.step5.body': 'Assign master components to hosts you want to run them on.',
 
   'installer.step6.header': 'Assign Slaves',

+ 2 - 4
ambari-web/app/models/hosts.js

@@ -21,14 +21,12 @@ var App = require('app');
 App.HostInfo = Ember.Object.extend({
   elementId: 'host',
   name: '',
-  status: 'info',
+  bootStatus: 'pending',
   cpu: '2',
   memory: '2',
   message: 'Information',
-  progress: '0',
+  //progress: '0',
   barColor: 'progress-info',
-  //barColor: true,
   isChecked: true
-
 });
 

+ 31 - 1
ambari-web/app/router.js

@@ -21,9 +21,14 @@ App.Router = Em.Router.extend({
 
   enableLogging: true,
   isFwdNavigation: true,
+  backBtnForHigherStep: false,
 
   setNavigationFlow: function (step) {
-    var newStep = parseInt(step.slice(-1));
+    var matches = step.match(/\d+$/);
+    var newStep;
+    if(matches){
+      newStep = parseInt(matches[0]);
+    }
     var previousStep = parseInt(this.getInstallerCurrentStep());
     if (newStep >= previousStep) {
       this.set('isFwdNavigation', true);
@@ -32,6 +37,31 @@ App.Router = Em.Router.extend({
     }
   },
 
+  loadAllPriorSteps: function(step) {
+  var stepVal = parseInt(step);
+    switch(step){
+      case '10':
+        this.get('installerStep9Controller').loadStep(false);
+      case '9':
+        this.get('installerStep8Controller').loadStep();
+      case '8':
+        this.get('installerStep7Controller').loadStepFrmDb();
+      case '7':
+        this.get('installerStep6Controller').loadStep();
+      case '6':
+        this.get('installerStep5Controller').loadStep();
+      case '5':
+        this.get('installerStep4Controller').loadStepFromDb();
+      case '4':
+        this.get('installerStep3Controller').loadStep('retainValue');
+      case '3':
+        this.get('installerStep2Controller').loadStep();
+      case '2':
+      case '1':
+
+    }
+  },
+
   setInstallerCurrentStep: function (currentStep, completed) {
     var loginName = this.getLoginName();
     App.db.setInstallerCurrentStep(currentStep, completed);

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

@@ -23,8 +23,9 @@ module.exports = Em.Route.extend({
     console.log('in /installer:enter');
 
     if (router.getAuthenticated()) {
-      console.log('In installer and its authenticated!!!');
+      console.log('In installer with successful authenticated');
       Ember.run.next(function () {
+        router.loadAllPriorSteps(router.getInstallerCurrentStep());
         router.transitionTo('step' + router.getInstallerCurrentStep());
       });
     } else {
@@ -36,6 +37,18 @@ module.exports = Em.Route.extend({
     }
   },
 
+  routePath: function (router, event) {
+    console.log("INFO: value of router is: " + router);
+    console.log("INFO: value of event is: " + event);
+    router.setNavigationFlow(event);
+    if (!router.isFwdNavigation) {
+      this._super(router,event);
+    } else {
+      router.set('backBtnForHigherStep',true);
+      router.transitionTo('step' + router.getInstallerCurrentStep());
+    }
+  },
+
   connectOutlets: function (router, context) {
     console.log('in /installer:connectOutlets');
     router.get('applicationController').connectOutlet('installer');
@@ -43,6 +56,9 @@ module.exports = Em.Route.extend({
 
   step1: Em.Route.extend({
     route: '/step1',
+    enter: function (router) {
+
+    },
     connectOutlets: function (router, context) {
       console.log('in installer.step1:connectOutlets');
       router.setNavigationFlow('step1');
@@ -90,6 +106,7 @@ module.exports = Em.Route.extend({
   step4: Em.Route.extend({
     route: '/step4',
     connectOutlets: function (router, context) {
+
       router.setNavigationFlow('step4');
       router.setInstallerCurrentStep('4', false);
       router.get('installerController').connectOutlet('installerStep4');

+ 10 - 10
ambari-web/app/templates/installer.hbs

@@ -25,16 +25,16 @@
           <div class="well">
             <ul class="nav nav-pills nav-stacked">
               <li class="nav-header">{{t installer.header}}</li>
-              <li {{bindAttr class="isStep1:active view.isStep1Disabled:disabled"}}><a {{action gotoStep1 target="controller"}}>{{t installer.step1.header}}</a></li>
-              <li {{bindAttr class="isStep2:active view.isStep2Disabled:disabled"}}><a {{action gotoStep2 target="controller"}}>{{t installer.step2.header}}</a></li>
-              <li {{bindAttr class="isStep3:active view.isStep3Disabled:disabled"}}><a {{action gotoStep3 target="controller"}}>{{t installer.step3.header}}</a></li>
-              <li {{bindAttr class="isStep4:active view.isStep4Disabled:disabled"}}><a {{action gotoStep4 target="controller"}}>{{t installer.step4.header}}</a></li>
-              <li {{bindAttr class="isStep5:active view.isStep5Disabled:disabled"}}><a {{action gotoStep5 target="controller"}}>{{t installer.step5.header}}</a></li>
-              <li {{bindAttr class="isStep6:active view.isStep6Disabled:disabled"}}><a {{action gotoStep6 target="controller"}}>{{t installer.step6.header}}</a></li>
-              <li {{bindAttr class="isStep7:active view.isStep7Disabled:disabled"}}><a {{action gotoStep7 target="controller"}}>{{t installer.step7.header}}</a></li>
-              <li {{bindAttr class="isStep8:active view.isStep8Disabled:disabled"}}><a {{action gotoStep8 target="controller"}}>{{t installer.step8.header}}</a></li>
-              <li {{bindAttr class="isStep9:active view.isStep9Disabled:disabled"}}><a {{action gotoStep9 target="controller"}}>{{t installer.step9.header}}</a></li>
-              <li {{bindAttr class="isStep10:active view.isStep10Disabled:disabled"}}><a {{action gotoStep10 target="controller"}}>{{t installer.step10.header}}</a></li>
+              <li {{bindAttr class="isStep1:active view.isStep1Disabled:disabled"}}><a href="javascript:void(null);"  {{action gotoStep1 target="controller"}}>{{t installer.step1.header}}</a></li>
+              <li {{bindAttr class="isStep2:active view.isStep2Disabled:disabled"}}><a href="javascript:void(null);"  {{action gotoStep2 target="controller"}}>{{t installer.step2.header}}</a></li>
+              <li {{bindAttr class="isStep3:active view.isStep3Disabled:disabled"}}><a href="javascript:void(null);"  {{action gotoStep3 target="controller"}}>{{t installer.step3.header}}</a></li>
+              <li {{bindAttr class="isStep4:active view.isStep4Disabled:disabled"}}><a href="javascript:void(null);"  {{action gotoStep4 target="controller"}}>{{t installer.step4.header}}</a></li>
+              <li {{bindAttr class="isStep5:active view.isStep5Disabled:disabled"}}><a href="javascript:void(null);"  {{action gotoStep5 target="controller"}}>{{t installer.step5.header}}</a></li>
+              <li {{bindAttr class="isStep6:active view.isStep6Disabled:disabled"}}><a href="javascript:void(null);"  {{action gotoStep6 target="controller"}}>{{t installer.step6.header}}</a></li>
+              <li {{bindAttr class="isStep7:active view.isStep7Disabled:disabled"}}><a href="javascript:void(null);"  {{action gotoStep7 target="controller"}}>{{t installer.step7.header}}</a></li>
+              <li {{bindAttr class="isStep8:active view.isStep8Disabled:disabled"}}><a href="javascript:void(null);"  {{action gotoStep8 target="controller"}}>{{t installer.step8.header}}</a></li>
+              <li {{bindAttr class="isStep9:active view.isStep9Disabled:disabled"}}><a href="javascript:void(null);"  {{action gotoStep9 target="controller"}}>{{t installer.step9.header}}</a></li>
+              <li {{bindAttr class="isStep10:active view.isStep10Disabled:disabled"}}><a href="javascript:void(null);" {{action gotoStep10 target="controller"}}>{{t installer.step10.header}}</a></li>
             </ul>
           </div>
         </div>

+ 1 - 1
ambari-web/app/templates/installer/master_hosts.hbs

@@ -5,5 +5,5 @@ No host assigned
 {{value}}
 {{/if}}
 {{#if view.hasMultipleHosts}}
-<a href="#" {{action showMasterHosts view.serviceConfig target="controller"}}>{{value.firstObject}} and {{view.otherLength}} others</a>
+<a href="#" {{action showMasterHosts view.serviceConfig target="controller"}}>{{value.firstObject}} and {{view.otherLength}}</a>
 {{/if}}

+ 6 - 3
ambari-web/app/templates/installer/step10.hbs

@@ -18,6 +18,9 @@
 
 <h2>{{t installer.step10.header}}</h2>
 <div class="btn-area">
-    <a class="btn" {{action back}}>Back</a>
-    <a class="btn btn-success" {{action complete}}>Complete</a>
-</div>
+  <a
+    class="btn pull-left" {{bindAttr disabled="isSubmitDisabled"}} {{action back}}>&larr;
+    Back</a>
+  <a
+    class="btn btn-success pull-right" {{bindAttr disabled="isSubmitDisabled"}} {{action complete}}>Complete &rarr;</a>
+</div>

+ 2 - 2
ambari-web/app/templates/installer/step3.hbs

@@ -75,12 +75,12 @@
     {{#each host in controller}}
     {{#view App.HostView categoryBinding="controller.category" hostInfoBinding="host"}}
     {{#if view.isVisible}}
-    <tr {{bindAttr class = "host.status"}}>
+    <tr {{bindAttr class = "host.bootStatus"}}>
       <td>
         {{view Ember.Checkbox checkedBinding="host.isChecked"}}
       </td>
       <td>
-        {{host.status}}
+        {{host.bootStatus}}
       </td>
 
       <td>

+ 0 - 4
ambari-web/app/templates/installer/step5.hbs

@@ -37,7 +37,6 @@
             serviceNameBinding="component_name"
             zIdBinding="zId"
           }}
-
           {{#if showAddControl}}
           {{view App.AddControlView
             componentNameBinding="component_name"
@@ -48,11 +47,9 @@
             zIdBinding="zId"
           }}
           {{/if}}
-
         </div>
       </div>
       {{/each}}
-
     </form>
   </div>
 
@@ -63,7 +60,6 @@
       {{#each masterServices}}
       <span class="assignedService round-corners">{{component_name}}</span>
       {{/each}}
-
     </div>
     {{/each}}
 

+ 4 - 6
ambari-web/app/templates/installer/step7.hbs

@@ -22,16 +22,15 @@
   <div class="alert alert-info">
     {{t installer.step7.body}}
   </div>
-  {{#view App.ServiceConfigTabs}}
   <ul class="nav nav-tabs">
     {{#each service in controller}}
-    <li><a class="active" {{bindAttr href="service.serviceName"}}
-           data-toggle="tab" {{action selectService service on="click" target="view"}}>{{service.displayName}}{{#if service.errorCount}}<span
+    {{#view App.ServiceConfigTab}}
+    <a class="active" href="#{{unbound service.serviceName}}"
+           data-toggle="tab" {{action selectService service target="view"}}>{{service.displayName}}{{#if service.errorCount}}<span
       class="badge badge-important">{{service.errorCount}}</span>{{/if}}</a>
-    </li>
+    {{/view}}
     {{/each}}
   </ul>
-  {{/view}}
   <div class="accordion">
     {{#each category in selectedService.configCategories}}
     <div class="accordion-group">
@@ -47,7 +46,6 @@
             {{#each view.categoryConfigs}}
             <div {{bindAttr class="errorMessage:error: :control-group"}}>
               <label class="control-label">{{displayName}}</label>
-
               <div class="controls">
                 {{view viewClass serviceConfigBinding="this"}}
                 <span class="help-inline">{{errorMessage}}</span>

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

@@ -310,7 +310,7 @@ App.db.getSlaveComponentHosts = function() {
   return App.db.data[user].Installer.slaveComponentHosts;
 }
 
-App.db.setServiceConfigProperties = function() {
+App.db.getServiceConfigProperties = function() {
   App.db.data = localStorage.getObject('ambari');
   var user = App.db.data.app.loginName;
   return App.db.data[user].Installer.configProperties;

+ 2 - 2
ambari-web/app/views.js

@@ -60,6 +60,6 @@ require('views/installer/step4_view');
 require('views/installer/step5_view');
 require('views/installer/step6_view');
 require('views/installer/step7_view');
-require('views/installer/step8');
+require('views/installer/step8_view');
 require('views/installer/step9_view');
-require('views/installer/step10');
+require('views/installer/step10_view');

+ 6 - 1
ambari-web/app/views/installer/step10.js → ambari-web/app/views/installer/step10_view.js

@@ -21,6 +21,11 @@ var App = require('app');
 
 App.InstallerStep10View = Em.View.extend({
 
-  templateName: require('templates/installer/step10')
+  templateName: require('templates/installer/step10'),
+
+  didInsertElement: function () {
+    var controller = this.get('controller');
+    controller.navigateStep();
+  }
 
 });

+ 1 - 1
ambari-web/app/views/installer/step2_view.js

@@ -25,7 +25,7 @@ App.InstallerStep2View = Em.View.extend({
 
   didInsertElement: function () {
     $("[rel=popover]").popover({'placement': 'right', 'trigger': 'hover'});
-    this.get('controller').loadStep();
+    this.get('controller').navigateStep();
   }
 
 });

+ 3 - 3
ambari-web/app/views/installer/step3_view.js

@@ -26,7 +26,7 @@ App.InstallerStep3View = Em.View.extend({
 
   didInsertElement: function () {
     var controller = this.get('controller');
-    controller.loadStep();
+    controller.navigateStep();
   }
 });
 
@@ -46,10 +46,10 @@ App.HostView = Em.View.extend({
     var category = this.get('category');
     if (category === "Hosts") {
       this.set('isVisible', true);
-    } else if (category === "Succeeded" && hostInfo.get('status') == "success") {
+    } else if (category === "Succeeded" && hostInfo.get('bootStatus') == "success") {
       this.set('isVisible', true);
       return true;
-    } else if (category === "Failed" && hostInfo.get('status') == "error") {
+    } else if (category === "Failed" && hostInfo.get('bootStatus') == "error") {
       this.set('isVisible', true);
     } else {
       this.set('isVisible', false);

+ 1 - 1
ambari-web/app/views/installer/step4_view.js

@@ -25,7 +25,7 @@ App.InstallerStep4View = Em.View.extend({
 
   didInsertElement: function () {
     var controller = this.get('controller');
-    controller.loadStep();
+    controller.navigateStep();
   }
 
 });

+ 1 - 1
ambari-web/app/views/installer/step5_view.js

@@ -25,7 +25,7 @@ App.InstallerStep5View = Em.View.extend({
 
   didInsertElement: function () {
     var controller = this.get('controller');
-    controller.loadStep();
+    controller.navigateStep();
   }
 
 });

+ 1 - 1
ambari-web/app/views/installer/step6_view.js

@@ -25,7 +25,7 @@ App.InstallerStep6View = Em.View.extend({
 
   didInsertElement: function () {
     var controller = this.get('controller');
-    controller.loadStep();
+    controller.navigateStep();
   }
 
 });

+ 6 - 4
ambari-web/app/views/installer/step7_view.js

@@ -25,7 +25,7 @@ App.InstallerStep7View = Em.View.extend({
 
   didInsertElement: function () {
     var controller = this.get('controller');
-    controller.loadStep();
+    controller.navigateStep();
   }
 
 });
@@ -42,15 +42,17 @@ App.ServiceConfigsByCategoryView = Ember.View.extend({
   }.property('serviceConfigs.@each').cacheable()
 });
 
-App.ServiceConfigTabs = Ember.View.extend({
+App.ServiceConfigTab = Ember.View.extend({
+
+  tagName: 'li',
 
   selectService: function (event) {
     this.set('controller.selectedService', event.context);
   },
 
   didInsertElement: function () {
-    var serviceName = this.get('controller.selectedService').serviceName;
-    this.$('a[href="' + serviceName + '"]').tab('show');
+    var serviceName = this.get('controller.selectedService.serviceName');
+    this.$('a[href="#' + serviceName + '"]').tab('show');
   }
 });
 

+ 7 - 1
ambari-web/app/views/installer/step8.js → ambari-web/app/views/installer/step8_view.js

@@ -21,6 +21,12 @@ var App = require('app');
 
 App.InstallerStep8View = Em.View.extend({
 
-  templateName: require('templates/installer/step8')
+  templateName: require('templates/installer/step8'),
+
+  didInsertElement: function () {
+    var controller = this.get('controller');
+    controller.navigateStep();
+  }
+
 
 });

+ 9 - 9
ambari-web/app/views/installer/step9_view.js

@@ -22,18 +22,14 @@ var App = require('app');
 App.InstallerStep9View = Em.View.extend({
 
   templateName: require('templates/installer/step9'),
-  barColor: 'progress-info',
+  barColor: '',
   resultMsg: '',
   resultMsgColor: '',
 
   didInsertElement: function () {
     var controller = this.get('controller');
-    controller.loadStep();
-    controller.clear();
-    var hosts = controller.loadHosts();
-    controller.renderHosts(hosts);
-    //TODO: uncomment following line after the hook up with the API call
-    //controller.startPolling();
+    this.onStatus();
+    controller.navigateStep();
   },
 
   barWidth: function () {
@@ -44,6 +40,7 @@ App.InstallerStep9View = Em.View.extend({
 
   onStatus: function () {
     if (this.get('controller.status') === 'info') {
+      this.set('resultMsg', '');
       this.set('barColor', 'progress-info');
     } else if (this.get('controller.status') === 'warning') {
       this.set('barColor', 'progress-warning');
@@ -65,9 +62,12 @@ App.InstallerStep9View = Em.View.extend({
 App.HostStatusView = Em.View.extend({
   tagName: 'tr',
   obj: 'null',
-  barColor: 'progress-info',
-
+  barColor: '',
 
+  didInsertElement: function () {
+    var controller = this.get('controller');
+    this.onStatus();
+  },
   barWidth: function () {
     var barWidth = 'width: ' + this.get('obj.progress') + '%;';
     return barWidth;