incubator-ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yus...@apache.org
Subject svn commit: r1418960 [5/6] - in /incubator/ambari/branches/AMBARI-666/ambari-web/app: ./ assets/data/apps/jobs/ assets/data/dashboard/mapreduce/ assets/data/hosts/ controllers/ controllers/main/admin/ controllers/main/charts/heatmap_metrics/ controller...
Date Sun, 09 Dec 2012 14:00:38 GMT
Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/service/add_controller.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/service/add_controller.js?rev=1418960&r1=1418959&r2=1418960&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/service/add_controller.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/service/add_controller.js Sun Dec  9 14:00:34 2012
@@ -43,7 +43,8 @@ App.AddServiceController = Em.Controller
     masterComponentHosts: null,
     serviceConfigProperties: null,
     advancedServiceConfig: null,
-    controllerName: 'addServiceController'
+    controllerName: 'addServiceController',
+    isWizard: true
   }),
 
   /**
@@ -166,16 +167,31 @@ App.AddServiceController = Em.Controller
    * Load clusterInfo(step1) to model
    */
   loadClusterInfo: function(){
-    var cluster = {
-      name: App.router.getClusterName(),
-      status: "",
-      isCompleted: true
-    };
+    var cluster = App.db.getClusterStatus();
+    if(!cluster){
+      cluster = {
+        name: App.router.getClusterName(),
+        status: "",
+        isCompleted: false
+      };
+      App.db.setClusterStatus(cluster);
+    }
     this.set('content.cluster', cluster);
     console.log("AddServiceController:loadClusterInfo: loaded data ", cluster);
   },
 
   /**
+   * save status of the cluster. This is called from step8 and step9 to persist install and start requestId
+   * @param clusterStatus object with status, isCompleted, requestId, isInstallError and isStartError field.
+   */
+  saveClusterStatus: function (clusterStatus) {
+    clusterStatus.name = this.get('content.cluster.name');
+    this.set('content.cluster', clusterStatus);
+    console.log('called saveClusterStatus ' + JSON.stringify(clusterStatus));
+    App.db.setClusterStatus(clusterStatus);
+  },
+
+  /**
    * Temporary function for wizardStep9, before back-end integration
    */
   setInfoForStep9: function () {
@@ -441,19 +457,29 @@ App.AddServiceController = Em.Controller
       var service = services.findProperty('id', comp.service);
       var hosts = [];
 
-      service.get('hostComponents').filterProperty('componentName', comp.name).forEach(function (host_component) {
+      if(!service){
+        service = services.findProperty('id', 'HDFS');
+        service.get('hostComponents').filterProperty('componentName', 'DATANODE').forEach(function (host_component) {
+          hosts.push({
+            group: "Default",
+            hostName: host_component.get('host.id'),
+            isInstalled: false
+          });
+        }, this);
+      } else {
+        service.get('hostComponents').filterProperty('componentName', comp.name).forEach(function (host_component) {
           hosts.push({
             group: "Default",
             hostName: host_component.get('host.id'),
             isInstalled: true
           });
-      }, this);
+        }, this);
+      }
 
       result.push({
         componentName: comp.name,
         displayName: App.format.role(comp.name),
-        hosts: hosts,
-        isInstalled: true
+        hosts: hosts
       })
     }
 
@@ -471,8 +497,7 @@ App.AddServiceController = Em.Controller
     result.push({
       componentName: 'CLIENT',
       displayName: 'client',
-      hosts: hosts,
-      isInstalled: true
+      hosts: hosts
     })
 
     return result;
@@ -658,7 +683,7 @@ App.AddServiceController = Em.Controller
             isCompleted: false,
             installStartTime: installSartTime
           };
-          //self.saveClusterStatus(clusterStatus);
+          self.saveClusterStatus(clusterStatus);
         } else {
           console.log('ERROR: Error occurred in parsing JSON data');
         }
@@ -674,7 +699,7 @@ App.AddServiceController = Em.Controller
           isInstallError: true,
           isCompleted: false
         };
-        //self.saveClusterStatus(clusterStatus);
+        self.saveClusterStatus(clusterStatus);
       },
 
       statusCode: require('data/statusCodes')
@@ -700,6 +725,7 @@ App.AddServiceController = Em.Controller
     App.db.setHosts(undefined);
     App.db.setMasterComponentHosts(undefined);
     App.db.setSlaveComponentHosts(undefined);
+    App.db.setClusterStatus(undefined);
   }
 
 });

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/service/info/configs.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/service/info/configs.js?rev=1418960&r1=1418959&r2=1418960&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/service/info/configs.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/service/info/configs.js Sun Dec  9 14:00:34 2012
@@ -23,14 +23,21 @@ App.MainServiceInfoConfigsController = E
   name: 'mainServiceInfoConfigsController',
   stepConfigs: [], //contains all field properties that are viewed in this service
   selectedService: null,
+  serviceConfigTags: null,
+  globalConfigs: [],
+  uiConfigs: [],
+  isApplyingChanges: false,
   serviceConfigs: require('data/service_configs'),
+  configs: require('data/config_properties').configProperties,
+  configMapping: require('data/config_mapping'),
+  customConfigs: require('data/custom_configs'),
 
   isSubmitDisabled: function () {
-    return !this.stepConfigs.everyProperty('errorCount', 0);
-  }.property('stepConfigs.@each.errorCount'),
+    return (!(this.stepConfigs.everyProperty('errorCount', 0)) || this.get('isApplyingChanges'));
+  }.property('stepConfigs.@each.errorCount', 'isApplyingChanges'),
 
