Ver código fonte

AMBARI-840. Hitting browser refresh should not clear present step data that had already been persisted to local DB. (Jaimin Jetly via yusaku)

git-svn-id: https://svn.apache.org/repos/asf/incubator/ambari/branches/AMBARI-666@1396845 13f79535-47bb-0310-9956-ffa450edef68
Yusaku Sako 12 anos atrás
pai
commit
44ec9f9aff
29 arquivos alterados com 724 adições e 298 exclusões
  1. 3 0
      AMBARI-666-CHANGES.txt
  2. 27 4
      ambari-web/app/controllers/installer/step1_controller.js
  3. 48 19
      ambari-web/app/controllers/installer/step2_controller.js
  4. 10 9
      ambari-web/app/controllers/installer/step3_controller.js
  5. 18 9
      ambari-web/app/controllers/installer/step4_controller.js
  6. 2 8
      ambari-web/app/controllers/installer/step5_controller.js
  7. 56 49
      ambari-web/app/controllers/installer/step6_controller.js
  8. 20 30
      ambari-web/app/controllers/installer/step7_controller.js
  9. 19 3
      ambari-web/app/controllers/installer/step8_controller.js
  10. 9 19
      ambari-web/app/controllers/installer/step9_controller.js
  11. 21 21
      ambari-web/app/data/config_properties.js
  12. 11 0
      ambari-web/app/data/mock/services.js
  13. 1 0
      ambari-web/app/messages.js
  14. 143 0
      ambari-web/app/models/host.js
  15. 0 1
      ambari-web/app/models/hosts.js
  16. 18 8
      ambari-web/app/router.js
  17. 42 21
      ambari-web/app/routes/installer.js
  18. 2 2
      ambari-web/app/templates/installer/step1.hbs
  19. 5 5
      ambari-web/app/templates/installer/step2.hbs
  20. 41 0
      ambari-web/app/templates/installer/step8.hbs
  21. 172 74
      ambari-web/app/utils/db.js
  22. 13 1
      ambari-web/app/views/installer/step1_view.js
  23. 16 2
      ambari-web/app/views/installer/step2_view.js
  24. 1 1
      ambari-web/app/views/installer/step4_view.js
  25. 1 1
      ambari-web/app/views/installer/step5_view.js
  26. 1 1
      ambari-web/app/views/installer/step6_view.js
  27. 16 4
      ambari-web/app/views/installer/step7_view.js
  28. 7 2
      ambari-web/app/views/installer/step8_view.js
  29. 1 4
      ambari-web/test/installer/step1_test.js

+ 3 - 0
AMBARI-666-CHANGES.txt

@@ -241,6 +241,9 @@ AMBARI-666 branch (unreleased changes)
 
   BUG FIXES
 
+  AMBARI-840. Hitting browser refresh should not clear present step data that 
+  had already been persisted to local DB. (Jaimin Jetly via yusaku)
+
   AMBARI-843. Fix more null pointers for partial request objects. (hitesh)
 
   AMBARI-842. Fix null point exception during adding of hosts to cluster. (hitesh)

+ 27 - 4
ambari-web/app/controllers/installer/step1_controller.js

@@ -17,19 +17,35 @@
  */
 
 var App = require('app');