-  slaveComponentHosts : function(){
-    if(!this.get('content')){
+  slaveComponentHosts: function () {
+    if (!this.get('content')) {
       return;
     }
     console.log('slaveComponentHosts', App.db.getSlaveComponentHosts());
@@ -39,11 +46,13 @@ App.MainServiceInfoConfigsController = E
 
   clearStep: function () {
     this.get('stepConfigs').clear();
+    this.get('globalConfigs').clear();
+    if (this.get('serviceConfigTags')) {
+      this.set('serviceConfigTags', null);
+    }
   },
 
-  serviceConfigProperties: function() {
-    console.log('serviceConfigProperties');
-    console.log(App.db.getServiceConfigProperties());
+  serviceConfigProperties: function () {
     return App.db.getServiceConfigProperties();
   }.property('content'),
 
@@ -52,34 +61,204 @@ App.MainServiceInfoConfigsController = E
    */
   loadStep: function () {
     console.log("TRACE: Loading configure for service");
-
     this.clearStep();
-    this.renderServiceConfigs(this.serviceConfigs);
+    //STEP 1: set the present state of the service Properties. State depends on array of: unique combination of type(ex. core-site) and tag (ex. version01) derived from serviceInfo desired_state
+    this.setServciceConfigs();
+    //STEP 2: Create an array of objects defining tagnames to be polled and new tagnames to be set after submit
+    this.setServiceTagNames();
+    //STEP 3: Set globalConfigs and Get an array of serviceProperty objects
+    var serviceConfigs = this.getSitesConfigProperties();
+    //STEP 4: Remove properties mentioned in configMapping from serviceConfig
+    this.get('configMapping').forEach(function (_configs) {
+
+    }, this)
+    //STEP 5: Add the advanced configs to the serviceConfigs property
+
+    var advancedConfig = App.router.get('installerController').loadAdvancedConfig(this.get('content.serviceName'));
+    var service = this.get('serviceConfigs').findProperty('serviceName', this.get('content.serviceName'));
+    advancedConfig.forEach(function (_config) {
+      if (service) {
+        if (!this.get('configMapping').someProperty('name', _config.name)) {
+          if (service.configs.someProperty('name', _config.name)) {
+            service.configs.findProperty('name', _config.name).description = _config.description;
+          } else {
+            _config.id = "site property";
+            _config.category = 'Advanced';
+            _config.displayName = _config.name;
+            _config.defaultValue = _config.value;
+            if (/\${.*}/.test(_config.value) || (service.serviceName !== 'OOZIE' && service.serviceName !== 'HBASE')) {
+              _config.isRequired = false;
+              _config.value = '';
+            } else if (/^\s+$/.test(_config.value)) {
+              _config.isRequired = false;
+            }
+            _config.isVisible = true;
+            _config.displayType = 'advanced';
+            service.configs.pushObject(_config);
+          }
+        }
+      }
+    }, this);
+    this.loadCustomConfig();
 
-    var storedServices = this.get('serviceConfigProperties');
-    if (storedServices) {
-      var configs = new Ember.Set();
-
-      // for all services`
-      this.get('stepConfigs').forEach(function (_content) {
-        //for all components
-        _content.get('configs').forEach(function (_config) {
-
-          var componentVal = storedServices.findProperty('name', _config.get('name'));
-          //if we have config for specified component
-          if(componentVal){
+    this.renderServiceConfigs(this.get('serviceConfigs'));
 
-            //set it
-            _config.set('value', componentVal.value)
-          }
+    console.log('---------------------------------------');
 
-        }, this);
+
+  },
+
+  /**
+   * Get configuration for the *-site.xml
+   */
+  setServciceConfigs: function () {
+    var self = this;
+    var url = App.apiPrefix + '/clusters/' + App.router.getClusterName() + '/services/' + this.get('content.serviceName');
+    $.ajax({
+      type: 'GET',
+      url: url,
+      async: false,
+      timeout: 10000,
+      dataType: 'text',
+      success: function (data) {
+        console.log("TRACE: In success function for the GET getServciceConfigs call");
+        console.log("TRACE: The url is: " + url);
+        var jsonData = jQuery.parseJSON(data);
+        self.set('serviceConfigTags', jQuery.parseJSON(jsonData.ServiceInfo.desired_configs));
+      },
+
+      error: function (request, ajaxOptions, error) {
+        console.log("TRACE: In error function for the getServciceConfigs call");
+        console.log("TRACE: value of the url is: " + url);
+        console.log("TRACE: error code status is: " + request.status);
+
+      },
+
+      statusCode: require('data/statusCodes')
+    });
+  },
+
+  /**
+   * set tagnames for configuration of the *-site.xml
+   */
+  setServiceTagNames: function () {
+    console.log("TRACE: In setServiceTagNames function:");
+    var newServiceConfigTags = [];
+    var serviceConfigTags = this.get('serviceConfigTags');
+    var time = new Date().getMilliseconds();
+    console.log("The value of time is: " + time);
+    for (var index in serviceConfigTags) {
+      console.log("The value of serviceConfigTags[index]: " + serviceConfigTags[index]);
+      newServiceConfigTags.pushObject({
+        siteName: index,
+        tagName: serviceConfigTags[index],
+        newTagName: serviceConfigTags[index] + time
       }, this);
     }
+    this.set('serviceConfigTags', newServiceConfigTags);
+  },
 
-    console.log('---------------------------------------');
-    console.log(this.get('stepConfigs'));
+  /**
+   * Render a custom conf-site box for entering properties that will be written in *-site.xml files of the services
+   */
+  loadCustomConfig: function () {
+    var serviceConfig = this.get('serviceConfigs').findProperty('serviceName', this.get('content.serviceName'));
+    var customConfig = this.get('customConfigs').findProperty('serviceName', this.get('content.serviceName'));
+    serviceConfig.configs.pushObject(customConfig);
+  },
+
+  /**
+   * load the configs from the server
+   */
 
+  getSitesConfigProperties: function () {
+    var serviceConfigs = [];
+    var globalConfigs = [];
+    var localServiceConfigs = this.get('serviceConfigs').findProperty('serviceName', this.get('content.serviceName'));
+
+    this.get('serviceConfigTags').forEach(function (_tag) {
+      var properties = this.getSiteConfigProperties(_tag.siteName, _tag.tagName);
+      for (var index in properties) {
+        var serviceConfigObj = {
+          name: index,
+          value: properties[index],
+          defaultValue: properties[index],
+          filename: _tag.siteName + ".xml",
+          isVisible: true,
+          isRequired: true
+        };
+        if (_tag.siteName === 'global') {
+          if (localServiceConfigs.configs.someProperty('name', index)) {
+            var item = localServiceConfigs.configs.findProperty('name', index);
+            item.value = properties[index];
+            item.defaultValue = properties[index];
+            if (item.displayType === 'int') {
+              if (/\d+m$/.test(item.value)) {
+                item.value = item.value.slice(0, item.value.length - 1);
+                item.defaultValue = item.value;
+              }
+            }
+            if (item.displayType === 'checkbox') {
+              switch (item.value) {
+                case 'true' :
+                  item.value = true;
+                  break;
+                case 'false' :
+                  item.value = false;
+                  break;
+              }
+            }
+          }
+          serviceConfigObj.id = 'puppet var';
+          serviceConfigObj.serviceName = this.get('configs').someProperty('name', index) ? this.get('configs').findProperty('name', index).serviceName : null;
+          serviceConfigObj.category = this.get('configs').someProperty('name', index) ? this.get('configs').findProperty('name', index).category : null;
+          globalConfigs.pushObject(serviceConfigObj);
+        } else if (!this.get('configMapping').someProperty('name', index)) {
+          if (_tag.siteName !== localServiceConfigs.filename) {
+            serviceConfigObj.isVisible = false;
+          }
+          serviceConfigObj.id = 'site property';
+          serviceConfigObj.serviceName = this.get('content.serviceName');
+          serviceConfigObj.category = 'Advanced';
+          serviceConfigObj.displayName = index;
+          serviceConfigObj.displayType = 'advanced';
+          localServiceConfigs.configs.pushObject(serviceConfigObj);
+        }
+        serviceConfigs.pushObject(serviceConfigObj);
+      }
+    }, this);
+    this.set('globalConfigs', globalConfigs);
+    return serviceConfigs;
+  },
+
+  getSiteConfigProperties: function (sitename, tagname) {
+    var self = this;
+    var properties = {};
+    var url = App.apiPrefix + '/clusters/' + App.router.getClusterName() + '/configurations/?type=' + sitename + '&tag=' + tagname;
+    $.ajax({
+      type: 'GET',
+      url: url,
+      async: false,
+      timeout: 10000,
+      dataType: 'json',
+      success: function (data) {
+        console.log("TRACE: In success function for the GET getSiteConfigProperties call");
+        console.log("TRACE: The url is: " + url);
+        properties = data.items.findProperty('tag', tagname).properties;
+
+        console.log("The value of config properties is: " + properties);
+      },
+
+      error: function (request, ajaxOptions, error) {
+        console.log("TRACE: In error function for the getServciceConfigs call");
+        console.log("TRACE: value of the url is: " + url);
+        console.log("TRACE: error code status is: " + request.status);
+
+      },
+
+      statusCode: require('data/statusCodes')
+    });
+    return properties;
   },
 
   /**
@@ -89,6 +268,7 @@ App.MainServiceInfoConfigsController = E
   renderServiceConfigs: function (serviceConfigs) {
     serviceConfigs.forEach(function (_serviceConfig) {
       var serviceConfig = App.ServiceConfig.create({
+        filename: _serviceConfig.filename,
         serviceName: _serviceConfig.serviceName,
         displayName: _serviceConfig.displayName,
         configCategories: _serviceConfig.configCategories,
@@ -118,35 +298,653 @@ App.MainServiceInfoConfigsController = E
     _componentConfig.configs.forEach(function (_serviceConfigProperty) {
       var serviceConfigProperty = App.ServiceConfigProperty.create(_serviceConfigProperty);
       serviceConfigProperty.serviceConfig = componentConfig;
-      serviceConfigProperty.initialValue();
+      this.initialValue(serviceConfigProperty);
       componentConfig.configs.pushObject(serviceConfigProperty);
       serviceConfigProperty.validate();
     }, this);
   },
 
+  restartServicePopup: function (event) {
+    console.log("Enered the entry pointttt");
+    var self = this;
+    var result;
+    console.log('I am over hererererere: ' + this.get('content.healthStatus'));
+    if (this.get('isApplyingChanges') === true) {
+      return;
+    }
+    App.ModalPopup.show({
+      header: 'Restart ' + self.get('content.serviceName'),
+      primary: 'Restart',
+      onPrimary: function () {
+        self.restartService();
+        this.hide();
+      },
+      onSecondary: function () {
+        this.hide();
+      },
+      bodyClass: Ember.View.extend({
+        template: Ember.Handlebars.compile(['<p>Restart the service</p>'].join('\n'))
+      })
+    });
+  },
+
+  restartService: function () {
+    console.log("In restart servicesssss");
+    this.set('isApplyingChanges', true);
+    this.get('serviceConfigTags').forEach(function (_tag) {
+      _tag.newTagName = _tag.newTagName + new Date().getMilliseconds();
+    }, this);
+
+    //Step 1: Stop the service
+
+    if (this.stopService()) {
+      this.doPolling('stop', function () {
+        this.applyConfigurations();
+      }, function () {
+        this.failuresInStop();
+      });
+    } else {
+      this.failuresInStop();
+    }
+  },
+
+  failuresInStop: function () {
+    console.log("Step 1 faliure");
+    this.msgPopup('Restart ' + this.get('content.serviceName'), 'Failed to stop the service');
+    this.set('isApplyingChanges', false);
+  },
+
+  applyConfigurations: function () {
+    if (App.testMode === true) {
+      result = true
+    } else {
+      var result = this.saveServiceConfigProperties();
+    }
+
+    if (result === false) {
+      console.log("Step2 failure");
+      this.msgPopup('Restart ' + this.get('content.serviceName'), 'Failed to apply configs. Start the service again with last configurations', this.startServiceWrapper);
+    } else {
+      if (this.startService()) {
+        this.doPolling('start', function () {
+          this.msgPopup('Restart ' + this.get('content.serviceName'), 'Restarted the service successfully with new configurations');
+          this.set('isApplyingChanges', false);
+        }, function () {
+          // this.rollBackPopup('Configs applied but failures encountered during starting/checking service. Do you want to rollback to the last service configuration and restart the service.');
+          console.log("Configs applied but failures encountered during starting/checking service.");
+        });
+      } else {
+        this.msgPopup('Restart ' + this.get('content.serviceName'), 'Failed to start the service');
+        this.set('isApplyingChanges', false);
+      }
+      console.log("Error in start service API");
+    }
+  },
+
+  startServiceWrapper: function () {
+    if (this.startService()) {
+      this.doPolling('start', function () {
+        this.msgPopup('Restart ' + this.get('content.serviceName'), 'Started the service with the last known configuration.');
+        this.set('isApplyingChanges', false);
+      }, function () {
+        this.msgPopup('Restart ' + this.get('content.serviceName'), 'Started the service with the last known configuration.');
+        this.set('isApplyingChanges', false);
+      });
+    } else {
+      this.msgPopup('Restart ' + this.get('content.serviceName'), 'Started the service with the last known configuration.');
+      this.set('isApplyingChanges', false);
+    }
+  },
+
+
+  rollBack: function () {
+    var result;
+    //STEP 1: Apply the last known configuration
+    result = this.applyCreatedConfToService('previous');
+    //CASE 1: failure for rollback
+    if (result === false) {
+      console.log("rollback1 faliure");
+      this.msgPopup('Restart ' + this.get('content.serviceName'), 'Failed to rolled back to the last known configuration');
+    } else {
+      //STEP 2: start the service
+      if (this.startService()) {
+        this.doPolling('start', function () {
+          this.msgPopup('Restart ' + this.get('content.serviceName'), 'Successfully rolled back to the last known configuration');
+          this.set('isApplyingChanges', false);
+        }, function () {
+          this.msgPopup('Restart ' + this.get('content.serviceName'), 'Rolled back to the last configuration but failed to start the service with the rolled back configuration');
+          this.set('isApplyingChanges', false);
+        });
+      } else {
+        this.msgPopup('Restart ' + this.get('content.serviceName'), 'Rolled back to the last configuration but failed to start the service with the rolled back configuration');
+        this.set('isApplyingChanges', false);
+      }
+    }
+  },
+
+  startService: function () {
+    var self = this;
+    var clusterName = App.router.getClusterName();
+    var url = App.apiPrefix + '/clusters/' + clusterName + '/services/' + this.get('content.serviceName');
+    var method = (App.testMode) ? 'GET' : 'PUT';
+    var data = '{"ServiceInfo": {"state": "STARTED"}}';
+    var result;
+    $.ajax({
+      type: method,
+      url: url,
+      data: data,
+      async: false,
+      dataType: 'text',
+      timeout: 5000,
+      success: function (data) {
+        var jsonData = jQuery.parseJSON(data);
+        console.log("TRACE: In success function for the startService call");
+        console.log("TRACE: value of the url is: " + url);
+        result = true;
+      },
+
+      error: function (request, ajaxOptions, error) {
+        console.log("TRACE: In error function for the startService call");
+        console.log("TRACE: value of the url is: " + url);
+        console.log("TRACE: error code status is: " + request.status);
+
+        result = (App.testMode) ? true : false;
+
+      },
+
+      statusCode: require('data/statusCodes')
+    });
+    return result;
+  },
+
+  msgPopup: function (header, message, callback) {
+    var self = this;
+    var result;
+
+    App.ModalPopup.show({
+      header: 'Restart ' + self.get('content.serviceName'),
+      secondary: false,
+      onPrimary: function () {
+        if (callback !== undefined) {
+          callback();
+        }
+        this.hide();
+      },
+      bodyClass: Ember.View.extend({
+        template: Ember.Handlebars.compile(['<p>{{view.message}}</p>'].join('\n')),
+        message: message
+      })
+    });
+  },
+
+  rollBackPopup: function (message) {
+    var self = this;
+    var result;
+
+    App.ModalPopup.show({
+      header: 'Restart ' + self.get('content.serviceName'),
+      primary: 'Yes',
+      secondary: 'No',
+      onPrimary: function () {
+        self.rollBack();
+        this.hide();
+      },
+      bodyClass: Ember.View.extend({
+        template: Ember.Handlebars.compile(['<p>{{view.message}}</p>'].join('\n')),
+        message: message
+      })
+    });
+  },
+
+  stopService: function () {
+    var self = this;
+    var clusterName = App.router.getClusterName();
+    var url = App.apiPrefix + '/clusters/' + clusterName + '/services/' + this.get('content.serviceName');
+    var method = (App.testMode) ? 'GET' : 'PUT';
+    var data = '{"ServiceInfo": {"state": "INSTALLED"}}';
+    var result;
+    $.ajax({
+      type: method,
+      url: url,
+      data: data,
+      async: false,
+      dataType: 'text',
+      timeout: 5000,
+      success: function (data) {
+        var jsonData = jQuery.parseJSON(data);
+        console.log("TRACE: In success function for the stopService call");
+        console.log("TRACE: value of the url is: " + url);
+        result = true;
+      },
+
+      error: function (request, ajaxOptions, error) {
+        console.log("TRACE: STep8 -> In error function for the stopService call");
+        console.log("TRACE: STep8 -> value of the url is: " + url);
+        console.log("TRACE: STep8 -> error code status is: " + request.status);
+        result = (App.testMode) ? true : false;
+      },
+
+      statusCode: require('data/statusCodes')
+    });
+    return result;
+  },
+
   /**
    * Save config properties
    */
   saveServiceConfigProperties: function () {
-    var serviceConfigProperties = [];
-    this.get('stepConfigs').forEach(function (_content) {
-      _content.get('configs').forEach(function (_configProperties) {
-        var configProperty = {
-          name: _configProperties.get('name'),
-          value: _configProperties.get('value'),
-          service: _configProperties.get('serviceName')
-        };
-        serviceConfigProperties.push(configProperty);
+    var result = false;
+    var configs = this.get('stepConfigs').findProperty('serviceName', this.get('content.serviceName')).get('configs');
+    this.saveGlobalConfigs(configs);
+    this.saveSiteConfigs(configs);
+    this.setCustomConfigs();
+    var result = this.createConfigurations();
+    if (result === true) {
+      result = this.applyCreatedConfToService('new');
+    }
+    console.log("The result from applyCreatdConfToService is: " + result);
+    return result;
+  },
+
+  saveGlobalConfigs: function (configs) {
+    var globalConfigs = this.get('globalConfigs');
+    configs.filterProperty('id', 'puppet var').forEach(function (_config) {
+      if (globalConfigs.someProperty('name', _config.name)) {
+        globalConfigs.findProperty('name', _config.name).value = _config.value;
+      } else {
+        globalConfigs.pushObject({
+          name: _config.name,
+          value: _config.value
+        });
+      }
+    }, this);
+    this.set('globalConfigs', globalConfigs);
+  },
+
+  saveSiteConfigs: function (configs) {
+    var storedConfigs = this.get('stepConfigs').filterProperty('id', 'site property').filterProperty('value');
+    var uiConfigs = this.loadUiSideConfigs();
+    this.set('uiConfigs', storedConfigs.concat(uiConfigs));
+  },
+
+  loadUiSideConfigs: function () {
+    var uiConfig = [];
+    var configs = this.get('configMapping').filterProperty('foreignKey', null);
+    configs.forEach(function (_config) {
+      var value = this.getGlobConfigValue(_config.templateName, _config.value);
+      uiConfig.pushObject({
+        "id": "site property",
+        "name": _config.name,
+        "value": value,
+        "filename": _config.filename
+      });
+    }, this);
+    var dependentConfig = this.get('configMapping').filterProperty('foreignKey');
+    dependentConfig.forEach(function (_config) {
+      this.setConfigValue(uiConfig, _config);
+      uiConfig.pushObject({
+        "id": "site property",
+        "name": _config.name,
+        "value": _config.value,
+        "filename": _config.filename
+      });
+    }, this);
+    return uiConfig;
+  },
+  /**
+   * Set all site property that are derived from other puppet-variable
+   */
+
+  getGlobConfigValue: function (templateName, expression) {
+    var express = expression.match(/<(.*?)>/g);
+    var value = expression;
+    if (express == null) {
+      return expression;
+    }
+    express.forEach(function (_express) {
+      //console.log("The value of template is: " + _express);
+      var index = parseInt(_express.match(/\[([\d]*)(?=\])/)[1]);
+      if (this.get('globalConfigs').someProperty('name', templateName[index])) {
+        //console.log("The name of the variable is: " + this.get('content.serviceConfigProperties').findProperty('name', templateName[index]).name);
+        var globValue = this.get('globalConfigs').findProperty('name', templateName[index]).value;
+        value = value.replace(_express, globValue);
+      } else {
+        /*
+         console.log("ERROR: The variable name is: " + templateName[index]);
+         console.log("ERROR: mapped config from configMapping file has no corresponding variable in " +
+         "content.serviceConfigProperties. Two possible reasons for the error could be: 1) The service is not selected. " +
+         "and/OR 2) The service_config metadata file has no corresponding global var for the site property variable");
+         */
+        value = null;
+      }
+    }, this);
+    return value;
+  },
+  /**
+   * Set all site property that are derived from other site-properties
+   */
+  setConfigValue: function (uiConfig, config) {
+    var fkValue = config.value.match(/<(foreignKey.*?)>/g);
+    if (fkValue) {
+      fkValue.forEach(function (_fkValue) {
+        var index = parseInt(_fkValue.match(/\[([\d]*)(?=\])/)[1]);
+        if (uiConfig.someProperty('name', config.foreignKey[index])) {
+          var globalValue = uiConfig.findProperty('name', config.foreignKey[index]).value;
+          config.value = config.value.replace(_fkValue, globalValue);
+        } else if (this.get('stepConfigs').someProperty('name', config.foreignKey[index])) {
+          var globalValue;
+          if (this.get('stepConfigs').findProperty('name', config.foreignKey[index]).value === '') {
+            globalValue = this.get('stepConfigs').findProperty('name', config.foreignKey[index]).defaultValue;
+          } else {
+            globalValue = this.get('stepConfigs').findProperty('name', config.foreignKey[index]).value;
+          }
+          config.value = config.value.replace(_fkValue, globalValue);
+        }
+      }, this);
+    }
+    if (fkValue = config.name.match(/<(foreignKey.*?)>/g)) {
+      fkValue.forEach(function (_fkValue) {
+        var index = parseInt(_fkValue.match(/\[([\d]*)(?=\])/)[1]);
+        if (uiConfig.someProperty('name', config.foreignKey[index])) {
+          var globalValue = uiConfig.findProperty('name', config.foreignKey[index]).value;
+          config.name = config.name.replace(_fkValue, globalValue);
+        } else if (this.get('stepConfigs').someProperty('name', config.foreignKey[index])) {
+          var globalValue;
+          if (this.get('stepConfigs').findProperty('name', config.foreignKey[index]).value === '') {
+            globalValue = this.get('stepConfigs').findProperty('name', config.foreignKey[index]).defaultValue;
+          } else {
+            globalValue = this.get('stepConfigs').findProperty('name', config.foreignKey[index]).value;
+          }
+          config.name = config.name.replace(_fkValue, globalValue);
+        }
+      }, this);
+    }
+    //For properties in the configMapping file having foreignKey and templateName properties.
+    var templateValue = config.value.match(/<(templateName.*?)>/g);
+    if (templateValue) {
+      templateValue.forEach(function (_value) {
+        var index = parseInt(_value.match(/\[([\d]*)(?=\])/)[1]);
+        if (this.get('globalConfigs').someProperty('name', config.templateName[index])) {
+          var globalValue = this.get('globalConfigs').findProperty('name', config.templateName[index]).value;
+          config.value = config.value.replace(_value, globalValue);
+        }
       }, this);
+    }
+  },
+  createConfigurations: function () {
+    var result = true;
+    var serviceConfigTags = this.get('serviceConfigTags');
+    serviceConfigTags.forEach(function (_serviceTags) {
+      if (_serviceTags.siteName === 'global') {
+        console.log("TRACE: Inside globalssss");
+        result = this.createConfigSite(this.createGlobalSiteObj(_serviceTags.newTagName));
+      } else if (_serviceTags.siteName === 'core-site') {
+        console.log("TRACE: Inside core-site");
+        result = this.createConfigSite(this.createCoreSiteObj(_serviceTags.newTagName));
+      } else {
+        result = this.createConfigSite(this.createSiteObj(_serviceTags.siteName, _serviceTags.newTagName));
+      }
+      if (result === false) {
+        return false;
+      }
+    }, this);
+    return true;
+  },
+
+  createConfigSite: function (data) {
+    var result;
+    var realData = data;
+    console.log("Inside createConfigSite");
+    var clusterName = App.router.getClusterName();
+    var url = App.apiPrefix + '/clusters/' + clusterName + '/configurations';
+    $.ajax({
+      type: 'POST',
+      url: url,
+      data: JSON.stringify(data),
+      async: false,
+      dataType: 'text',
+      timeout: 5000,
+      success: function (data) {
+        var jsonData = jQuery.parseJSON(data);
+        result = true;
+        console.log("TRACE: In success function for the createConfigSite");
+        console.log("TRACE: value of the url is: " + url);
+        console.log("TRACE: value of the received data is: " + jsonData);
+      },
+
+      error: function (request, ajaxOptions, error) {
+        result = false;
+        console.log('TRACE: In Error ');
+        console.log("The original data was: " + JSON.stringify(realData));
+        console.log('TRACE: Error message is: ' + request.responseText);
+        console.log("TRACE: value of the url is: " + url);
+      },
+
+      statusCode: require('data/statusCodes')
+    });
+    console.log("Exiting createConfigSite");
+    console.log("Value of result is: " + result);
+    return result;
+  },
+
+  createGlobalSiteObj: function (tagName) {
+    var globalSiteProperties = {};
+    this.get('globalConfigs').forEach(function (_globalSiteObj) {
+      // do not pass any globalConfigs whose name ends with _host or _hosts
+      if (!/_hosts?$/.test(_globalSiteObj.name)) {
+        // append "m" to JVM memory options
+        if (/_heapsize|_newsize|_maxnewsize$/.test(_globalSiteObj.name)) {
+          _globalSiteObj.value += "m";
+        }
+        globalSiteProperties[_globalSiteObj.name] = _globalSiteObj.value;
+        //console.log("TRACE: name of the global property is: " + _globalSiteObj.name);
+        //console.log("TRACE: value of the global property is: " + _globalSiteObj.value);
+      }
+    }, this);
+    return {"type": "global", "tag": tagName, "properties": globalSiteProperties};
+  },
+
+  createCoreSiteObj: function (tagName) {
+    var coreSiteObj = this.get('uiConfigs').filterProperty('filename', 'core-site.xml');
+    var coreSiteProperties = {};
+    // hadoop.proxyuser.oozie.hosts needs to be skipped if oozie is not selected
+    var isOozieSelected = (this.get('content.serviceName') === 'OOZIE');
+    coreSiteObj.forEach(function (_coreSiteObj) {
+      if (isOozieSelected || _coreSiteObj.name != 'hadoop.proxyuser.oozie.hosts') {
+        coreSiteProperties[_coreSiteObj.name] = _coreSiteObj.value;
+      }
+      //console.log("TRACE: name of the property is: " + _coreSiteObj.name);
+      //console.log("TRACE: value of the property is: " + _coreSiteObj.value);
+    }, this);
+    return {"type": "core-site", "tag": tagName, "properties": coreSiteProperties};
+  },
 
+  createSiteObj: function (siteName, tagName) {
+    var siteObj = this.get('uiConfigs').filterProperty('filename', siteName + ".xml");
+    var siteProperties = {};
+    siteObj.forEach(function (_siteObj) {
+      siteProperties[_siteObj.name] = _siteObj.value;
+    }, this);
+    return {"type": siteName, "tag": tagName, "properties": siteProperties};
+  },
+
+  applyCreatedConfToService: function (configStatus) {
+    var result;
+    var clusterName = App.router.getClusterName();
+    var url = App.apiPrefix + '/clusters/' + clusterName + '/services/' + this.get('content.serviceName');
+    var data = this.getConfigForService(configStatus);
+    var realData = data;
+    $.ajax({
+      type: 'PUT',
+      url: url,
+      async: false,
+      dataType: 'text',
+      data: JSON.stringify(data),
+      timeout: 5000,
+      success: function (data) {
+        var jsonData = jQuery.parseJSON(data);
+        console.log("TRACE: In success function for the applyCreatedConfToService call");
+        console.log("TRACE: value of the url is: " + url);
+        result = true;
+      },
+
+      error: function (request, ajaxOptions, error) {
+        console.log('Error: In Error of apply');
+        console.log("The original data was: " + JSON.stringify(realData));
+        console.log('Error: Error message is: ' + request.responseText);
+        result = false;
+      },
+
+      statusCode: require('data/statusCodes')
+    });
+    console.log("Exiting applyCreatedConfToService");
+    console.log("Value of result is: " + result);
+    return result;
+  },
+
+  getConfigForService: function (config) {
+    var data = {config: {}};
+    this.get('serviceConfigTags').forEach(function (_serviceTag) {
+      if (config === 'new')
+        data.config[_serviceTag.siteName] = _serviceTag.newTagName;
+      else if (config = 'previous') {
+        data.config[_serviceTag.siteName] = _serviceTag.tagName;
+      }
+    }, this);
+    return data;
+  },
+
+  setCustomConfigs: function () {
+    var site = this.get('stepConfigs').filterProperty('id', 'conf-site');
+    site.forEach(function (_site) {
+      var keyValue = _site.value.split(/\n+/);
+      if (keyValue) {
+        keyValue.forEach(function (_keyValue) {
+          console.log("The value of the keyValue is: " + _keyValue.trim());
+          _keyValue = _keyValue.trim();
+          var key = _keyValue.match(/(.+)=/);
+          var value = _keyValue.match(/=(.*)/);
+          if (key) {
+            this.setSiteProperty(key[1], value[1], _site.filename);
+          }
+
+        }, this);
+      }
     }, this);
+  },
+
+  /**
+   * Set property of the site variable
+   */
+  setSiteProperty: function (key, value, filename) {
+    if (this.get('uiConfigs').someProperty('name', key)) {
+      this.get('uiConfigs').findProperty('name', key).value = value;
+    } else {
+      this.get('uiConfigs').pushObject({
+        "id": "site property",
+        "name": key,
+        "value": value,
+        "filename": filename
+      });
+    }
+  },
 
-    App.db.setServiceConfigProperties(serviceConfigProperties);
-    alert('Data saved successfully');
-//    this.set('content.serviceConfigProperties', serviceConfigProperties);
+  getUrl: function (testUrl, url) {
+    return (App.testMode) ? testUrl : App.apiPrefix + '/clusters/' + App.router.getClusterName() + url;
+  },
+
+  doPolling: function (desiredStatus, successCallback, errCallback) {
+    var POLL_INTERVAL = 4000;
+    var self = this;
+    var result = true;
+    var servicesUrl1;
+    if (desiredStatus === 'stop') {
+      servicesUrl1 = this.getUrl('/data/dashboard/mapreduce/mapreduce_stop.json', '/services?ServiceInfo/service_name=' + this.get('content.serviceName') + '&fields=components/host_components/*');
+    } else if (desiredStatus === 'start') {
+      servicesUrl1 = this.getUrl('/data/dashboard/mapreduce/mapreduce_start.json', '/services?ServiceInfo/service_name=' + this.get('content.serviceName') + '&fields=components/host_components/*');
+    }
+
+    App.HttpClient.get(servicesUrl1, App.servicesMapper, {
+      complete: function () {
+        var status;
+        if (result === false) {
+          return;
+        }
+        if (desiredStatus === 'stop') {
+          status = self.get('content.isStopped');
+          if (self.get('content.components').someProperty('workStatus', 'STOP_FAILED')) {
+           // if (!self.stopService()) {
+             // return;
+            //}
+          }
+        } else if (desiredStatus === 'start') {
+          status = self.get('content.isStarted');
+          if (self.get('content.components').someProperty('workStatus', 'START_FAILED')) {
+            //if (!self.startService()) {
+             // return;
+            //}
+          }
+        }
+        if (status !== true) {
+          window.setTimeout(function () {
+            self.doPolling(desiredStatus, successCallback, errCallback);
+          }, POLL_INTERVAL);
+        } else if (status === true) {
+          successCallback.apply(self);
+        }
+      },
+      error: function (jqXHR, textStatus) {
+        errCallback.apply(self);
+        result = false;
+      }
+    });
+    return result;
+  },
+
+  initialValue: function (config) {
+    switch (config.name) {
+      case 'namenode_host':
+        config.set('id', 'puppet var');
+        config.set('value', this.get('content.components').findProperty('componentName', 'NAMENODE').get('host.hostName'));
+        break;
+      case 'snamenode_host':
+        config.set('id', 'puppet var');
+        config.set('value', this.get('content.components').findProperty('componentName', 'SECONDARY_NAMENODE').get('host.hostName'));
+        break;
+      case 'jobtracker_host':
+        config.set('id', 'puppet var');
+        config.set('value', this.get('content.components').findProperty('componentName', 'JOBTRACKER').get('host.hostName'));
+        break;
+      case 'hbasemaster_host':
+        config.set('id', 'puppet var');
+        config.set('value', this.get('content.components').findProperty('componentName', 'HBASE_MASTER').get('host.hostName'));
+        break;
+      case 'hivemetastore_host':
+        config.set('id', 'puppet var');
+        config.set('value', this.get('content.components').findProperty('componentName', 'HIVE_SERVER').get('host.hostName'));
+        break;
+      case 'hive_ambari_host':
+        config.set('id', 'puppet var');
+        config.set('value', this.get('content.components').findProperty('componentName', 'HIVE_SERVER').get('host.hostName'));
+        break;
+      case 'oozieserver_host':
+        config.set('id', 'puppet var');
+        config.set('value', this.get('content.components').findProperty('componentName', 'OOZIE_SERVER').get('host.hostName'));
+        break;
+      case 'oozie_ambari_host':
+        config.set('id', 'puppet var');
+        config.set('value', this.get('content.components').findProperty('componentName', 'OOZIE_SERVER').get('host.hostName'));
+        break;
+      case 'zookeeperserver_hosts':
+        config.set('id', 'puppet var');
+        config.set('value', this.get('content.components').findProperty('componentName', 'ZOOKEEPER_SERVER').get('host.hostName'));
+        break;
+    }
   }
+
 });
 
+
 App.MainServiceSlaveComponentGroupsController = App.SlaveComponentGroupsController.extend({
   name: 'mainServiceSlaveComponentGroupsController',
   contentBinding: 'App.router.mainServiceInfoConfigsController.slaveComponentHosts',

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/service/item.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/service/item.js?rev=1418960&r1=1418959&r2=1418960&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/service/item.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/service/item.js Sun Dec  9 14:00:34 2012
@@ -26,7 +26,7 @@ App.MainServiceItemController = Em.Contr
    * @param url
    * @param data Object to send
    */
-  sendCommandToServer : function(url, method,postData, callback){
+  sendCommandToServer : function(url, method, postData, callback){
     var url =  (App.testMode) ?
       '/data/wizard/deploy/poll_1.json' : //content is the same as ours
       App.apiPrefix + '/clusters/' + App.router.getClusterName() + url;
@@ -36,7 +36,7 @@ App.MainServiceItemController = Em.Contr
     $.ajax({
       type: method,
       url: url,
-      data: JSON.stringify(postData),
+      data: (postData != null) ? JSON.stringify(postData) : null,
       dataType: 'json',
       timeout: App.timeout,
       success: function(data){

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/wizard/step10_controller.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/wizard/step10_controller.js?rev=1418960&r1=1418959&r2=1418960&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/wizard/step10_controller.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/wizard/step10_controller.js Sun Dec  9 14:00:34 2012
@@ -66,7 +66,12 @@ App.WizardStep10Controller = Em.Controll
     var succededHosts = hostsInfo.filterProperty('status', 'success');
     var warnedHosts = hostsInfo.filterProperty('status', 'warning').concat(hostsInfo.filterProperty('status', 'failed'));
     if (succededHosts.length) {
-      var successStatement = succededHosts.length + ' nodes succeded completely to install and start all service components assigned to them.';
+      var successStatement;
+      if (succededHosts.length > 1) {
+        successStatement = succededHosts.length + ' nodes succeded completely to install and start all service components assigned to them.';
+      } else {
+        successStatement = succededHosts.length + ' node succeded completely to install and start all service components assigned to it.';
+      }
       this.get('clusterInfo').findProperty('id', 1).get('status').pushObject(Ember.Object.create({
         id: 1,
         displayStatement: successStatement
@@ -281,7 +286,7 @@ App.WizardStep10Controller = Em.Controll
 
   loadNagios: function (component) {
     if (component.get('hostName')) {
-      var statement = 'Ganglia Server installed on ' + component.get('hostName');
+      var statement = 'Nagios Server installed on ' + component.get('hostName');
       this.get('clusterInfo').findProperty('id', 2).get('status').pushObject(Ember.Object.create({
         id: 1,
         displayStatement: statement
@@ -315,13 +320,15 @@ App.WizardStep10Controller = Em.Controll
     }
   },
 
-  loadInstallTime: function() {
-    var statement = 'Install and start of all services completed in '  + this.get('content.cluster.serviceStartTime') + ' minutes';
-    this.get('clusterInfo').pushObject(Ember.Object.create({
-      id: 5,
-      displayStatement: statement,
-      status: []
-    }));
+  loadInstallTime: function () {
+    if (this.get('content.cluster.installTime')) {
+      var statement = 'Install and start of all services completed in ' + this.get('content.cluster.installTime') + ' minutes';
+      this.get('clusterInfo').pushObject(Ember.Object.create({
+        id: 5,
+        displayStatement: statement,
+        status: []
+      }));
+    }
   }
 
 

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/wizard/step5_controller.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/wizard/step5_controller.js?rev=1418960&r1=1418959&r2=1418960&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/wizard/step5_controller.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/wizard/step5_controller.js Sun Dec  9 14:00:34 2012
@@ -64,7 +64,7 @@ App.WizardStep5Controller = Em.Controlle
           host_name: _host.name,
           cpu: _host.cpu,
           memory: _host.memory,
-          host_info: "%@ ( %@GB %@cores )".fmt(_host.name, _host.memory, _host.cpu)
+          host_info: "%@ (%@, %@ cores)".fmt(_host.name, (_host.memory * 1024).bytesToSize(1, 'parseFloat'), _host.cpu)
         });
 
         this.get("hosts").pushObject(hostObj);
@@ -92,7 +92,7 @@ App.WizardStep5Controller = Em.Controlle
     var masterComponents = this.get('components').filterProperty('isMaster', true); //get full list from mock data
 
     var servicesLength = services.length;
-    for (var index =0; index < servicesLength; index++) {
+    for (var index = 0; index < servicesLength; index++) {
       var componentInfo = masterComponents.filterProperty('service_name', services[index]);
 
       componentInfo.forEach(function (_componentInfo) {
@@ -383,11 +383,10 @@ App.WizardStep5Controller = Em.Controlle
     mappedHosts.forEach(function (item) {
       hostObj = self.get("hosts").findProperty("host_name", item);
       console.log("Name of the host is: " + hostObj.host_name);
-      hostInfo = " ( " + hostObj.get("memory") + "GB" + " " + hostObj.get("cpu") + "cores )";
 
       mappingObject = Ember.Object.create({
         host_name: item,
-        hostInfo: hostInfo,
+        hostInfo: hostObj.host_info,
         masterServices: self.get("selectedServicesMasters").filterProperty("selectedHost", item)
       });
 

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/wizard/step6_controller.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/wizard/step6_controller.js?rev=1418960&r1=1418959&r2=1418960&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/wizard/step6_controller.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/wizard/step6_controller.js Sun Dec  9 14:00:34 2012
@@ -231,7 +231,7 @@ App.WizardStep6Controller = Em.Controlle
         var dataNode = hostsObj.findProperty('hostName', _dataNode.hostName);
         if (dataNode) {
           dataNode.set('isDataNode', true);
-          dataNode.set('isDataNodeInstalled', true);
+          dataNode.set('isDataNodeInstalled', _dataNode.isInstalled);
         }
       });
 
@@ -241,7 +241,7 @@ App.WizardStep6Controller = Em.Controlle
           var taskTracker = hostsObj.findProperty('hostName', _taskTracker.hostName);
           if (taskTracker) {
             taskTracker.set('isTaskTracker', true);
-            taskTracker.set('isTaskTrackerInstalled', true);
+            taskTracker.set('isTaskTrackerInstalled', _taskTracker.isInstalled);
           }
         });
       }
@@ -252,7 +252,7 @@ App.WizardStep6Controller = Em.Controlle
           var regionServer = hostsObj.findProperty('hostName', _regionServer.hostName);
           if (regionServer) {
             regionServer.set('isRegionServer', true);
-            regionServer.set('isRegionServerInstalled', true);
+            regionServer.set('isRegionServerInstalled', _regionServer.isInstalled);
           }
         });
       }
@@ -262,7 +262,7 @@ App.WizardStep6Controller = Em.Controlle
         var client = hostsObj.findProperty('hostName', _client.hostName);
         if (client) {
           client.set('isClient', true);
-          client.set('isClientInstalled', true);
+          client.set('isClientInstalled', _client.isInstalled);
         }
       }, this);
 

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/wizard/step7_controller.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/wizard/step7_controller.js?rev=1418960&r1=1418959&r2=1418960&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/wizard/step7_controller.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/wizard/step7_controller.js Sun Dec  9 14:00:34 2012
@@ -116,6 +116,11 @@ App.WizardStep7Controller = Em.Controlle
     }
   },
 
+
+
+  /**
+   * Render a custom conf-site box for entering properties that will be written in *-site.xml files of the services
+   */
   loadCustomConfig: function () {
     var serviceConfigs = this.get('serviceConfigs');
     this.get('customConfigs').forEach(function (_config) {
@@ -134,8 +139,8 @@ App.WizardStep7Controller = Em.Controlle
    */
   renderServiceConfigs: function (serviceConfigs) {
     serviceConfigs.forEach(function (_serviceConfig) {
+
       var serviceConfig = App.ServiceConfig.create({
-        id: _serviceConfig.id,
         filename: _serviceConfig.filename,
         serviceName: _serviceConfig.serviceName,
         displayName: _serviceConfig.displayName,
@@ -154,6 +159,21 @@ App.WizardStep7Controller = Em.Controlle
       }
     }, this);
 
+    var miscConfigs = this.get('stepConfigs').findProperty('serviceName', 'MISC').configs;
+    var showProxyGroup = this.get('selectedServiceNames').contains('HIVE') ||
+      this.get('selectedServiceNames').contains('HCATALOG') ||
+      this.get('selectedServiceNames').contains('OOZIE');
+    miscConfigs.findProperty('name', 'proxyuser_group').set('isVisible', showProxyGroup);
+    miscConfigs.findProperty('name', 'hbase_user').set('isVisible', this.get('selectedServiceNames').contains('HBASE'));
+    miscConfigs.findProperty('name', 'mapred_user').set('isVisible', this.get('selectedServiceNames').contains('MAPREDUCE'));
+    miscConfigs.findProperty('name', 'hive_user').set('isVisible', this.get('selectedServiceNames').contains('HIVE'));
+    miscConfigs.findProperty('name', 'hcat_user').set('isVisible', this.get('selectedServiceNames').contains('HCATALOG'));
+    miscConfigs.findProperty('name', 'templeton_user').set('isVisible', this.get('selectedServiceNames').contains('HCATALOG'));
+    miscConfigs.findProperty('name', 'oozie_user').set('isVisible', this.get('selectedServiceNames').contains('OOZIE'));
+    miscConfigs.findProperty('name', 'pig_user').set('isVisible', this.get('selectedServiceNames').contains('PIG'));
+    miscConfigs.findProperty('name', 'sqoop_user').set('isVisible', this.get('selectedServiceNames').contains('SQOOP'));
+    miscConfigs.findProperty('name', 'zk_user').set('isVisible', this.get('selectedServiceNames').contains('ZOOKEEPER'));
+
     this.set('selectedService', this.get('stepConfigs').objectAt(0));
   },
 
@@ -167,7 +187,6 @@ App.WizardStep7Controller = Em.Controlle
       var serviceConfigProperty = App.ServiceConfigProperty.create(_serviceConfigProperty);
       serviceConfigProperty.serviceConfig = componentConfig;
       serviceConfigProperty.initialValue();
-
       componentConfig.configs.pushObject(serviceConfigProperty);
       serviceConfigProperty.validate();
     }, this);

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/wizard/step8_controller.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/wizard/step8_controller.js?rev=1418960&r1=1418959&r2=1418960&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/wizard/step8_controller.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/wizard/step8_controller.js Sun Dec  9 14:00:34 2012
@@ -293,6 +293,7 @@ App.WizardStep8Controller = Em.Controlle
             break;
           case 'GANGLIA':
             this.loadGanglia(serviceObj);
+            break;
           case 'HCATALOG':
             break;
           default:
@@ -615,7 +616,7 @@ App.WizardStep8Controller = Em.Controlle
 
   createCluster: function () {
 
-    if (this.get('content.cluster.isCompleted')){
+    if (this.get('content.isWizard')){
       return false;
     }
 
@@ -829,7 +830,7 @@ App.WizardStep8Controller = Em.Controlle
 
   createConfigurations: function () {
     var selectedServices = this.get('selectedServices');
-    if (!this.get('content.cluster.isCompleted')){
+    if (!this.get('content.isWizard')){
       this.createConfigSite(this.createGlobalSiteObj());
       this.createConfigSite(this.createCoreSiteObj());
       this.createConfigSite(this.createHdfsSiteObj('HDFS'));

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/wizard/step9_controller.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/wizard/step9_controller.js?rev=1418960&r1=1418959&r2=1418960&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/wizard/step9_controller.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/wizard/step9_controller.js Sun Dec  9 14:00:34 2012
@@ -77,11 +77,14 @@ App.WizardStep9Controller = Em.Controlle
   },
 
   loadHosts: function () {
-    var hostInfo = [];
-    hostInfo = App.db.getHosts();
+    var hostInfo = this.get('content.hostsInfo');
+
     var hosts = new Ember.Set();
     for (var index in hostInfo) {
-      hosts.add(hostInfo[index]);
+      var obj = Em.Object.create(hostInfo[index]);
+      obj.tasks = [];
+      obj.logTasks = [];
+      hosts.add(obj);
       console.log("TRACE: host name is: " + hostInfo[index].name);
     }
     return hosts;
@@ -433,7 +436,6 @@ App.WizardStep9Controller = Em.Controlle
 
   // This is done at HostRole level.
   setLogTasksStatePerHost: function (tasksPerHost, host) {
-    var tasks = [];
     console.log('In step9 setTasksStatePerHost function.');
     tasksPerHost.forEach(function (_task) {
       console.log('In step9 _taskPerHost function.');
@@ -491,7 +493,7 @@ App.WizardStep9Controller = Em.Controlle
 
   getUrl: function () {
     var clusterName = this.get('content.cluster.name');
-    var requestId = App.db.getClusterStatus().requestId;
+    var requestId = this.get('content.cluster.requestId');
     var url = App.apiPrefix + '/clusters/' + clusterName + '/requests/' + requestId + '?fields=tasks/*';
     console.log("URL for step9 is: " + url);
     return url;

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/data/config_mapping.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/data/config_mapping.js?rev=1418960&r1=1418959&r2=1418960&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/data/config_mapping.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/data/config_mapping.js Sun Dec  9 14:00:34 2012
@@ -102,13 +102,6 @@ module.exports = [
     "filename": "hdfs-site.xml"
   },
   {
-    "name": "dfs.webhdfs.enabled",
-    "templateName": ["dfs_webhdfs_enabled"],
-    "foreignKey": null,
-    "value": "<templateName[0]>",
-    "filename": "hdfs-site.xml"
-  },
-  {
     "name": "dfs.datanode.failed.volumes.tolerated",
     "templateName": ["dfs_datanode_failed_volume_tolerated"],
     "foreignKey": null,

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/data/config_properties.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/data/config_properties.js?rev=1418960&r1=1418959&r2=1418960&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/data/config_properties.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/data/config_properties.js Sun Dec  9 14:00:34 2012
@@ -609,7 +609,7 @@ module.exports =
     {
       "id": "puppet var",
       "name": "proxyuser_group",
-      "displayName": "Proxy group for Hive, Templeton and Oozie.",
+      "displayName": "Proxy group for Hive, Templeton, and Oozie",
       "description": "",
       "defaultValue": "users",
       "isReconfigurable": false,
@@ -648,8 +648,8 @@ module.exports =
     {
       "id": "puppet var",
       "name": "dfs_replication",
-      "displayName": "Include hosts",
-      "description": "Include entered hosts",
+      "displayName": "Block replication",
+      "description": "Default block replication.",
       "displayType": "int",
       "defaultValue": "3",
       "isReconfigurable": false,

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/initialize.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/initialize.js?rev=1418960&r1=1418959&r2=1418960&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/initialize.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/initialize.js Sun Dec  9 14:00:34 2012
@@ -22,7 +22,7 @@ window.App = require('app');
 App.testMode = false;
 App.skipBootstrap = false;
 App.alwaysGoToInstaller = false;
-App.apiPrefix = '/api';
+App.apiPrefix = '/api/v1';
 // default AJAX timeout
 App.timeout = 20000;
 

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/mappers/hosts_mapper.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/mappers/hosts_mapper.js?rev=1418960&r1=1418959&r2=1418960&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/mappers/hosts_mapper.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/mappers/hosts_mapper.js Sun Dec  9 14:00:34 2012
@@ -28,6 +28,7 @@ App.hostsMapper = App.QuickDataMapper.cr
     components: {
       item : 'HostRoles.component_name'
     },
+    rack: 'Hosts.rack_info',
     host_components_key: 'host_components',
     host_components_type: 'array',
     host_components: {

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/mappers/jobs_mapper.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/mappers/jobs_mapper.js?rev=1418960&r1=1418959&r2=1418960&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/mappers/jobs_mapper.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/mappers/jobs_mapper.js Sun Dec  9 14:00:34 2012
@@ -57,7 +57,9 @@ App.jobsMapper = App.QuickDataMapper.cre
 
 App.jobTimeLineMapper = App.QuickDataMapper.create({
   config:{
-    jobTimeLine:'items'
+    map:'map',
+    shuffle:'shuffle',
+    reduce:'reduce'
   },
   map:function (json) {
     var job = this.get('model'); // @model App.MainAppsItemBarView
@@ -71,7 +73,12 @@ App.jobTimeLineMapper = App.QuickDataMap
 
 App.jobTasksMapper = App.QuickDataMapper.create({
   config:{
-    jobTaskView:'items'
+    mapNodeLocal:'mapNodeLocal',
+    mapRackLocal:'mapRackLocal',
+    mapOffSwitch:'mapOffSwitch',
+    reduceOffSwitch:'reduceOffSwitch',
+    submitTime:'submitTime',
+    finishTime:'finishTime'
   },
   map:function (json) {
     var job = this.get('model'); // @model App.MainAppsItemBarView

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/mappers/services_mapper.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/mappers/services_mapper.js?rev=1418960&r1=1418959&r2=1418960&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/mappers/services_mapper.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/mappers/services_mapper.js Sun Dec  9 14:00:34 2012
@@ -25,6 +25,7 @@ App.servicesMapper = App.QuickDataMapper
     'OOZIE',
     'GANGLIA',
     'NAGIOS',
+    'ZOOKEEPER',
     'PIG',
     'SQOOP'
   ],

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/messages.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/messages.js?rev=1418960&r1=1418959&r2=1418960&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/messages.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/messages.js Sun Dec  9 14:00:34 2012
@@ -340,7 +340,10 @@ Em.I18n.translations = {
   'dashboard.services.hbase.masterStarted':'Master Started',
   'dashboard.services.hbase.masterActivated':'Master Activated',
 
-
+  'dashboard.services.configs.popup.stopService.header':'Stop service',
+  'dashboard.services.configs.popup.stopService.body' : 'Service needs to be stopped for reconfiguration',
+  'dashboard.services.configs.popup.restartService.header' : 'Restart service',
+  'dashboard.services.configs.popup.restartService.body' : 'Service needs to be restarted for reconfiguration',
   'timeRange.presets.1hour':'1h',
   'timeRange.presets.12hour':'12h',
   'timeRange.presets.1day':'1d',

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/models/component.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/models/component.js?rev=1418960&r1=1418959&r2=1418960&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/models/component.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/models/component.js Sun Dec  9 14:00:34 2012
@@ -62,6 +62,8 @@ App.Component.Status = {
   starting: "STARTING",
   stopped: "INSTALLED",
   stopping: "STOPPING",
+  stop_failed: "STOP_FAILED",
+  start_failed: "START_FAILED",
 
   getKeyName:function(value){
     switch(value){
@@ -73,6 +75,10 @@ App.Component.Status = {
         return 'installed';
       case this.stopping:
         return 'stopping';
+      case this.stop_failed:
+        return 'stop_failed';
+      case this.start_failed:
+        return 'start_failed';
     }
     return 'none';
   }

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/models/host.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/models/host.js?rev=1418960&r1=1418959&r2=1418960&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/models/host.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/models/host.js Sun Dec  9 14:00:34 2012
@@ -31,6 +31,7 @@ App.Host = DS.Model.extend({
   loadAvg: DS.attr('string'),
   osArch: DS.attr('string'),
   ip: DS.attr('string'),
+  rack: DS.attr('string'),
   healthStatus: DS.attr('string'),
   cpuUsage: DS.attr('number'),
   memoryUsage: DS.attr('number'),

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/models/hosts.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/models/hosts.js?rev=1418960&r1=1418959&r2=1418960&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/models/hosts.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/models/hosts.js Sun Dec  9 14:00:34 2012
@@ -21,8 +21,8 @@ var App = require('app');
 App.HostInfo = Ember.Object.extend({
   elementId: 'host',
   name: '',
-  cpu: '2',
-  memory: '2',
+  cpu: 2,
+  memory: 4000000000,
   message: 'Information',
   barColor: 'progress-info',
   isChecked: true,

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/models/service.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/models/service.js?rev=1418960&r1=1418959&r2=1418960&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/models/service.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/models/service.js Sun Dec  9 14:00:34 2012
@@ -29,20 +29,31 @@ App.Service = DS.Model.extend({
   quickLinks: DS.hasMany('App.QuickLinks'),
   components: DS.hasMany('App.Component'),
   hostComponents: DS.hasMany('App.HostComponent'),
-  isRunning: function(){
-    return (this.get('healthStatus') == 'green' | this.get('healthStatus') == 'green-blinking');
+  isRunning: function () {
+    return (this.get('healthStatus') == 'green' || this.get('healthStatus') == 'green-blinking');
   }.property('healthStatus'),
 
-  healthStatus: function(){
+  healthStatus: function () {
     var components = this.get('components').filterProperty('isMaster', true);
-    if (components.everyProperty('workStatus', App.Component.Status.started)){
+    if (components.everyProperty('workStatus', App.Component.Status.started)) {
       return 'green';
-    } else if(components.someProperty('workStatus', App.Component.Status.stopped)){
-      return 'red';
-    } else if(components.someProperty('workStatus', App.Component.Status.starting)){
+    } else if (components.someProperty('workStatus', App.Component.Status.starting)) {
       return 'green-blinking';
+    } else if (components.someProperty('workStatus', App.Component.Status.stopped)) {
+      return 'red';
+    } else {
+      return 'red-blinking';
     }
-    return 'red-blinking';
+  }.property('components.@each.workStatus'),
+
+  isStopped: function () {
+    var components = this.get('components');
+    return components.everyProperty('workStatus', App.Component.Status.stopped);
+  }.property('components.@each.workStatus'),
+
+  isStarted: function () {
+    var components = this.get('components').filterProperty('isMaster', true);
+    return components.everyProperty('workStatus', App.Component.Status.started);
   }.property('components.@each.workStatus'),
 
   displayName: function () {
@@ -80,8 +91,8 @@ App.Service.Health = {
   starting: "STARTING",
   stopping: "STOPPING",
 
-  getKeyName:function(value){
-    switch(value){
+  getKeyName: function (value) {
+    switch (value) {
       case this.live:
         return 'live';
       case this.dead:

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/routes/add_host_routes.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/routes/add_host_routes.js?rev=1418960&r1=1418959&r2=1418960&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/routes/add_host_routes.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/routes/add_host_routes.js Sun Dec  9 14:00:34 2012
@@ -34,26 +34,6 @@ module.exports = Em.Route.extend({
     router.get('mainController').connectOutlet('addHost');
   },
 
-  step0: Em.Route.extend({
-    route: '/step0',
-    connectOutlets: function (router) {
-      console.log('in addHost.step0:connectOutlets');
-      var controller = router.get('addHostController');
-      controller.setCurrentStep('0', false);
-      controller.loadAllPriorSteps();
-      controller.connectOutlet('wizardStep1', controller.get('content'));
-    },
-
-    next: function (router) {
-      var addHostController = router.get('addHostController');
-      var wizardStep1Controller = router.get('wizardStep1Controller');
-
-      addHostController.saveClusterInfo(wizardStep1Controller);
-
-      router.transitionTo('step1');
-    }
-  }),
-
   step1: Em.Route.extend({
     route: '/step1',
     connectOutlets: function (router) {
@@ -235,7 +215,6 @@ module.exports = Em.Route.extend({
     next: function (router) {
       var addHostController = router.get('addHostController');
       var wizardStep9Controller = router.get('wizardStep9Controller');
-      addHostController.saveClusterInfo(wizardStep9Controller);
       addHostController.saveInstalledHosts(wizardStep9Controller);
       router.transitionTo('step9');
     }
@@ -254,7 +233,7 @@ module.exports = Em.Route.extend({
     complete: function (router, context) {
       if (true) {   // this function will be moved to installerController where it will validate
         var addHostController = router.get('addHostController');
-        addHostController.setCurrentStep('1', false);
+        addHostController.finish();
         router.transitionTo('hosts');
       } else {
         console.log('cluster installation failure');

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/routes/add_service_routes.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/routes/add_service_routes.js?rev=1418960&r1=1418959&r2=1418960&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/routes/add_service_routes.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/routes/add_service_routes.js Sun Dec  9 14:00:34 2012
@@ -154,7 +154,7 @@ module.exports = Em.Route.extend({
     },
     back: Em.Router.transitionTo('step5'),
     retry: function(router,context) {
-      var addServiceController = router.get('addSrviceController');
+      var addServiceController = router.get('addServiceController');
       var wizardStep9Controller = router.get('wizardStep9Controller');
       if (!wizardStep9Controller.get('isSubmitDisabled')) {
         addServiceController.installServices();
@@ -165,7 +165,6 @@ module.exports = Em.Route.extend({
     next: function (router) {
       var addServiceController = router.get('addServiceController');
       var wizardStep9Controller = router.get('wizardStep9Controller');
-      //addServiceController.saveClusterInfo(wizardStep9Controller);
       addServiceController.saveInstalledHosts(wizardStep9Controller);
       router.transitionTo('step7');
     }

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/routes/installer.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/routes/installer.js?rev=1418960&r1=1418959&r2=1418960&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/routes/installer.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/routes/installer.js Sun Dec  9 14:00:34 2012
@@ -279,7 +279,6 @@ module.exports = Em.Route.extend({
     next: function (router) {
       var installerController = router.get('installerController');
       var wizardStep9Controller = router.get('wizardStep9Controller');
-     // installerController.saveClusterInfo(wizardStep9Controller);
       installerController.saveInstalledHosts(wizardStep9Controller);
       router.transitionTo('step10');
     }

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/styles/application.less
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/styles/application.less?rev=1418960&r1=1418959&r2=1418960&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/styles/application.less (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/styles/application.less Sun Dec  9 14:00:34 2012
@@ -843,9 +843,12 @@ a:focus {
     }
   }
   .table {
-    margin-bottom: 0;
+    //margin-bottom: 0;
     thead {
-      background: #EDF5FC;
+      //background: #EDF5FC;
+    }
+    th {
+      border-top: none;
     }
     th, td {
       width: 82px;
@@ -883,7 +886,68 @@ a:focus {
         }
       }
     }
+    .sorting_asc { background: url(data:image/jpeg;base64,/9j/4AAQSkZJRgABAgAAZABkAAD/7AARRHVja3kAAQAEAAAAZAAA/+4ADkFkb2JlAGTAAAAAAf/bAIQAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQICAgICAgICAgICAwMDAwMDAwMDAwEBAQEBAQECAQECAgIBAgIDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMD/8AAEQgAEwATAwERAAIRAQMRAf/EAHgAAAMBAQAAAAAAAAAAAAAAAAAFCAYKAQACAQUAAAAAAAAAAAAAAAAABQMCBAYHCBAAAQUAAQMEAwAAAAAAAAAAAwECBAUGABESByExIghBMxQRAAIBAwMDAwUAAAAAAAAAAAECAwAEBRESBiExUUHhB2GBIhMU/9oADAMBAAIRAxEAPwDvA8k+Qc54sxGj32qlNi0ucrjTj/JqGlmROyJXQ2u/bOsZTmBExPd70/HXmQcW41lOX5+145h0L391KEHhR3Z28Ii6sx9AKgubiO1gaeU6Io19h9TUg/S/7eP+wia3NbBIFbuqiyn3VTCjIMArHHTJarEDGGiNU8vOKVsc7/VxBuGR3yV683X86/Cq/GpssrhP2S8emiSKRm1JS5VfyLH0WfQug7KwZR0CilWHy39++ObQTgkgeV9ux+xq9uc6U8pLfZzP6mClZpKWrvq1DilJAt4Mewh/0hRyBOsaUMoVKLvXtVU6t6+nL/HZTJYi4/rxU81tdbSu+N2Rtp7jcpB0OnUa9aoeOOVdsgDL4I1pFS+NPHmcsQ2+fw+UpLWOwwwWNVQ1kCaIcgaiONkmLGEZrDDXtcnXo5PfjC+5VybKWrWWSyF5cWbEEpJNI6kqdQSrMRqD1B9KjS2t423xoqt5AAr
 b8QVPRwoo4UUcKK//2Q==) no-repeat 85% 50%; }
+    .sorting_desc { background: url(data:image/jpeg;base64,/9j/4AAQSkZJRgABAgAAZABkAAD/7AARRHVja3kAAQAEAAAAZAAA/+4ADkFkb2JlAGTAAAAAAf/bAIQAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQICAgICAgICAgICAwMDAwMDAwMDAwEBAQEBAQECAQECAgIBAgIDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMD/8AAEQgAEwATAwERAAIRAQMRAf/EAIEAAAIDAQAAAAAAAAAAAAAAAAAGBwgJCgEBAAIDAQAAAAAAAAAAAAAAAAMFBAYHCBAAAAUDAwMFAAAAAAAAAAAAAQIDBAUABgcSNTYRFQgTZFUWZhEAAAQEAggGAwAAAAAAAAAAAAECAxEhBAYSMjFBYRMzFDQFUZFSYmMHJFRk/9oADAMBAAIRAxEAPwDv4oAKACgCKc1tMmusb3Eph6cSgsgx7fucEZxGRks2llGIGVWgVm8q1dt0+6ogKaapSgdNbQPXTqAdwsN602bopk3vTnUW24rduwccbU2S5E8Sm1JM92czSZwNOKUYDFrCqTp1corDUFMpEcYap+Ipb4P5O8n81y9xXXlG50yY+thR3AEivqFvRDmduvSUrhuLtrFNXqCFvJm1LAQ5RMuchB6gBy13f7+tP6lsOipuz2jSGdy1ZJeNzmXnEtU+pWFTikmbxyTEjgglKKZpMU3ZanudYtTtSr8dMoYSKKvKMte0aUV5YGxgoASbD2iQ4Tyi6uB7Rvz/AHD9R8r7/wBWr64uta6/pKfq+JwUZP5/1/hwCFjIeTMrLo0np93q2xDtVCJh/9k=) no-repeat 85% 50%; }
+    .sorting { background: url(data:image/jpeg;base64,/9j/4AAQSkZJRgABAgAAZABkAAD/7AARRHVja3kAAQAEAAAAZAAA/+4ADkFkb2JlAGTAAAAAAf/bAIQAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQICAgICAgICAgICAwMDAwMDAwMDAwEBAQEBAQECAQECAgIBAgIDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMD/8AAEQgAEwATAwERAAIRAQMRAf/EAGgAAAIDAQAAAAAAAAAAAAAAAAUHAAYICgEBAQAAAAAAAAAAAAAAAAAAAAEQAAEEAQIFAgcAAAAAAAAAAAECAwQFABEGIRI0NQcTFDFBMmNUZRYRAQEBAQAAAAAAAAAAAAAAAAABEUH/2gAMAwEAAhEDEQA/AO93cd/XbXpLC9tHQ1Dr46nljUBby/gzGZB+p+Q6QhA+ZOApfDnllW/ha1tv6Ee7iyH5kRlvlbTIqHndWkNJ0HO7XFQbWeJUkpUeOpySrZh65UUnyFUW1ztaexRmIbaPyzoLE6vg2UWW9GC1e0XHnsSGEqfQohCwApK9OIGuAjfBP9VuG0m39vGqINVUe4r2xF21TVsuXZOI9N9lMmLBYkttQ21auBKhqtSUngCMkW5xqjKiYASh6SR2Tulr2HpOvf6j9p+V9/mwDeB//9k=) no-repeat 85% 50%; }
+
+    a.paginate_disabled_next, a.paginate_disabled_previous {
+      color: gray;
+      &:hover {
+        color: gray;
+        text-decoration: none;
+      }
+    }
+
+    a.paginate_enabled_next, a.paginate_enabled_previous {
+      &:hover {
+        text-decoration: none;
+      }
+    }
+
+    div.view-wrapper {
+      float: left;
+    }
+
+    a.ui-icon-circle-close {
+      float: right;
+      opacity: 0.2;
+      padding: 1px;
+      position: relative;
+      &:hover {
+        opacity: 0.7;
+      }
+    }
+    .notActive {
+      a.ui-icon-circle-close {
+        visibility: hidden;
+      }
+    }
+  }
+
+  .page-bar {
+    border: 1px solid silver;
+    text-align:right;
+    div {
+      display: inline-block;
+      margin:0 10px;
+    }
+    .dataTables_length {
+      label {
+        display:inline;
+      }
+      select {
+        margin-bottom: 4px;
+        margin-top: 4px;
+        width:70px;
+      }
+    }
+    .dataTables_paginate {
+      a {
+        padding:0 5px;
+      }
+    }
   }
+
   .open-group > .dropdown-menu {
     display: block;
   }

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/templates/main/background_operations_popup.hbs
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/templates/main/background_operations_popup.hbs?rev=1418960&r1=1418959&r2=1418960&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/templates/main/background_operations_popup.hbs (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/templates/main/background_operations_popup.hbs Sun Dec  9 14:00:34 2012
@@ -20,15 +20,16 @@
   {{#view App.MainBackgroundOperation contentBinding="operation"}}
     <div>
       <a {{action showOperationLog target="view"}} href="#">
-        {{#if view.isOpenShowLog}}Hide{{else}}Show{{/if}} info about {{operation.command}} {{operation.role}} on {{operation.host_name}}
+        <i {{bindAttr class="view.iconClass"}}></i>
+        {{#if view.isOpen}}Hide{{else}}Show{{/if}} info about {{operation.command}} {{operation.role}} on {{operation.host_name}}
       </a>
-      {{#if view.isOpenShowLog}}
+      {{#if view.isOpen}}
         <h5>exitcode:</h5>
         <pre class="stderr">{{operation.exit_code}}</pre>
         <h5>stderr:</h5>
-        <pre class="stderr">{{operation.stderr}}</pre>
+        <pre class="stderr">{{highlight operation.stderr [err;fail]}}</pre>
         <h5>stdout:</h5>
-        <pre class="stdout">{{operation.stdout}}</pre>
+        <pre class="stdout">{{highlight operation.stdout [err;fail]}}</pre>
       {{/if}}
     </div>
   {{/view}}

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/templates/main/host.hbs
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/templates/main/host.hbs?rev=1418960&r1=1418959&r2=1418960&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/templates/main/host.hbs (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/templates/main/host.hbs Sun Dec  9 14:00:34 2012
@@ -16,7 +16,7 @@
 * limitations under the License.
 }}
 
-<div id="hosts" class="box">
+<div id="hosts">
   <div class="box-header">
     <div class="button-section">
       <button class="btn btn-inverse add-host-button" {{action addHost}}>
@@ -25,27 +25,24 @@
       </button>
     </div>
   </div>
-  <table class="table table-bordered table-striped">
+  <table class="datatable table table-bordered table-striped" id="hosts-table">
     <thead>
     <tr>
-      <th class="name">
-        <div class="host-name-pos">
-          <a class="filter-label" href="#" {{action sortByName target="controller" }}>Name
-            {{#if controller.isSort}}
-            <i class="icon-arrow-up"{{bindAttr class="controller.sortClass"}}></i>
-            {{/if}}
-          </a>
-
-          {{view Ember.TextField class="host-name-search" placeholder="search" valueBinding="view.filterByName"}}
-        </div>
-
-      </th>
+      <th>Name</th>
       <th>Rack</th>
       <th>CPU</th>
       <th>RAM</th>
       <th>Disk Usage</th>
       <th>Load Avg</th>
-      <th>
+      <th>Components</th>
+    </tr>
+      <th class="notActive"><div class="view-wrapper">{{view view.nameFilterView viewName="nameFilterViewInstance"}}</div> <a href="#" {{action "clearFilterButtonClick" target="view"}} id="view_nameFilterViewInstance" class="ui-icon ui-icon-circle-close ui-name"></a></th>
+      <th class="notActive"><div class="view-wrapper">{{view view.rackFilterView viewName="rackFilterViewInstance"}}</div> <a href="#" {{action "clearFilterButtonClick" target="view"}} id="view_rackFilterViewInstance" class="ui-icon ui-icon-circle-close ui-rack"></a></th>
+      <th class="notActive"><div class="view-wrapper">{{view view.cpuFilterView viewName="cpuFilterViewInstance"}}</div> <a href="#" {{action "clearFilterButtonClick" target="view"}} id="view_cpuFilterViewInstance" class="ui-icon ui-icon-circle-close ui-cpu"></a></th>
+      <th class="notActive"><div class="view-wrapper">{{view view.ramFilterView viewName="ramFilterViewInstance"}}</div> <a href="#" {{action "clearFilterButtonClick" target="view"}} id="view_ramFilterViewInstance" class="ui-icon ui-icon-circle-close ui-ram"></a></th>
+      <th></th>
+      <th></th>
+      <th><input id="components_filter" type="hidden" />
         <div {{bindAttr class="view.btnGroupClass"}} >
           <button class="btn btn-info single-btn-group" {{action "clickFilterButton" target="view"}}>
             Components
@@ -104,11 +101,11 @@
     {{#each host in controller}}
     {{#view view.HostView contentBinding="host"}}
     <tr>
-      <td class="name">
+      <td>
         <span {{bindAttr class="host.healthClass"}}></span>
         <a href="#" {{action "showDetails" host}}>{{unbound host.hostName}}</a>
       </td>
-      <td>{{host.cluster.clusterName}}</td>
+      <td>{{host.rack}}</td>
       <td>{{host.cpu}}</td>
       <td>{{host.memoryFormatted}}</td>
       <td>
@@ -125,26 +122,4 @@
     {{/each}}
     </tbody>
   </table>
-  <div class="box-footer">
-    <hr/>
-    <div class="footer-pagination">
-      <ul class="nav nav-pills">
-        <li class="disabled">Show: </li>
-        <li class="dropdown">
-          {{view Em.Select contentBinding="pageSizeRange"
-                    selectionBinding="pageSize"
-                    optionValuePath="this"}}
-        </li>
-        <li class="disabled">{{startPosition}}-{{rangeStop}} of {{total}}</li>
-        <li class="disabled page-listing">
-          {{#if hasPrevious}}
-          <a href="#" {{action showPreviousPage target="controller"}}>previous</a>
-          {{/if}}
-          {{#if hasNext}}
-          <a href="#" {{action showNextPage target="controller"}}>next</a>
-          {{/if}}
-        </li>
-      </ul>
-    </div>
-  </div>
 </div>

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/templates/main/service/info/configs.hbs
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/templates/main/service/info/configs.hbs?rev=1418960&r1=1418959&r2=1418960&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/templates/main/service/info/configs.hbs (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/templates/main/service/info/configs.hbs Sun Dec  9 14:00:34 2012
@@ -216,6 +216,6 @@
   <p class="pull-right">
     <!--<input class="btn btn-primary" type="button" value="Save and apply changes" {{!bindAttr disabled="isSubmitDisabled"}} />-->
     <a class="btn btn-primary" {{bindAttr disabled="isSubmitDisabled"}}
-      {{action saveServiceConfigProperties target="controller"}}>Save and apply changes</a>
+      {{action restartServicePopup target="controller"}}>Save and apply changes</a>
   </p>
 </div>
\ No newline at end of file

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/templates/wizard/step5.hbs
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/templates/wizard/step5.hbs?rev=1418960&r1=1418959&r2=1418960&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/templates/wizard/step5.hbs (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/templates/wizard/step5.hbs Sun Dec  9 14:00:34 2012
@@ -57,7 +57,7 @@
   <div class="host-assignments">
     {{#each masterHostMapping}}
     <div class="mapping-box round-corners well">
-      <div class="hostString"><span><strong>{{host_name}}</strong></span><span>{{hostInfo}}</span></div>
+      <div class="hostString"><span>{{hostInfo}}</span></div>
       {{#each masterServices}}
       <span class="assignedService round-corners">{{display_name}}</span>
       {{/each}}

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/utils/data_table.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/utils/data_table.js?rev=1418960&r1=1418959&r2=1418960&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/utils/data_table.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/utils/data_table.js Sun Dec  9 14:00:34 2012
@@ -17,6 +17,20 @@
  */
 
 jQuery.extend(jQuery.fn.dataTableExt.oSort, {
+
+  "num-html-pre": function(date_string) {
+    date_string = $(date_string).text();
+    return parseInt(date_string, 10);
+  },
+
+  "num-html-asc": function (a, b) {
+    return a - b;
+  },
+
+  "num-html-desc": function (a, b) {
+    return b - a;
+  },
+
   // @see utils/date.js
   "ambari-date-pre": function (date_string) {
     date_string = $(date_string).text(); // strip Ember script tags
@@ -141,17 +155,19 @@ jQuery.extend($.fn.dataTableExt.afnFilte
     function (oSettings, aData, iDataIndex) {
       var inputFilters = [
         {iColumn: '0', elementId: 'star_filter', type: 'star'},
+        {iColumn: '2', elementId: 'cpu_filter', type: 'number'},
         {iColumn: '4', elementId: 'user_filter', type: 'multiple'},
         {iColumn: '5', elementId: 'jobs_filter', type: 'number' },
-        {iColumn: '6', elementId: 'input_filter', type: 'bandwidth' },
-        {iColumn: '7', elementId: 'output_filter', type: 'bandwidth' },
+        {iColumn: '3', elementId: 'ram_filter', type: 'ambari-bandwidth' },
+        {iColumn: '6', elementId: 'input_filter', type: 'ambari-bandwidth' },
+        {iColumn: '7', elementId: 'output_filter', type: 'ambari-bandwidth' },
         {iColumn: '8', elementId: 'duration_filter', type: 'time' },
-        {iColumn: '9', elementId: 'rundate_filter', type: 'date' }
+        //{iColumn: '9', elementId: 'rundate_filter', type: 'ambari-date' }
       ];
       var match = true;
-      for (i = 0; i < inputFilters.length; i++) {
+      for (var i = 0; i < inputFilters.length; i++) {
         switch (inputFilters[i].type) {
-          case 'date':
+          case 'ambari-date':
             if (jQuery('#' + inputFilters[i].elementId).val() !== 'Any' && match) {
               dateFilter(jQuery('#' + inputFilters[i].elementId).val(), aData[inputFilters[i].iColumn]);
             }
@@ -171,7 +187,7 @@ jQuery.extend($.fn.dataTableExt.afnFilte
               timeFilter(jQuery('#' + inputFilters[i].elementId).val(), aData[inputFilters[i].iColumn]);
             }
             break;
-          case 'bandwidth':
+          case 'ambari-bandwidth':
             if (jQuery('#' + inputFilters[i].elementId).val() && match) {
               bandwidthFilter(jQuery('#' + inputFilters[i].elementId).val(), aData[inputFilters[i].iColumn]);
             }
@@ -230,6 +246,7 @@ jQuery.extend($.fn.dataTableExt.afnFilte
       }
 
       function bandwidthFilter(rangeExp, rowValue) {
+        rowValue = $(rowValue).text();
         var compareChar = rangeExp.charAt(0);
         var compareScale = rangeExp.charAt(rangeExp.length - 1);
         var compareValue = isNaN(parseFloat(compareScale)) ? parseFloat(rangeExp.substr(1, rangeExp.length - 2)) : parseFloat(rangeExp.substr(1, rangeExp.length - 1));



Mime
View raw message