-var db = require('utils/db');
+require('utils/db');
 
 App.InstallerStep1Controller = Em.Controller.extend({
   name: 'installerStep1Controller',
   content: [],
   clusterName: '',
-  invalidClusterName: false,
   clusterNameError: '',
+  invalidClusterName: true,
 
   /**
    * Returns true if the cluster name is valid and stores it in localStorage.
    * Returns false otherwise, and sets appropriate field error message.
    */
+
+  clearStep: function() {
+    this.set('clusterName','');
+  },
+
+  loadStep: function () {
+    var clusterName;
+    console.log('The value of the cluster name is: ' + App.db.getClusterName());
+    if (App.db.getClusterName() !== undefined && App.db.getClusterName() !== true ) {
+      this.set('clusterName', App.db.getClusterName());
+    } else {
+      this.set('clusterNameError','');
+      this.set('invalidClusterName',true);
+    }
+  },
+
   validateStep1: function () {
     console.log('TRACE: Entering controller:InstallerStep1:validateStep1 function');
     if (this.get('clusterName') == '') {
@@ -50,9 +66,16 @@ App.InstallerStep1Controller = Em.Controller.extend({
       console.log('value of clusterName is: ' + this.get('clusterName'));
       this.set('clusterNameError', '');
       this.set('invalidClusterName', false);
-      db.setClusterName(this.get('clusterName'));
       return true;
     }
-  }.observes('clusterName')
+  }.observes('clusterName'),
+
+  submit: function () {
+    this.validateStep1();
+    if (this.get('clusterNameError') === '') {
+      App.db.setClusterName(this.get('clusterName'));
+      App.router.send('next');
+    }
+  }
 
 })

+ 48 - 19
ambari-web/app/controllers/installer/step2_controller.js

@@ -39,23 +39,44 @@ App.InstallerStep2Controller = Em.Controller.extend({
   isSubmitDisabled: false,
 
 
-  clearStep: function() {
-    this.set('hostNames','');
-    this.set('sshKey','');
-    this.set('passphrase','');
-    this.set('confirmPassphrase','');
-    this.set('localRepoPath','');
+  clearStep: function () {
+    this.set('hostNames', '');
+    this.set('sshKey', '');
+    this.set('passphrase', '');
+    this.set('confirmPassphrase', '');
+    this.set('localRepoPath', '');
   },
 
-  navigateStep: function() {
+  navigateStep: function () {
     if (App.router.get('isFwdNavigation') === true) {
       this.loadStep();
     }
   },
 
-  loadStep: function() {
+  loadStep: function () {
     console.log("TRACE: Loading step2: Install Options");
-    this.clearStep();
+    var hostNames = App.db.getAllHostNames();
+    var softrepo = App.db.getSoftRepo();
+    var installType = App.db.getInstallType();
+    if (hostNames !== undefined) {
+      this.set('hostNames', hostNames);
+    } else {
+      this.set('hostNames', '');
+    }
+
+    if (installType !== undefined && installType.installType === 'manual') {
+      this.set('manualInstall', true);
+    } else {
+      this.set('manualInstall', false);
+    }
+
+    if (softrepo !== undefined && softrepo.repoType === 'local') {
+      this.set('localRepo', true);
+      this.set('localRepoPath', softrepo.repoPath);
+    } else {
+      this.set('localRepo', false);
+      this.set('localRepoPath', '');
+    }
   },
 
   installType: function () {
@@ -188,18 +209,13 @@ App.InstallerStep2Controller = Em.Controller.extend({
     console.log('TRACE: Entering controller:InstallerStep2:evaluateStep2 function');
     console.log('value of manual install is: ' + this.get('manualInstall'));
 
-    var validateResult = !this.validateStep2();
-
     if (this.get('isSubmitDisabled') === true) {
       console.log("ERROR: error in validation");
       return false;
-    } else {
-      if (this.get('manualInstall') === true) {
-        this.manualInstallPopup();
-        return true;
-      }
     }
 
+    var validateResult = !this.validateStep2();
+
     var hostInfo = {};
     for (var i = 0; i < this.hostNameArr.length; i++) {
       hostInfo[this.hostNameArr[i]] = {
@@ -208,14 +224,26 @@ App.InstallerStep2Controller = Em.Controller.extend({
         bootStatus: 'pending'
       };
     }
+    App.db.setAllHostNames(this.get('hostNames'));
     App.db.setHosts(hostInfo);
-
+    if (this.get('manualInstall') === false) {
+      App.db.setInstallType({installType: 'ambari' });
+    } else {
+      App.db.setInstallType({installType: 'manual' });
+    }
     if (this.get('localRepo') === false) {
       App.db.setSoftRepo({ 'repoType': 'remote', 'repoPath': null});
     } else {
       App.db.setSoftRepo({ 'repoType': 'local', 'repoPath': this.get('localRepoPath') });
     }
 
+
+    if (this.get('manualInstall') === true) {
+      this.manualInstallPopup();
+      return true;
+    }
+
+
     if (this.get('manualInstall') === false) {
       // For now using mock jquery call
       //TODO: hook up with bootstrap call
@@ -241,7 +269,7 @@ App.InstallerStep2Controller = Em.Controller.extend({
             //After the bootstrap call hook up change the below return statement to "return false"
             console.log("TRACE: In faliure function for the post bootstrap function");
             //Remove below line, once bootstrap has been implemented
-            App.router.transitionTo('step3');
+            App.router.send('next');
             return true;
           }
         },
@@ -258,7 +286,8 @@ App.InstallerStep2Controller = Em.Controller.extend({
       header: Em.I18n.t('installer.step2.manualInstall.popup.header'),
       onPrimary: function () {
         this.hide();
-        App.router.transitionTo('step3');
+        App.router.send('next');
+        //App.router.transitionTo('step3');
       },
       bodyClass: Ember.View.extend({
         templateName: require('templates/installer/step2ManualInstallPopup')

+ 10 - 9
ambari-web/app/controllers/installer/step3_controller.js

@@ -40,20 +40,21 @@ App.InstallerStep3Controller = Em.ArrayController.extend({
   mockRetryData: require('data/mock/step3_pollData'),
 
   navigateStep: function () {
-    if (App.router.get('isFwdNavigation') === true && !App.router.get('backBtnForHigherStep')) {
-      this.loadStep('pending');
+    this.loadStep();
+    if (App.db.getBootStatus() === false) {
       this.startBootstrap();
     }
-    App.router.set('backBtnForHigherStep', false);
   },
 
-  loadStep: function (bootStatus) {
-    console.log("TRACE: Loading step3: Confirm Hosts");
+  clearStep: function () {
     this.clear();
+  },
+
+  loadStep: function () {
+    console.log("TRACE: Loading step3: Confirm Hosts");
+    this.clearStep();
     var hosts = this.loadHosts();
-    if(bootStatus === 'pending') {
-    hosts.setEach('bootStatus','pending');
-    }
+    // hosts.setEach('bootStatus', 'pending');
     this.renderHosts(hosts);
   },
 
@@ -177,7 +178,7 @@ App.InstallerStep3Controller = Em.ArrayController.extend({
       success: function (data) {
         console.log("TRACE: In success function for the GET bootstrap call");
         var result = self.parseHostInfo(data, this.get('bootHosts'));
-        if (result !== true) {
+        if (result !== true && App.router.getInstallerCurrentStep() === '3') {
           window.setTimeout(self.doBootstrap, 3000);
         } else {
           self.stopBootstrap();

+ 18 - 9
ambari-web/app/controllers/installer/step4_controller.js

@@ -45,15 +45,20 @@ App.InstallerStep4Controller = Em.ArrayController.extend({
     }
   }.observes('@each.isSelected'),
 
-  navigateStep: function () {
-    if (App.router.get('isFwdNavigation') === true && !App.router.get('backBtnForHigherStep')) {
-      this.loadStepFromContent();
-    } else {
-      this.loadStepFromDb();
-    }
-    App.router.set('backBtnForHigherStep', false);
+  clearStep: function () {
+    this.clear();
+  },
+
+  loadStep: function() {
+    this.clearStep();
+    this.renderStep(this.loadServices());
+  },
+
+  loadServices: function() {
+    return db.getService();
   },
 
+  /*
   loadStepFromContent: function () {
     console.log("TRACE: Loading from rawContent/API step4: Choose Services");
     this.clear();
@@ -61,7 +66,9 @@ App.InstallerStep4Controller = Em.ArrayController.extend({
     rawContent.setEach('isSelected', true);
     this.renderStep(rawContent);
   },
+  */
 
+  /*
   loadStepFromDb: function () {
     console.log("TRACE: Loading form localStorage step4: Choose Services");
     this.clear();
@@ -81,9 +88,10 @@ App.InstallerStep4Controller = Em.ArrayController.extend({
       this.renderStep(rawContent);
     }
   },
+  */
 
-  renderStep: function (rawContent) {
-    rawContent.forEach(function (item) {
+  renderStep: function (serviceInfo) {
+    serviceInfo.forEach(function (item) {
       this.pushObject(Ember.Object.create(item));
     }, this);
   },
@@ -98,6 +106,7 @@ App.InstallerStep4Controller = Em.ArrayController.extend({
 
   saveSelectedServiceNamesToDB: function () {
     var serviceNames = [];
+    db.setService(this.get('content'));
     this.filterProperty('isSelected', true).forEach(function (item) {
       serviceNames.push(item.serviceName);
     });

+ 2 - 8
ambari-web/app/controllers/installer/step5_controller.js

@@ -45,14 +45,7 @@ App.InstallerStep5Controller = Em.Controller.extend({
     this.renderComponents(this.loadComponents(this.loadServices()));
   },
 
-  navigateStep: function () {
-    if (App.router.get('isFwdNavigation') === true) {
-      this.loadStep();
-    }
-  },
-
   loadHostInfo: function () {
-    //this.clear();
     var hostInfo = [];
     hostInfo = App.db.getHosts();
     var hosts = new Ember.Set();
@@ -83,7 +76,8 @@ App.InstallerStep5Controller = Em.Controller.extend({
   },
 
   loadServices: function () {
-    var services = App.db.getSelectedServiceNames();
+    var serviceInfo = App.db.getService();
+    var services = serviceInfo.filterProperty('isSelected',true).mapProperty('serviceName');
     services.forEach(function (item) {
       console.log("TRACE: service name is: " + item);
       this.get("selectedServices").pushObject(Ember.Object.create({service_name: item}));

+ 56 - 49
ambari-web/app/controllers/installer/step6_controller.js

@@ -108,66 +108,81 @@ App.InstallerStep6Controller = Em.Controller.extend({
     this.set('hosts', []);
   },
 
-  loadStep: function (reload) {
+  loadStep: function () {
     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());
-    }
+    this.setSlaveHost(this.getSlaveHosts());
   },
 
   navigateStep: function () {
-    if (App.router.get('isFwdNavigation') === true && !App.router.get('backBtnForHigherStep')) {
-      this.loadStep(true);
+    this.loadStep();
+  },
+
+  getHostNames: function () {
+    var hostInfo = db.getHosts();
+    var hostNames = [];
+    for (var index in hostInfo) {
+      if (hostInfo[index].bootStatus === 'success')
+        hostNames.push(hostInfo[index].name);
     }
-    App.router.set('backBtnForHigherStep', false);
+    return hostNames;
   },
 
   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 allHosts = this.getHostNames();
+    var slaveHosts = App.db.getSlaveComponentHosts();
+    if (slaveHosts === undefined || slaveHosts === null) {
+      allHosts.forEach(function (_hostname) {
+        var hostObj = {};
+        hostObj.hostname = _hostname;
+        hostObj.isDataNode = !this.hasMasterComponents(_hostname);
+        hostObj.isTaskTracker = !this.hasMasterComponents(_hostname);
+        hostObj.isRegionServer = !this.hasMasterComponents(_hostname);
+        hostObjs.add(hostObj);
+      }, this);
+      return hostObjs;
+    } else {
+      allHosts.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;
+      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;
     }
-    return hostObjs;
   },
 
-  loadSlaveHost: function (hostObj) {
+  setSlaveHost: function (hostObj) {
     hostObj.forEach(function (_hostObj) {
       this.get('hosts').pushObject(Ember.Object.create(_hostObj));
     }, this);
   },
 
-  setSlaveHost: function (hostNames) {
+  loadSlaveHost: function (hostNames) {
 
     hostNames.forEach(function (_hostName) {
       this.get('hosts').pushObject(Ember.Object.create({
@@ -179,15 +194,6 @@ App.InstallerStep6Controller = Em.Controller.extend({
     }, this);
   },
 
-  getHostNames: function () {
-    var hostInfo = db.getHosts();
-    var hostNames = [];
-    for (var index in hostInfo) {
-      if (hostInfo[index].bootStatus === 'success')
-        hostNames.push(hostInfo[index].name);
-    }
-    return hostNames;
-  },
 
   validate: function () {
     return !(this.get('isNoDataNodes') || this.get('isNoTaskTrackers') || this.get('isNoRegionServers'));
@@ -243,7 +249,8 @@ App.InstallerStep6Controller = Em.Controller.extend({
 
     App.db.setSlaveComponentHosts(slaveComponentHosts);
 
-    App.router.transitionTo('step7');
+    App.router.send('next');
 
   }
-});
+})
+;

+ 20 - 30
ambari-web/app/controllers/installer/step7_controller.js

@@ -56,44 +56,34 @@ App.InstallerStep7Controller = Em.ArrayController.extend({
     this.slaveComponentHosts.clear();
   },
 
-  navigateStep: function () {
-    if (App.router.get('isFwdNavigation') === true && !App.router.get('backBtnForHigherStep')) {
-      this.loadStep();
-    } else {
-      this.loadStepFromDb();
-    }
-    App.router.set('backBtnForHigherStep', false);
-  },
-
   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);
+    if (storedServices === undefined) {
+      return;
+    } else {
+      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);
-    }, 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);
+      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 () {

+ 19 - 3
ambari-web/app/controllers/installer/step8_controller.js

@@ -20,16 +20,32 @@ var App = require('app');
 
 App.InstallerStep8Controller = Em.ArrayController.extend({
   name: 'installerStep8Controller',
-  content: [],
+  contentBinding: Ember.Binding.oneWay('App.router.installerStep7Controller.content'),
+
 
   clearStep: function () {
     this.clear();
   },
 
   loadStep: function () {
-    console.log("TRACE: Loading step8: Review Page");
-    this.clearStep();
+    console.log("TRACE: Loading step8: Review Page")
+    App.router.get('installerStep7Controller').loadStep();
+    this.doConfigsUneditable();
+  },
 
+  doConfigsUneditable: function () {
+    this.content.forEach(function (_service) {
+      _service.get('configs').forEach(function (_serviceConfig) {
+        console.log('value of isEditable before for: '+ _serviceConfig.name);
+        console.log('value of isEditable before: '+ _serviceConfig.isEditable);
+        console.log('value of displayType before: '+ _serviceConfig.displayType);
+      _serviceConfig.set('isEditable',false);
+        _serviceConfig.set('displayType','string');
+        console.log('value of isEditable after for: '+ _serviceConfig.name);
+        console.log('value of isEditable after: '+ _serviceConfig.isEditable);
+        console.log('value of displayType after: '+ _serviceConfig.displayType);
+      }, this);
+    }, this);
   },
 
   navigateStep: function () {

+ 9 - 19
ambari-web/app/controllers/installer/step9_controller.js

@@ -21,13 +21,11 @@ App.InstallerStep9Controller = Em.ArrayController.extend({
   name: 'installerStep9Controller',
   content: [],
   progress: '0',
-  // result: 'pending', // val = pending or success or failed
   isStepCompleted: false,
   isSubmitDisabled: function () {
     return !this.get('isStepCompleted');
   }.property('isStepCompleted'),
 
-  // status: 'info',
   mockHostData: require('data/mock/step9_hosts'),
   pollData_1: require('data/mock/step9_pollData_1'),
   pollData_2: require('data/mock/step9_pollData_2'),
@@ -46,14 +44,14 @@ App.InstallerStep9Controller = Em.ArrayController.extend({
   }.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.loadStep();
+    //TODO: uncomment following line after the hook up with the API call
+    if (App.db.getClusterStatus().isCompleted === false) {
       //this.startPolling();
     } else {
-      this.loadStep(false);
+      this.set('isStepCompleted', true);
+      this.set('progress', '100');
     }
-    App.router.set('backBtnForHigherStep', false);
   },
 
   clearStep: function () {
@@ -63,26 +61,17 @@ App.InstallerStep9Controller = Em.ArrayController.extend({
     this.set('isStepCompleted', false);
   },
 
-  loadStep: function (restart) {
+  loadStep: function () {
     console.log("TRACE: Loading step9: Install, Start and Test");
     this.clearStep();
-    this.renderHosts(this.loadHosts(restart));
+    this.renderHosts(this.loadHosts());
   },
 
-  loadHosts: function (restart) {
+  loadHosts: function () {
     var hostInfo = [];
     hostInfo = App.db.getHosts();
     var hosts = new Ember.Set();
     for (var index in hostInfo) {
-      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);
     }
@@ -299,6 +288,7 @@ App.InstallerStep9Controller = Em.ArrayController.extend({
   submit: function () {
     if (!this.get('isSubmitDisabled')) {
       this.saveHostInfoToDb();
+      App.db.setClusterStatus({status: this.get('status'), isCompleted: true});
       App.get('router').transitionTo('step10');
     }
   },

+ 21 - 21
ambari-web/app/data/config_properties.js

@@ -738,27 +738,27 @@ module.exports =
       "serviceName": "MISC"
     },
     /*
-    {
-      "name": "hadoop_log_dir",
-      "displayName": "Hadoop Log Dir",
-      "description": "Directory for Hadoop log files",
-      "defaultValue": "/var/log/hadoop",
-      "isReconfigurable": false,
-      "displayType": "directory",
-      "serviceName": "MISC",
-      "category": "Advanced"
-    },
-    {
-      "name": "hadoop_pid_dir",
-      "displayName": "Hadoop PID Dir",
-      "description": "Directory in which the pid files for Hadoop processes will be created",
-      "defaultValue": "/var/run/hadoop",
-      "isReconfigurable": false,
-      "displayType": "directory",
-      "serviceName": "MISC",
-      "category": "Advanced"
-    },
-    */
+     {
+     "name": "hadoop_log_dir",
+     "displayName": "Hadoop Log Dir",
+     "description": "Directory for Hadoop log files",
+     "defaultValue": "/var/log/hadoop",
+     "isReconfigurable": false,
+     "displayType": "directory",
+     "serviceName": "MISC",
+     "category": "Advanced"
+     },
+     {
+     "name": "hadoop_pid_dir",
+     "displayName": "Hadoop PID Dir",
+     "description": "Directory in which the pid files for Hadoop processes will be created",
+     "defaultValue": "/var/run/hadoop",
+     "isReconfigurable": false,
+     "displayType": "directory",
+     "serviceName": "MISC",
+     "category": "Advanced"
+     },
+     */
     {
       "name": "using_local_repo",
       "displayName": "Whether a local repo is being used",

+ 11 - 0
ambari-web/app/data/mock/services.js

@@ -21,64 +21,75 @@ module.exports = [
     serviceName: 'HDFS',
     displayName: 'HDFS',
     isDisabled: true,
+    isSelected: true,
     description: Em.I18n.t('services.hdfs.description')
   },
   {
     serviceName: 'MAPREDUCE',
     displayName: 'MapReduce',
     isDisabled: false,
+    isSelected: true,
     description: Em.I18n.t('services.mapreduce.description')
   },
   {
     serviceName: 'NAGIOS',
     displayName: 'Nagios',
     isDisabled: false,
+    isSelected: true,
     description: Em.I18n.t('services.nagios.description')
   },
   {
     serviceName: 'GANGLIA',
     displayName: 'Ganglia',
     isDisabled: false,
+    isSelected: true,
     description: Em.I18n.t('services.ganglia.description')
   },
   {
     serviceName: 'HIVE',
     displayName: 'Hive + HCatalog',
     isDisabled: false,
+    isSelected: true,
     description: Em.I18n.t('services.hive.description')
   },
   {
     serviceName: 'HBASE',
     displayName: 'HBase + ZooKeeper',
     isDisabled: false,
+    isSelected: true,
     description: Em.I18n.t('services.hbase.description')
   },
   {
     serviceName: 'PIG',
     displayName: 'Pig',
     isDisabled: false,
+    isSelected: true,
     description: Em.I18n.t('services.pig.description')
   },
   {
     serviceName: 'SQOOP',
     displayName: 'Sqoop',
     isDisabled: false,
+    isSelected: true,
     description: Em.I18n.t('services.sqoop.description')
   },
   {
     serviceName: 'OOZIE',
     displayName: 'Oozie',
     isDisabled: false,
+    isSelected: true,
     description: Em.I18n.t('services.oozie.description')
   },
   {
     serviceName: 'ZOOKEEPER',
     isDisabled: false,
+    isSelected: true,
     isHidden: true
   },
   {
     serviceName: 'HCATALOG',
     isDisabled: false,
+    isSelected: true,
     isHidden: true
   }
 ]

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

@@ -106,6 +106,7 @@ Em.I18n.translations = {
   'installer.step7.attentionNeeded': '<strong>Attention:</strong> Some configurations need your attention before you can proceed.',
 
   'installer.step8.header': 'Review',
+  'installer.step8.body': 'Please review the cluster configuration before installation',
 
   'installer.step9.header': 'Install, Start and Test',
   'installer.step9.body': 'Wait to complete the cluster installation. Installing, Starting and Testing selected services',

+ 143 - 0
ambari-web/app/models/host.js

@@ -0,0 +1,143 @@
+/**
+ * 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.Host = DS.Model.extend({
+  hostName: DS.attr('string'),
+  cluster: DS.belongsTo('App.Cluster'),
+  components: DS.hasMany('App.Component'),
+  cpu: DS.attr('string'),
+  memory: DS.attr('string'),
+  diskUsage: DS.attr('string'),
+  loadAvg: DS.attr('string'),
+  os: DS.attr('string'),
+  ip: DS.attr('string'),
+  healthStatus: DS.attr('string'),
+  cpuUsage: DS.attr('number'),
+  memoryUsage: DS.attr('number'),
+  networkUsage: DS.attr('number'),
+  ioUsage: DS.attr('number')
+});
+
+App.Host.FIXTURES = [
+  {
+    id: 1,
+    host_name: 'z_host1',
+    cluster_id: 1,
+    components:[1, 2, 4],
+    cpu: '2x2.5GHz',
+    memory: '8GB',
+    disk_usage: '40',
+    load_avg: '0.2, 1.2, 2.4',
+    ip: '123.123.123.123',
+    health_status: 'LIVE',
+    cpu_usage: 33,
+    memory_usage: 26,
+    network_usage: 36,
+    io_usage: 39
+  },
+  {
+    id: 2,
+    host_name: 'host2',
+    cluster_id: 1,
+    components:[4, 5],
+    cpu: '2x2.5GHz',
+    memory: '8GB',
+    disk_usage: '20',
+    load_avg: '0.2, 1.2, 2.4',
+    ip: '255.255.255.255',
+    health_status: 'DEAD',
+    cpu_usage: 36,
+    memory_usage: 29,
+    network_usage: 56,
+    io_usage: 69
+  },
+  {
+    id: 3,
+    host_name: 'n_host3',
+    cluster_id: 2,
+    components:[4, 5, 7],
+    health_status: 'LIVE',
+    cpu_usage: 23,
+    memory_usage: 16,
+    network_usage: 16,
+    io_usage: 49
+  },
+  {
+    id: 4,
+    host_name: 'b_host4',
+    cluster_id: 2,
+    components:[1, 2, 4, 5],
+    health_status: 'DEAD',
+    cpu_usage: 23,
+    memory_usage: 36,
+    network_usage: 46,
+    io_usage: 39
+  },
+  {
+    id: 5,
+    host_name: 'host5',
+    cluster_id: 1,
+    components:[3, 4, 5],
+    cpu: '2x2.5GHz',
+    memory: '8GB',
+    disk_usage: '20',
+    load_avg: '0.2, 1.2, 2.4',
+    ip: '255.255.255.255',
+    health_status: 'DEAD',
+    cpu_usage: 53,
+    memory_usage: 16,
+    network_usage: 16,
+    io_usage: 29
+  },
+  {
+    id: 6,
+    host_name: 'a_host6',
+    cluster_id: 1,
+    components:[4, 5],
+    cpu: '2x2.5GHz',
+    memory: '8GB',
+    disk_usage: '20',
+    load_avg: '0.2, 1.2, 2.4',
+    ip: '255.255.255.255',
+    health_status: 'LIVE',
+    cpu_usage: 33,
+    memory_usage: 26,
+    network_usage: 36,
+    io_usage: 39
+
+  },
+  {
+    id: 7,
+    host_name: 'host7',
+    cluster_id: 1,
+    components:[3, 4, 7],
+    cpu: '2x2.5GHz',
+    memory: '8GB',
+    disk_usage: '20',
+    load_avg: '0.2, 1.2, 2.4',
+    ip: '255.255.255.255',
+    health_status: 'LIVE',
+    cpu_usage: 53,
+    memory_usage: 16,
+    network_usage: 16,
+    io_usage: 29
+  }
+];

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

@@ -25,7 +25,6 @@ App.HostInfo = Ember.Object.extend({
   cpu: '2',
   memory: '2',
   message: 'Information',
-  //progress: '0',
   barColor: 'progress-info',
   isChecked: true
 });

+ 18 - 8
ambari-web/app/router.js

@@ -37,30 +37,40 @@ App.Router = Em.Router.extend({
     }
   },
 
+  clearAllSteps: function() {
+    var totalSteps = 10
+    for (var step = 1; step <= totalSteps; step++){
+      this.get('installerStep' + step + 'Controller').clearStep();
+    }
+  },
+
+  /*
   loadAllPriorSteps: function(step) {
-  var stepVal = parseInt(step);
+    var stepVal = parseInt(step);
     switch(step){
       case '10':
-        this.get('installerStep9Controller').loadStep(false);
+        this.get('installerStep9Controller').loadStep();
       case '9':
         this.get('installerStep8Controller').loadStep();
       case '8':
-        this.get('installerStep7Controller').loadStepFrmDb();
+        this.get('installerStep7Controller').loadStep();
       case '7':
         this.get('installerStep6Controller').loadStep();
       case '6':
         this.get('installerStep5Controller').loadStep();
       case '5':
-        this.get('installerStep4Controller').loadStepFromDb();
+        this.get('installerStep4Controller').loadStep();
       case '4':
-        this.get('installerStep3Controller').loadStep('retainValue');
+        this.get('installerStep3Controller').loadStep();
       case '3':
         this.get('installerStep2Controller').loadStep();
       case '2':
+        this.get('installerStep1Controller').loadStep();
       case '1':
 
     }
   },
+  */
 
   setInstallerCurrentStep: function (currentStep, completed) {
     var loginName = this.getLoginName();
@@ -99,13 +109,12 @@ App.Router = Em.Router.extend({
   getLoginName: function () {
     // TODO: this needs to be hooked up with server authentication
     return App.db.getLoginName();
-    //return localStorage.getItem('Ambari' + 'loginName');
+
   },
 
   setLoginName: function (loginName) {
     // TODO: this needs to be hooked up with server authentication
     App.db.setLoginName(loginName);
-    //localStorage.setItem('Ambari' + 'loginName', loginName);
   },
 
   // that works incorrectly
@@ -124,7 +133,7 @@ App.Router = Em.Router.extend({
     this.setLoginName(loginName);
 
 //    refactor to get user attributes
-//    this.setUser(user);
+    this.setUser(user);
 
     this.transitionTo(this.getSection());
 
@@ -180,6 +189,7 @@ App.Router = Em.Router.extend({
 
     logoff: function (router, context) {
       console.log('logging off');
+      router.clearAllSteps();
       App.db.cleanUp();
       router.set('loginController.loginName', '');
       router.set('loginController.password', '');

+ 42 - 21
ambari-web/app/routes/installer.js

@@ -15,17 +15,17 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
+var App = require('app');
 module.exports = Em.Route.extend({
   route: '/installer',
-
+  App: require('app'),
   enter: function (router) {
     console.log('in /installer:enter');
 
     if (router.getAuthenticated()) {
       console.log('In installer with successful authenticated');
+     // router.loadAllPriorSteps(router.getInstallerCurrentStep());
       Ember.run.next(function () {
-        router.loadAllPriorSteps(router.getInstallerCurrentStep());
         router.transitionTo('step' + router.getInstallerCurrentStep());
       });
     } else {
@@ -42,9 +42,9 @@ module.exports = Em.Route.extend({
     console.log("INFO: value of event is: " + event);
     router.setNavigationFlow(event);
     if (!router.isFwdNavigation) {
-      this._super(router,event);
+      this._super(router, event);
     } else {
-      router.set('backBtnForHigherStep',true);
+      router.set('backBtnForHigherStep', true);
       router.transitionTo('step' + router.getInstallerCurrentStep());
     }
   },
@@ -65,15 +65,7 @@ module.exports = Em.Route.extend({
       router.setInstallerCurrentStep('1', false);
       router.get('installerController').connectOutlet('installerStep1');
     },
-
-    next: function (router, context) {
-      var result = router.get('installerStep1Controller').validateStep1();
-      if (result === true) {
-        router.transitionTo('step2');
-      } else {
-        router.get('installerController').connectOutlet('installerStep1');
-      }
-    }
+    next: Em.Router.transitionTo('step2')
   }),
 
   step2: Em.Route.extend({
@@ -85,10 +77,17 @@ module.exports = Em.Route.extend({
     },
     back: Em.Router.transitionTo('step1'),
     next: function (router, context) {
-      var result = router.get('installerStep2Controller').evaluateStep2();
-      if (result === false) {
-        console.log('ERROR: error in evaluateStep2 function');
+      App.db.setBootStatus(false);
+      var hosts = App.db.getHosts();
+      var hostInfo = {};
+      for (var index in hosts) {
+        hostInfo[index] = {
+          name: hosts[index].name,
+          bootStatus: 'pending'
+        };
       }
+      App.db.setHosts(hostInfo);
+      router.transitionTo('step3');
     }
   }),
 
@@ -100,7 +99,11 @@ module.exports = Em.Route.extend({
       router.get('installerController').connectOutlet('installerStep3');
     },
     back: Em.Router.transitionTo('step2'),
-    next: Em.Router.transitionTo('step4')
+    next: function (router, context) {
+      App.db.setBootStatus(true);
+      App.db.setService(router.get('installerStep4Controller.rawContent'));
+      router.transitionTo('step4');
+    }
   }),
 
   step4: Em.Route.extend({
@@ -125,7 +128,10 @@ module.exports = Em.Route.extend({
       router.get('installerController').connectOutlet('installerStep5');
     },
     back: Em.Router.transitionTo('step4'),
-    next: Em.Router.transitionTo('step6')
+    next: function (router, context) {
+      App.db.setSlaveComponentHosts(undefined);
+      router.transitionTo('step6');
+    }
   }),
 
   step6: Em.Route.extend({
@@ -136,7 +142,10 @@ module.exports = Em.Route.extend({
       router.get('installerController').connectOutlet('installerStep6');
     },
     back: Em.Router.transitionTo('step5'),
-    next: Em.Router.transitionTo('step7')
+    next: function (router, context) {
+      App.db.setServiceConfigProperties(undefined);
+      router.transitionTo('step7');
+    }
   }),
 
   step7: Em.Route.extend({
@@ -159,7 +168,19 @@ module.exports = Em.Route.extend({
       router.get('installerController').connectOutlet('installerStep8');
     },
     back: Em.Router.transitionTo('step7'),
-    next: Em.Router.transitionTo('step9')
+
+    next: function (router, context) {
+      App.db.setClusterStatus({status: 'pending', isCompleted: false});
+      var hostInfo = App.db.getHosts();
+      for (var index in hostInfo) {
+        hostInfo[index].status = "pending";
+        hostInfo[index].message = 'Information';
+        hostInfo[index].progress = '0';
+      }
+      App.db.setHosts(hostInfo);
+      console.log("TRACE: host name is: " + hostInfo[index].name);
+      router.transitionTo('step9');
+    }
   }),
 
   step9: Em.Route.extend({

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

@@ -20,7 +20,7 @@
 <p class="alert alert-info">
   {{t installer.step1.body}}
 </p>
-<div {{bindAttr class="invalidClusterName:error :control-group"}}>
+<div {{bindAttr class="view.onError:error :control-group"}}>
   <label class="control-label" for="cluster-name">{{t installer.step1.clusterName}}
     <a href="javascript:void(null)"
        rel="popover"
@@ -35,7 +35,7 @@
 </div>
 
 <div class="btn-area">
-  <a class="btn btn-success pull-right" {{bindAttr disabled= "invalidClusterName"}} {{action next}}>Next &rarr;</a>
+  <a class="btn btn-success pull-right" {{bindAttr disabled= "invalidClusterName"}} {{action "submit" target="controller"}}>Next &rarr;</a>
 </div>
 
 

+ 5 - 5
ambari-web/app/templates/installer/step2.hbs

@@ -18,9 +18,9 @@
 
 <h2>{{t installer.step2.header}}</h2>
 
-<h5 {{bindAttr class="hostManageErr:text-error"}}>{{t installer.step2.targetHosts}}</h5>
+<h5>{{t installer.step2.targetHosts}}</h5>
 
-<div {{bindAttr class="hostNameErrMsg:error :control-group"}}>
+<div {{bindAttr class="view.hostNameErr:error :control-group"}}>
   <p>{{t installer.step2.targetHosts.info}}. Or use
     <a href="javascript:void(null)"
        rel="popover"
@@ -31,7 +31,7 @@
 
   <div class="controls">
     {{view Ember.TextArea class="span6" valueBinding="hostNames" rows="5" placeholder="host names"}}
-    {{#if hostNameErrMsg}}
+    {{#if view.hostNameErr}}
     <p class="help-inline">{{hostNameErrMsg}}</p>
     {{/if}}
   </div>
@@ -66,7 +66,7 @@
 
 </div>
 
-<h5 {{bindAttr class="advOptErr:text-error"}}>{{t installer.step2.advancedOption}}</h5>
+<h5>{{t installer.step2.advancedOption}}</h5>
 <label class="checkbox">
   {{t installer.step2.manualInstallOption}}
   <a href="javascript:void(null)"
@@ -104,7 +104,7 @@
   <a role="button" class="btn btn-success pull-right"
      data-toggle="modal" {{action evaluateStep2 target="controller"}}>Validate &rarr;</a>
   {{else}}
-  <a class="btn btn-success pull-right" {{action next}}> Discover and
+  <a class="btn btn-success pull-right" {{action evaluateStep2 target="controller"}}> Discover and
     Validate &rarr; </a>
   {{/if}}
 </div>

+ 41 - 0
ambari-web/app/templates/installer/step8.hbs

@@ -17,6 +17,47 @@
 -->
 
 <h2>{{t installer.step8.header}}</h2>
+<div class="alert alert-info">
+  {{t installer.step8.body}}
+</div>
+
+<div class="accordion">
+
+  {{#each service in controller}}
+  <div class="accordion-group">
+    <div class="accordion-heading">
+      <a class="accordion-toggle">
+        {{service.serviceName}}
+      </a>
+    </div>
+    {{#each category in service.configCategories}}
+
+
+    {{#view App.ServiceConfigsByCategoryView categoryBinding="category" serviceConfigsBinding="service.configs"}}
+    <div class="accordion-body collapse in">
+      <div class="accordion-inner">
+        <form class="form-horizontal">
+          {{#each view.categoryConfigs}}
+          <div {{bindAttr class="errorMessage:error: :control-group"}}>
+            <label class="control-label">{{displayName}}</label>
+
+            <div class="controls">
+              {{view viewClass serviceConfigBinding="this"}}
+            </div>
+          </div>
+          {{/each}}
+        </form>
+      </div>
+    </div>
+    {{/view}}
+    {{/each}}
+  </div>
+  {{/each}}
+
+
+</div>
+
+
 <div class="btn-area">
   <a class="btn pull-left" {{action back}}>&larr; Back</a>
   <a class="btn btn-success pull-right" {{action next}}>Next &rarr;</a>

+ 172 - 74
ambari-web/app/utils/db.js

@@ -19,11 +19,11 @@ var App = require('app');
 App.db = {};
 
 if (typeof Storage !== 'undefined') {
-  Storage.prototype.setObject = function(key,value) {
+  Storage.prototype.setObject = function (key, value) {
     this.setItem(key, JSON.stringify(value));
   }
 
-  Storage.prototype.getObject = function(key) {
+  Storage.prototype.getObject = function (key) {
     var value = this.getItem(key);
     return value && JSON.parse(value);
   }
@@ -36,88 +36,86 @@ if (typeof Storage !== 'undefined') {
   localStorage.getItem = function (key) {
     return this[key];
   }
-  window.localStorage.setObject = function(key, value) {
+  window.localStorage.setObject = function (key, value) {
     this[key] = value;
   };
-  window.localStorage.getObject = function(key, value) {
+  window.localStorage.getObject = function (key, value) {
     return this[key];
   };
 }
 
-App.db.cleanUp = function() {
+App.db.cleanUp = function () {
   console.log('TRACE: Entering db:cleanup function');
   App.db.data = {
-    'app' : {
-      'loginName' : '',
-      'authenticated' : false
+    'app': {
+      'loginName': '',
+      'authenticated': false
     }
-  }
-  localStorage.setObject('ambari',App.db.data);
+  };
+  localStorage.setObject('ambari', App.db.data);
 }
 
 // called whenever user logs in
-if(localStorage.getObject('ambari') == null) {
+if (localStorage.getObject('ambari') == null) {
   console.log('doing a cleanup');
   App.db.cleanUp();
 }
 
 
-
 /*
  * setter methods
  */
 
 
-
-App.db.setLoginName = function(name) {
+App.db.setLoginName = function (name) {
   console.log('TRACE: Entering db:setLoginName function');
   App.db.data = localStorage.getObject('ambari');
   App.db.data.app.loginName = name;
-  localStorage.setObject('ambari',App.db.data);
+  localStorage.setObject('ambari', App.db.data);
 }
 
 // that works incorrectly
-App.db.setUser = function(user) {
+App.db.setUser = function (user) {
   console.log('TRACE: Entering db:setUser function');
   App.db.data = localStorage.getObject('ambari');
   App.db.data.app.user = user;
-  localStorage.setObject('ambari',App.db.data);
+  localStorage.setObject('ambari', App.db.data);
 }
 
-App.db.setAuthenticated = function(authenticated) {
+App.db.setAuthenticated = function (authenticated) {
   console.log('TRACE: Entering db:setAuthenticated function');
 
   App.db.data = localStorage.getObject('ambari');
   console.log('present value of authentication is: ' + App.db.data.app.authenticated);
-  console.log('desired value of authentication is: ' + authenticated) ;
+  console.log('desired value of authentication is: ' + authenticated);
   App.db.data.app.authenticated = authenticated;
-  localStorage.setObject('ambari',App.db.data);
+  localStorage.setObject('ambari', App.db.data);
   App.db.data = localStorage.getObject('ambari');
   console.log('Now present value of authentication is: ' + App.db.data.app.authenticated);
 }
 
-App.db.setSection = function(section) {
+App.db.setSection = function (section) {
   console.log('TRACE: Entering db:setSection function');
   App.db.data = localStorage.getObject('ambari');
   var user = App.db.data.app.loginName;
-  if(App.db.data[user] == undefined) {
-    App.db.data[user] = {'name':user};
+  if (App.db.data[user] == undefined) {
+    App.db.data[user] = {'name': user};
   }
   if (App.db.data[user].ClusterName == undefined) {
     App.db.data[user].ClusterName = {};
   }
   App.db.data[user].section = section;
-  localStorage.setObject('ambari',App.db.data);
+  localStorage.setObject('ambari', App.db.data);
 }
 
 App.db.setInstallerCurrentStep = function (currentStep, completed) {
   console.log('TRACE: Entering db:setInstallerCurrentStep function');
   App.db.data = localStorage.getObject('ambari');
   var user = App.db.data.app.loginName;
-  if(App.db.data[user] == undefined) {
+  if (App.db.data[user] == undefined) {
     console.log('In data[user] condition');
-    App.db.data[user] = {'name':user};
-    console.log('value of data[user].name: '+ App.db.data[user].name);
+    App.db.data[user] = {'name': user};
+    console.log('value of data[user].name: ' + App.db.data[user].name);
   }
   if (App.db.data[user].Installer == undefined) {
     App.db.data[user].Installer = {};
@@ -125,16 +123,16 @@ App.db.setInstallerCurrentStep = function (currentStep, completed) {
   }
   App.db.data[user].Installer.currentStep = currentStep;
   App.db.data[user].Installer.completed = completed;
-  localStorage.setObject('ambari',App.db.data);
+  localStorage.setObject('ambari', App.db.data);
 }
 
-App.db.setClusterName = function(name) {
+App.db.setClusterName = function (name) {
   console.log('TRACE: Entering db:setClusterName function');
   App.db.data = localStorage.getObject('ambari');
   var user = App.db.data.app.loginName;
   // all information from Installer.ClusterName will be transferred to clusters[ClusterName] when app migrates from installer to main
-  if(App.db.data[user] == undefined) {
-    App.db.data[user] = {'name':user};
+  if (App.db.data[user] == undefined) {
+    App.db.data[user] = {'name': user};
   }
   if (App.db.data[user].clusters == undefined) {
     App.db.data[user].clusters = {};
@@ -144,49 +142,87 @@ App.db.setClusterName = function(name) {
     App.db.data[user].Installer = {};
   }
   App.db.data[user].Installer.ClusterName = name;
-  localStorage.setObject('ambari',App.db.data);
+  localStorage.setObject('ambari', App.db.data);
+}
+
+App.db.setAllHostNames = function (hostNames) {
+  console.log('TRACE: Entering db:setAllHostNames function');
+  App.db.data = localStorage.getObject('ambari');
+  var user = App.db.data.app.loginName;
+  if (App.db.data[user] == undefined) {
+    App.db.data[user] = {'name': user};
+  }
+  App.db.data[user].Installer.hostNames = hostNames;
+  localStorage.setObject('ambari', App.db.data);
 }
 
-App.db.setHosts = function(hostInfo) {
-	console.log('TRACE: Entering db:setHosts function');
+App.db.setHosts = function (hostInfo) {
+  console.log('TRACE: Entering db:setHosts function');
   App.db.data = localStorage.getObject('ambari');
   var user = App.db.data.app.loginName;
   if (App.db.data[user] == undefined) {
-    App.db.data[user] = {'name':user};
+    App.db.data[user] = {'name': user};
   }
   App.db.data[user].Installer.hostInfo = hostInfo;
-  localStorage.setObject('ambari',App.db.data);
+  localStorage.setObject('ambari', App.db.data);
+}
+
+App.db.setInstallType = function (installType) {
+  console.log('TRACE: Entering db:setInstallType function');
+  App.db.data = localStorage.getObject('ambari');
+  var user = App.db.data.app.loginName;
+  if (App.db.data[user] == undefined) {
+    App.db.data[user] = {'name': user};
+  }
+  App.db.data[user].Installer.installType = installType;
+  localStorage.setObject('ambari', App.db.data);
 }
 
-App.db.setSoftRepo = function(softRepo) {
-	console.log('TRACE: Entering db:setSoftRepo function');
-	App.db.data = localStorage.getObject('ambari');
-	var user = App.db.data.app.loginName;
-	if(App.db.data[user] == undefined) {
-		App.db.data[user] = {'name':user};
-	}
+App.db.setSoftRepo = function (softRepo) {
+  console.log('TRACE: Entering db:setSoftRepo function');
+  App.db.data = localStorage.getObject('ambari');
+  var user = App.db.data.app.loginName;
+  if (App.db.data[user] == undefined) {
+    App.db.data[user] = {'name': user};
+  }
   App.db.data[user].Installer.softRepo = softRepo;
-  localStorage.setObject('ambari',App.db.data);
+  localStorage.setObject('ambari', App.db.data);
+}
+
+App.db.setBootStatus = function(status) {
+  console.log('TRACE: Entering db:setService function');
+  App.db.data = localStorage.getObject('ambari');
+  var user = App.db.data.app.loginName;
+  App.db.data[user].Installer.bootStatus = status;
+  localStorage.setObject('ambari', App.db.data);
 }
 
-App.db.removeHosts = function(hostInfo) {
+App.db.removeHosts = function (hostInfo) {
   console.log('TRACE: Entering db:setSoftRepo function');
   var hostList = App.db.getHosts();
-  hostInfo.forEach(function(_hostInfo) {
+  hostInfo.forEach(function (_hostInfo) {
     var host = _hostInfo.hostName;
     delete hostList[host];
   });
   App.db.setHosts(hostList);
 }
 
-App.db.setSelectedServiceNames = function(serviceNames) {
+App.db.setService = function(serviceInfo) {
+  console.log('TRACE: Entering db:setService function');
+  App.db.data = localStorage.getObject('ambari');
+  var user = App.db.data.app.loginName;
+  App.db.data[user].Installer.serviceInfo = serviceInfo;
+  localStorage.setObject('ambari', App.db.data);
+}
+
+App.db.setSelectedServiceNames = function (serviceNames) {
   App.db.data = localStorage.getObject('ambari');
   var user = App.db.data.app.loginName;
   App.db.data[user].Installer.selectedServiceNames = serviceNames;
   localStorage.setObject('ambari', App.db.data);
 }
 
-App.db.setMasterComponentHosts = function(masterComponentHosts) {
+App.db.setMasterComponentHosts = function (masterComponentHosts) {
   App.db.data = localStorage.getObject('ambari');
   var user = App.db.data.app.loginName;
   App.db.data[user].Installer.masterComponentHosts = masterComponentHosts;
@@ -194,27 +230,40 @@ App.db.setMasterComponentHosts = function(masterComponentHosts) {
 }
 
 
-App.db.setHostSlaveComponents = function(hostSlaveComponents) {
+App.db.setHostSlaveComponents = function (hostSlaveComponents) {
   App.db.data = localStorage.getObject('ambari');
   var user = App.db.data.app.loginName;
   App.db.data[user].Installer.hostSlaveComponents = hostSlaveComponents;
   localStorage.setObject('ambari', App.db.data);
 }
 
-App.db.setSlaveComponentHosts = function(slaveComponentHosts) {
+App.db.setSlaveComponentHosts = function (slaveComponentHosts) {
   App.db.data = localStorage.getObject('ambari');
   var user = App.db.data.app.loginName;
   App.db.data[user].Installer.slaveComponentHosts = slaveComponentHosts;
   localStorage.setObject('ambari', App.db.data);
 }
 
-App.db.setServiceConfigProperties = function(configProperties) {
+App.db.setServiceConfigs = function(serviceConfigs) {
+  App.db.data = localStorage.getObject('ambari');
+  var user = App.db.data.app.loginName;
+  App.db.data[user].Installer.serviceConfigs = serviceConfigs;
+  localStorage.setObject('ambari', App.db.data);
+}
+
+App.db.setServiceConfigProperties = function (configProperties) {
   App.db.data = localStorage.getObject('ambari');
   var user = App.db.data.app.loginName;
   App.db.data[user].Installer.configProperties = configProperties;
   localStorage.setObject('ambari', App.db.data);
 }
 
+App.db.setClusterStatus = function (status) {
+  App.db.data = localStorage.getObject('ambari');
+  var user = App.db.data.app.loginName;
+  App.db.data[user].Installer.clusterStatus = status;
+  localStorage.setObject('ambari', App.db.data);
+}
 
 
 /*
@@ -222,98 +271,147 @@ App.db.setServiceConfigProperties = function(configProperties) {
  */
 
 // that works incorrectly
-App.db.getUser = function() {
+App.db.getUser = function () {
   console.log('TRACE: Entering db:getUser function');
   App.db.data = localStorage.getObject('ambari');
   return App.db.data.app.user;
 }
 
-App.db.getLoginName = function() {
+App.db.getLoginName = function () {
   console.log('Trace: Entering db:getLoginName function');
   App.db.data = localStorage.getObject('ambari');
   return App.db.data.app.loginName;
 }
 
-App.db.getAuthenticated = function() {
+App.db.getAuthenticated = function () {
   console.log('Trace: Entering db:getAuthenticated function');
   App.db.data = localStorage.getObject('ambari');
   return App.db.data.app.authenticated;
 }
 
-App.db.getSection = function() {
+App.db.getSection = function () {
   console.log('Trace: Entering db:getSection function');
   App.db.data = localStorage.getObject('ambari');
   var user = App.db.data.app.loginName
-  if(App.db.data[user] == undefined || App.db.data[user] == '') {
+  if (App.db.data[user] == undefined || App.db.data[user] == '') {
     return 0;
   }
   return App.db.data[user].section;
 }
 
-App.db.getClusterName = function() {
+App.db.getClusterName = function () {
   console.log('Trace: Entering db:getClusterName function');
   App.db.data = localStorage.getObject('ambari');
   var user = App.db.data.app.loginName;
-  if(user) {
+  if (user) {
     return App.db.data[user].Installer.ClusterName;
   }
 }
 
-App.db.getInstallerCurrentStep = function() {
+App.db.getInstallerCurrentStep = function () {
   console.log('Trace: Entering db:getInstallerCurrentStep function');
   App.db.data = localStorage.getObject('ambari');
   var user = App.db.data.app.loginName;
-  if(App.db.data[user] == undefined || App.db.data[user] == '') {
-     return 0;
+  if (App.db.data[user] == undefined || App.db.data[user] == '') {
+    return 0;
   }
   return App.db.data[user].Installer.currentStep;
-}
+},
+
+  App.db.getAllHostNames = function () {
+    console.log('TRACE: Entering db:getHostNames function');
+    App.db.data = localStorage.getObject('ambari');
+    var user = App.db.data.app.loginName;
+    return App.db.data[user].Installer.hostNames;
+  },
+
+  App.db.getInstallType = function () {
+    console.log('TRACE: Entering db:getHostNames function');
+    App.db.data = localStorage.getObject('ambari');
+    var user = App.db.data.app.loginName;
+    return App.db.data[user].Installer.installType;
+  },
+
+  App.db.getSoftRepo = function () {
+    console.log('TRACE: Entering db:getSoftRepo function');
+    App.db.data = localStorage.getObject('ambari');
+    var user = App.db.data.app.loginName;
+    return App.db.data[user].Installer.softRepo;
+  }
 
-App.db.isCompleted = function() {
+App.db.isCompleted = function () {
   App.db.data = localStorage.getObject('ambari');
   var user = App.db.data.app.loginName;
   return App.db.data[user].Installer.completed;
 }
 
-App.db.getHosts = function() {
-	console.log('TRACE: Entering db:getHosts function');
+App.db.getHosts = function () {
+  console.log('TRACE: Entering db:getHosts function');
   App.db.data = localStorage.getObject('ambari');
   var user = App.db.data.app.loginName;
-	if(App.db.data[user] == undefined || App.db.data[user] == '') {
-		console.log('ERROR: loginName required for storing host info');
-		return 0;
-	}
+  if (App.db.data[user] == undefined || App.db.data[user] == '') {
+    console.log('ERROR: loginName required for storing host info');
+    return 0;
+  }
   return App.db.data[user].Installer.hostInfo;
 }
 
-App.db.getSelectedServiceNames = function() {
+App.db.getBootStatus = function() {
+  console.log('TRACE: Entering db:setService function');
+  App.db.data = localStorage.getObject('ambari');
+  var user = App.db.data.app.loginName;
+  return App.db.data[user].Installer.bootStatus;
+}
+
+App.db.getService = function(serviceInfo) {
+  console.log('TRACE: Entering db:getService function');
+  App.db.data = localStorage.getObject('ambari');
+  var user = App.db.data.app.loginName;
+  return App.db.data[user].Installer.serviceInfo;
+}
+
+App.db.getSelectedServiceNames = function () {
   App.db.data = localStorage.getObject('ambari');
   var user = App.db.data.app.loginName;
   return App.db.data[user].Installer.selectedServiceNames;
 }
 
-App.db.getMasterComponentHosts = function() {
+App.db.getMasterComponentHosts = function () {
   App.db.data = localStorage.getObject('ambari');
   var user = App.db.data.app.loginName;
   return App.db.data[user].Installer.masterComponentHosts;
 }
 
-App.db.getHostSlaveComponents = function() {
+App.db.getHostSlaveComponents = function () {
   App.db.data = localStorage.getObject('ambari');
   var user = App.db.data.app.loginName;
   return App.db.data[user].Installer.hostSlaveComponents;
 }
 
-App.db.getSlaveComponentHosts = function() {
+App.db.getSlaveComponentHosts = function () {
   App.db.data = localStorage.getObject('ambari');
   var user = App.db.data.app.loginName;
   return App.db.data[user].Installer.slaveComponentHosts;
 }
 
-App.db.getServiceConfigProperties = function() {
+App.db.getServiceConfigs = function() {
+  App.db.data = localStorage.getObject('ambari');
+  var user = App.db.data.app.loginName;
+  return App.db.data[user].Installer.serviceConfigs;
+}
+
+App.db.getServiceConfigProperties = function () {
   App.db.data = localStorage.getObject('ambari');
   var user = App.db.data.app.loginName;
   return App.db.data[user].Installer.configProperties;
 }
 
+App.db.getClusterStatus = function() {
+  console.log('TRACE: Entering db:setService function');
+  App.db.data = localStorage.getObject('ambari');
+  var user = App.db.data.app.loginName;
+  return App.db.data[user].Installer.clusterStatus;
+}
+
+
 module.exports = App.db;

+ 13 - 1
ambari-web/app/views/installer/step1_view.js

@@ -22,8 +22,20 @@ var App = require('app');
 App.InstallerStep1View = Em.View.extend({
 
   templateName: require('templates/installer/step1'),
+
   didInsertElement: function () {
     $("[rel=popover]").popover({'placement': 'right', 'trigger': 'hover'});
-  }
+    var controller = this.get('controller');
+    controller.loadStep();
+
+  },
+
+  onError: function () {
+    if (this.get('controller.clusterNameError') !== '') {
+      return true;
+    } else {
+      return false;
+    }
+  }.property('controller.clusterNameError')
 
 });

+ 16 - 2
ambari-web/app/views/installer/step2_view.js

@@ -22,11 +22,25 @@ var App = require('app');
 App.InstallerStep2View = Em.View.extend({
 
   templateName: require('templates/installer/step2'),
+  hostNameErr: false,
 
   didInsertElement: function () {
     $("[rel=popover]").popover({'placement': 'right', 'trigger': 'hover'});
-    this.get('controller').navigateStep();
-  }
+    this.set('hostNameErr',false);
+    this.set('controller.passphraseMatchErr',false);
+    this.set('controller.sshKeyNullErr',false);
+    this.get('controller').loadStep();
+  },
+
+
+  onHostNameErr: function () {
+    if (this.get('controller.hostNameEmptyError') === false && this.get('controller.hostNameNotRequiredErr') === false && this.get('controller.hostNameErr') === false) {
+      this.set('hostNameErr',false);
+    } else {
+      this.set('hostNameErr',true);
+    }
+  }.observes('controller.hostNameEmptyError', 'controller.hostNameNotRequiredErr', 'controller.hostNameErr'),
+
 
 });
 

+ 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.navigateStep();
+    controller.loadStep();
   }
 
 });

+ 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.navigateStep();
+    controller.loadStep();
   }
 
 });

+ 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.navigateStep();
+    controller.loadStep();
   }
 
 });

+ 16 - 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.navigateStep();
+    controller.loadStep();
   }
 
 });
@@ -126,7 +126,11 @@ App.ServiceConfigTextArea = Ember.TextArea.extend(App.ServiceConfigPopoverSuppor
   serviceConfig: null,
   valueBinding: 'serviceConfig.value',
   rows: 4,
-  classNames: ['span6']
+  classNames: ['span6'],
+
+  disabled: function () {
+    return !this.get('serviceConfig.isEditable');
+  }.property('serviceConfig.isEditable')
 
 });
 
@@ -137,7 +141,11 @@ App.ServiceConfigBigTextArea = App.ServiceConfigTextArea.extend({
 App.ServiceConfigCheckbox = Ember.Checkbox.extend(App.ServiceConfigPopoverSupport, {
 
   serviceConfig: null,
-  checkedBinding: 'serviceConfig.value'
+  checkedBinding: 'serviceConfig.value',
+
+  disabled: function () {
+    return !this.get('serviceConfig.isEditable');
+  }.property('serviceConfig.isEditable')
 
 });
 
@@ -202,7 +210,11 @@ App.ServiceConfigSlaveHostsView = Ember.View.extend(App.ServiceConfigMultipleHos
   templateName: require('templates/installer/slave_hosts'),
 
   controllerBinding: 'App.router.slaveComponentGroupsController',
-  valueBinding: 'App.router.slaveComponentGroupsController.hosts'
+  valueBinding: 'App.router.slaveComponentGroupsController.hosts',
+
+  disabled: function () {
+    return !this.get('serviceConfig.isEditable');
+  }.property('serviceConfig.isEditable')
 
 });
 

+ 7 - 2
ambari-web/app/views/installer/step8_view.js

@@ -25,8 +25,13 @@ App.InstallerStep8View = Em.View.extend({
 
   didInsertElement: function () {
     var controller = this.get('controller');
-    controller.navigateStep();
-  }
+    console.log('***^^^****2 over here*****^^^^*******');
+    controller.loadStep();
+    //this.doConfigsUneditable();
+  },
+
+  doConfigsUneditable: function() {
 
+  }
 
 });

+ 1 - 4
ambari-web/test/installer/step1_test.js

@@ -40,15 +40,12 @@ describe('App.InstallerStep1Controller', function () {
       expect(controller.validateStep1()).to.equal(false);
       expect(controller.get('invalidClusterName')).to.equal(true);
     })
-    it('should return true, sets invalidClusterName to false, and sets cluster name in db if cluster name is valid', function () {
+    it('should return true, sets invalidClusterName to false if cluster name is valid', function () {
       var controller = App.InstallerStep1Controller.create();
       var clusterName = 'mycluster1';
       controller.set('clusterName', clusterName);
-      // fake login so clusterName is properly retrieved from App.db
-      App.db.setLoginName('myuser');
       expect(controller.validateStep1()).to.equal(true);
       expect(controller.get('invalidClusterName')).to.equal(false);
-      expect(App.db.getClusterName()).to.equal(clusterName);
     })
   })