You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by yu...@apache.org on 2012/12/09 13:05:14 UTC

svn commit: r1418901 - in /incubator/ambari/branches/AMBARI-666: ./ ambari-web/ ambari-web/app/ ambari-web/app/assets/data/clusters/ ambari-web/app/controllers/ ambari-web/app/controllers/global/ ambari-web/app/controllers/main/ ambari-web/app/controll...

Author: yusaku
Date: Sun Dec  9 12:05:10 2012
New Revision: 1418901

URL: http://svn.apache.org/viewvc?rev=1418901&view=rev
Log:
AMBARI-1059. Refactor cluster management. (yusaku)

Added:
    incubator/ambari/branches/AMBARI-666/ambari-web/app/assets/data/clusters/
    incubator/ambari/branches/AMBARI-666/ambari-web/app/assets/data/clusters/info.json
    incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/cluster_controller.js
    incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/global/
    incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/global/background_operations_controller.js
    incubator/ambari/branches/AMBARI-666/ambari-web/app/views/common/empty_view.js
Removed:
    incubator/ambari/branches/AMBARI-666/ambari-web/app/templates/main/service/background_operations_popup.hbs
Modified:
    incubator/ambari/branches/AMBARI-666/AMBARI-666-CHANGES.txt
    incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers.js
    incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main.js
    incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/apps_controller.js
    incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/charts/horizon_chart.js
    incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/host.js
    incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/service/info/audit.js
    incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/service/item.js
    incubator/ambari/branches/AMBARI-666/ambari-web/app/initialize.js
    incubator/ambari/branches/AMBARI-666/ambari-web/app/mappers/hosts_mapper.js
    incubator/ambari/branches/AMBARI-666/ambari-web/app/mappers/server_data_mapper.js
    incubator/ambari/branches/AMBARI-666/ambari-web/app/mappers/services_mapper.js
    incubator/ambari/branches/AMBARI-666/ambari-web/app/router.js
    incubator/ambari/branches/AMBARI-666/ambari-web/app/routes/main.js
    incubator/ambari/branches/AMBARI-666/ambari-web/app/styles/application.less
    incubator/ambari/branches/AMBARI-666/ambari-web/app/templates/main.hbs
    incubator/ambari/branches/AMBARI-666/ambari-web/app/templates/main/background_operations_popup.hbs
    incubator/ambari/branches/AMBARI-666/ambari-web/app/templates/main/host.hbs
    incubator/ambari/branches/AMBARI-666/ambari-web/app/templates/main/service/menu_item.hbs
    incubator/ambari/branches/AMBARI-666/ambari-web/app/utils/http_client.js
    incubator/ambari/branches/AMBARI-666/ambari-web/app/views.js
    incubator/ambari/branches/AMBARI-666/ambari-web/app/views/common/combobox.js
    incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/apps_view.js
    incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/host.js
    incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/menu.js
    incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/test.js
    incubator/ambari/branches/AMBARI-666/ambari-web/app/views/wizard/step2_view.js
    incubator/ambari/branches/AMBARI-666/ambari-web/package.json
    incubator/ambari/branches/AMBARI-666/ambari-web/pom.xml
    incubator/ambari/branches/AMBARI-666/ambari-web/vendor/scripts/bootstrap-combobox.js
    incubator/ambari/branches/AMBARI-666/ambari-web/vendor/styles/bootstrap-combobox.css

Modified: incubator/ambari/branches/AMBARI-666/AMBARI-666-CHANGES.txt
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/AMBARI-666-CHANGES.txt?rev=1418901&r1=1418900&r2=1418901&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/AMBARI-666-CHANGES.txt (original)
+++ incubator/ambari/branches/AMBARI-666/AMBARI-666-CHANGES.txt Sun Dec  9 12:05:10 2012
@@ -12,6 +12,9 @@ AMBARI-666 branch (unreleased changes)
 
   NEW FEATURES
 
+  AMBARI-976.  Hook HDFS/MapReduce/HBase/Host graphs to backend API
+  (Srimanth Gunturi via yusaku)
+
   AMBARI-964. Implement summary page of installer wizard. (Jaimin Jetly
   via yusaku)
 
@@ -392,7 +395,9 @@ AMBARI-666 branch (unreleased changes)
 
   IMPROVEMENTS
 
-  AMBARI-1058. Implement data loading (yusaku)
+  AMBARI-1059. Refactor cluster management. (yusaku)
+
+  AMBARI-1058. Implement data loading. (yusaku)
 
   AMBARI-956. On unavailability of non-master components, host with least
   number of master components should install all slave and client components. 

Added: incubator/ambari/branches/AMBARI-666/ambari-web/app/assets/data/clusters/info.json
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/assets/data/clusters/info.json?rev=1418901&view=auto
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/assets/data/clusters/info.json (added)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/assets/data/clusters/info.json Sun Dec  9 12:05:10 2012
@@ -0,0 +1,11 @@
+{
+  "href" : "http://ec2-107-21-153-79.compute-1.amazonaws.com:9998/clusters",
+  "items" : [
+    {
+      "href" : "http://ec2-107-21-153-79.compute-1.amazonaws.com:9998/clusters/mycluster",
+      "Clusters" : {
+        "cluster_name" : "mycluster"
+      }
+    }
+  ]
+}

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers.js?rev=1418901&r1=1418900&r2=1418901&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers.js Sun Dec  9 12:05:10 2012
@@ -22,6 +22,7 @@
 require('controllers/application');
 require('controllers/login_controller');
 require('controllers/installer');
+require('controllers/global/background_operations_controller');
 require('controllers/main');
 require('controllers/main/admin');
 require('controllers/main/admin/item');
@@ -58,4 +59,6 @@ require('controllers/wizard/step6_contro
 require('controllers/wizard/step7_controller');
 require('controllers/wizard/step8_controller');
 require('controllers/wizard/step9_controller');
-require('controllers/wizard/step10_controller');
\ No newline at end of file
+require('controllers/wizard/step10_controller');
+require('controllers/cluster_controller');
+require('controllers/cluster_controller');
\ No newline at end of file

Added: incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/cluster_controller.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/cluster_controller.js?rev=1418901&view=auto
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/cluster_controller.js (added)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/cluster_controller.js Sun Dec  9 12:05:10 2012
@@ -0,0 +1,86 @@
+/**
+ * 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.ClusterController = Em.Controller.extend({
+  name: 'clusterController',
+  cluster: null,
+  isLoaded: function(){
+    return true;
+    var loadList = this.get('dataLoadList');
+    var loaded = true;
+    for(var i in loadList){
+      if(loadList.hasOwnProperty(i) && !loadList[i]){
+        loaded = false;
+      }
+    }
+
+    return loaded;
+  }.property('dataLoadList'),
+  dataLoadList: Em.Object.create({
+    'hosts': true,
+    'services': false
+  }),
+  /**
+   * load cluster name
+   */
+  loadClusterName: function(){
+    var self = this;
+    var url = (App.testMode) ? '/data/clusters/info.json' : '/api/clusters';
+    $.ajax({
+      type: "GET",
+      url: url,
+      dataType: 'json',
+      timeout: 5000,
+      success: function (data) {
+        self.set('cluster', data.items[0]);
+        self.loadClusterData();
+      },
+      error: function (request, ajaxOptions, error) {
+        //do something
+        console.log('failed on loading cluster name')
+      },
+      statusCode: require('data/statusCodes')
+    });
+  },
+   /**
+   *
+   *  load all data and update load status
+   */
+  loadClusterData: function(){
+    var self = this;
+    if(!this.get('clusterName')){
+        return;
+    }
+    // TODO: load all models
+    /*App.HttpClient.get("/data/hosts/hosts.json", App.hostsMapper,{
+      complete:function(jqXHR, textStatus){
+        self.set('dataLoadList.hosts', true);
+      }
+    });*/
+    App.HttpClient.get("/data/dashboard/services.json", App.servicesMapper,{
+      complete:function(jqXHR, textStatus){
+        self.set('dataLoadList.services', true);
+      }
+    });
+  }.observes('clusterName'),
+  clusterName: function(){
+    return (this.get('cluster')) ? this.get('cluster').Clusters.cluster_name : 'mycluster';
+  }.property('cluster')
+})

Added: incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/global/background_operations_controller.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/global/background_operations_controller.js?rev=1418901&view=auto
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/global/background_operations_controller.js (added)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/global/background_operations_controller.js Sun Dec  9 12:05:10 2012
@@ -0,0 +1,194 @@
+/**
+ * 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.BackgroundOperationsController = Em.Controller.extend({
+  name: 'backgroundOperationsController',
+
+  /**
+   * Whether we need to refresh background operations or not
+   */
+  isWorking : false,
+
+  allOperations: [],
+  allOperationsCount : 0,
+
+  /**
+   * Update it every time when background operations for services are changed
+   */
+  serviceOperationsChangeTime: function(){
+    return (new Date().getTime());
+  }.property('hdfsOperations', 'mapReduceOperations'),
+
+  hdfsOperations : function(){
+    var all = this.get('allOperations');
+    var result = [];
+
+    all.forEach(function(item){
+      if( ['NAMENODE', 'SECONDARY_NAMENODE', 'DATANODE', 'HDFS_CLIENT', 'HDFS_SERVICE_CHECK'].contains(item.role)){
+        result.push(item);
+      }
+    })
+    return result;
+  }.property('allOperations.@each'),
+
+  mapReduceOperations : function(){
+    var all = this.get('allOperations');
+    var result = [];
+
+    all.forEach(function(item){
+      if( ['MAPREDUCE_CLIENT', 'JOBTRACKER', 'TASKTRACKER', 'MAPREDUCE_SERVICE_CHECK'].contains(item.role)){
+        result.push(item);
+      }
+    })
+    return result;
+
+  }.property('allOperations.@each'),
+
+  getOperationsFor: function(serviceName){
+    switch(serviceName.toUpperCase()){
+      case 'HDFS':
+        return this.get('hdfsOperations');
+      case 'MAPREDUCE':
+        return this.get('mapReduceOperations');
+      default:
+        return [];
+    }
+  },
+
+  updateInterval: 6000,
+  url : '',
+
+  generateUrl: function(){
+    var url = App.testMode ?
+      '/data/background_operations/list_on_start.json' :
+      '/api/clusters/' + App.router.getClusterName() + '/requests/?fields=tasks/*&tasks/Tasks/status!=COMPLETED';
+
+    this.set('url', url);
+    return url;
+  },
+
+  /**
+   * Reload operations
+   * We can call it manually <code>controller.loadOperations();</code>
+   * or it fires automatically, when <code>isWorking</code> becomes <code>true</code>
+   */
+  loadOperations : function(){
+
+    if(!this.get('isWorking')){
+      return;
+    }
+    var self = this;
+
+    var url = this.get('url');
+    if(!url){
+      url = this.generateUrl();
+    }
+
+    $.ajax({
+      type: "GET",
+      url: url,
+      dataType: 'json',
+      timeout: 5000,
+      success: function (data) {
+        //refresh model
+        self.updateBackgroundOperations(data);
+
+        //load data again if isWorking = true
+        if(self.get('isWorking')){
+          setTimeout(function(){
+            self.loadOperations();
+          }, self.get('updateInterval'));
+        }
+      },
+
+      error: function (request, ajaxOptions, error) {
+        console.log('cannot load background operations array');
+
+        //next code is temporary code to fix testMode issues
+        self.set('url', '/data/background_operations/list_on_start.json');
+        //load data again if isWorking = true
+        if(self.get('isWorking')){
+          setTimeout(function(){
+            self.loadOperations();
+          }, self.get('updateInterval'));
+        }
+      },
+
+      statusCode: require('data/statusCodes')
+    });
+
+  }.observes('isWorking'),
+
+  /**
+   * Add new operations to <code>this.allOperations</code> variable
+   * @param data json loaded from server
+   */
+  updateBackgroundOperations : function(data){
+    var runningTasks = [];
+    data.items.forEach(function (item) {
+      item.tasks.forEach(function (task) {
+        if (task.Tasks.status == 'QUEUED' || task.Tasks.status == 'PENDING') {
+          runningTasks.push(task.Tasks);
+        }
+      });
+    });
+
+    var currentTasks = this.get('allOperations');
+
+    runningTasks.forEach(function(item){
+      var task = currentTasks.findProperty('id', item.id);
+      if(task){
+        currentTasks[currentTasks.indexOf(task)] = item;
+      } else {
+        currentTasks.pushObject(item);
+      }
+    });
+
+    for(var i = currentTasks.length-1; i>=0; i--){
+      var isTaskFinished = !runningTasks.someProperty('id', currentTasks[i].id);
+      if(isTaskFinished){
+        currentTasks.removeAt(i);
+      }
+    }
+
+    this.set('allOperationsCount', currentTasks.length);
+  },
+
+  /**
+   * Onclick handler for background operations number located right to logo
+   */
+  showPopup: function(){
+    App.ModalPopup.show({
+      headerClass: Ember.View.extend({
+        controllerBinding: 'App.router.backgroundOperationsController',
+        template:Ember.Handlebars.compile('{{allOperationsCount}} Background Operations Running')
+      }),
+      bodyClass: Ember.View.extend({
+        controllerBinding: 'App.router.backgroundOperationsController',
+        templateName: require('templates/main/background_operations_popup')
+      }),
+      onPrimary: function() {
+        this.hide();
+      },
+      secondary : null
+    });
+  }
+
+});

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main.js?rev=1418901&r1=1418900&r2=1418901&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main.js Sun Dec  9 12:05:10 2012
@@ -21,108 +21,21 @@ require('models/background_operation');
 
 App.MainController = Em.Controller.extend({
   name: 'mainController',
-  backgroundOperations: [],
-  backgroundOperationsCount : 0,
-  backgroundOperationsUrl : '',
-  intervalId: false,
-  updateOperationsInterval: 6000,
-  clusters: App.Cluster.find(),
-  cluster: function(){
-    var clusters = this.get('clusters');
-    if(clusters){
-      var cluster = clusters.objectAt(0);
-      return cluster;
-    }
-  }.property('clusters'),
-  
-  startLoadOperationsPeriodically: function() {
-    this.loadBackgroundOperations();
-    this.intervalId = setInterval(this.loadBackgroundOperations, this.get('updateOperationsInterval'));
-  },
-  stopLoadOperationsPeriodically:function () {
-    if(this.intervalId) {
-      clearInterval(this.intervalId);
-    }
-    this.intervalId = false;
-  },
-  loadBackgroundOperations: function(){
-    var self = App.router.get('mainController');
-
-    var url = self.get('backgroundOperationsUrl');
-    if(!url){
-      //cache url, not to execute <code>getClusterName</code> everytime
-      url = (App.testMode) ?
-        '/data/background_operations/list_on_start.json' :
-        '/api/clusters/' + App.router.getClusterName() + '/requests/?fields=tasks/*&tasks/Tasks/status!=COMPLETED';
-      self.set('backgroundOperationsUrl', url);
-    }
-
-    $.ajax({
-      type: "GET",
-      url: url,
-      dataType: 'json',
-      timeout: 5000,
-      success: function (data) {
-        self.updateBackgroundOperations(data);
-      },
-
-      error: function (request, ajaxOptions, error) {
-        //do something
-      },
-
-      statusCode: require('data/statusCodes')
-    });
-  },
-
+  isClusterDataLoaded: function(){
+      return App.router.get('clusterController.isLoaded');
+  }.property('App.router.clusterController.isLoaded'),
   /**
-   * Add new operations to <code>this.backgroundOperations</code> variable
-   * @param data json loaded from server
+   * run all processes and cluster's data loading
    */
-  updateBackgroundOperations : function(data){
-    var runningTasks = [];
-    data.items.forEach(function (item) {
-      item.tasks.forEach(function (task) {
-        if (task.Tasks.status == 'QUEUED') {
-          runningTasks.push(task.Tasks);
-        }
-      });
-    });
-
-    var currentTasks = this.get('backgroundOperations');
-
-    runningTasks.forEach(function(item){
-      var task = currentTasks.findProperty('id', item.id);
-      if(task){
-        currentTasks[currentTasks.indexOf(task)] = item;
-      } else {
-        currentTasks.pushObject(item);
-      }
-    });
-
-    for(var i = currentTasks.length-1; i>=0; i--){
-      var isTaskFinished = !runningTasks.someProperty('id', currentTasks[i].id);
-      if(isTaskFinished){
-        currentTasks.removeAt(i);
-      }
-    }
-
-    this.set('backgroundOperationsCount', currentTasks.length);
-
+  initialize: function(){
+    this.startLoadOperationsPeriodically();
+    App.router.get('clusterController').loadClusterName();
   },
-
-  showBackgroundOperationsPopup: function(){
-    App.ModalPopup.show({
-      headerClass: Ember.View.extend({
-        controllerBinding: 'App.router.mainController',
-        template:Ember.Handlebars.compile('{{backgroundOperationsCount}} Background Operations Running')
-      }),
-      bodyClass: Ember.View.extend({
-        controllerBinding: 'App.router.mainController',
-        templateName: require('templates/main/background_operations_popup')
-      }),
-      onPrimary: function() {
-        this.hide();
-      }
-    });
+  startLoadOperationsPeriodically: function() {
+      App.router.get('backgroundOperationsController').set('isWorking', true);
+  },
+  stopLoadOperationsPeriodically:function () {
+    App.router.get('backgroundOperationsController').set('isWorking', false);
   }
+
 })
\ No newline at end of file

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/apps_controller.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/apps_controller.js?rev=1418901&r1=1418900&r2=1418901&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/apps_controller.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/apps_controller.js Sun Dec  9 12:05:10 2012
@@ -60,7 +60,7 @@ App.MainAppsController = Em.ArrayControl
    * @return {Boolean} true - record with this id exists, false - not exists
    */
   issetStaredRun: function(id) {
-    r = false;
+    var r = false;
     this.get('staredRuns').forEach(function(item){
       if (item.get('id') == id) {
         r = true;
@@ -68,12 +68,16 @@ App.MainAppsController = Em.ArrayControl
     });
     return r;
   },
+  /**
+   * Identifier of the last starred/unstarred run
+   */
   lastStarClicked: -1,
   /**
    * Click on star on table row
    * @return {Boolean} false for prevent default event handler
    */
   starClick: function(event) {
+    $(event.target).closest('table').find('.containerRow').remove(); // hack for valid "turning-off" star in table, where graphs row where enabled. We remove it
     event.target.classList.toggle('stared');
     var cell = event.target.parentNode.parentNode;
     var row = cell.parentNode;

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/charts/horizon_chart.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/charts/horizon_chart.js?rev=1418901&r1=1418900&r2=1418901&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/charts/horizon_chart.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/charts/horizon_chart.js Sun Dec  9 12:05:10 2012
@@ -19,5 +19,5 @@
 var App = require('app');
 
 App.MainChartsHorizonChartController = Em.Controller.extend({
-  name:'mainChartsHorizonChartController'
-})
\ No newline at end of file
+  name: 'mainChartsHorizonChartController'
+});
\ No newline at end of file

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/host.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/host.js?rev=1418901&r1=1418900&r2=1418901&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/host.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/host.js Sun Dec  9 12:05:10 2012
@@ -36,6 +36,7 @@ App.MainHostController = Em.ArrayControl
   allChecked:false,
   selectedHostsIds:[],
   selectedRack:null,
+
   assignHostsToRack:function () {
     var selectedRack = this.get('selectedRack');
     var sureMessage = this.t('hosts.assignToRack.sure');
@@ -54,7 +55,7 @@ App.MainHostController = Em.ArrayControl
       this.set('selectedHostsIds', []);
     }
 
-  }.observes('selectedRack'),
+  },
 
   sortingAsc:true,
   isSort:false,

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/service/info/audit.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/service/info/audit.js?rev=1418901&r1=1418900&r2=1418901&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/service/info/audit.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/service/info/audit.js Sun Dec  9 12:05:10 2012
@@ -20,4 +20,4 @@ var App = require('app');
 
 App.MainServiceInfoAuditController = Em.Controller.extend({
   name: 'mainServiceInfoAuditController'
-})
\ No newline at end of file
+});
\ No newline at end of file

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=1418901&r1=1418900&r2=1418901&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 12:05:10 2012
@@ -20,55 +20,7 @@ var App = require('app');
 
 App.MainServiceItemController = Em.Controller.extend({
   name: 'mainServiceItemController',
-  backgroundOperations: [],
-  taskId: 0,
-  intervalId: false,
-  checkOperationsInterval: 5000,
-  init: function(){
-    this._super();
-    this.startCheckOperationsLifeTime();
-  },
-  startCheckOperationsLifeTime: function () {
-    this.intervalId = setInterval(this.checkOperationsLifeTime, this.get('checkOperationsInterval'));
-  },
-  stopCheckOperationsLifeTime:function () {
-    if(this.intervalId) {
-      clearInterval(this.intervalId);
-    }
-    this.intervalId = false;
-  },
 
-  checkOperationsLifeTime: function () {
-    var self = App.router.get('mainServiceItemController');
-    var backgroundOperations = self.get('backgroundOperations');
-    var time = new Date().getTime();
-    if(backgroundOperations.length){
-      backgroundOperations.forEach(function (operation) {
-        if (time - operation.startTime >= 60*1000){
-          backgroundOperations.removeObject(operation);
-        }
-      })
-    }
-  },
-  createBackgroundOperation: function (role, command) {
-    var newTaskId = this.get('taskId') + 1;
-    this.set('taskId', newTaskId);
-    var operation = Em.Object.create({
-      taskId: newTaskId,
-      stageId: null,
-      serviceName: this.content.get('serviceName'),
-      role: role,
-      command: command,
-      status: null,
-      exitcode: 404,
-      stderror: 27,
-      stdout: 501,
-      startTime: new Date().getTime(),
-      attemptCount: null
-    })
-
-    return operation;
-  },
   /**
    * Send specific command to server
    * @param url
@@ -123,9 +75,7 @@ App.MainServiceItemController = Em.Contr
           }
         });
 
-        var newOperation = self.createBackgroundOperation('Service', 'Start');
-        newOperation.detail = "Another detail info";
-        self.addBackgroundOperation(newOperation);
+        App.router.get('backgroundOperationsController').showPopup();
         this.hide();
       },
       onSecondary: function() {
@@ -158,9 +108,7 @@ App.MainServiceItemController = Em.Contr
           }
         });
 
-        var newOperation = self.createBackgroundOperation('Service', 'Stop');
-        newOperation.detail = "Another detail info";
-        self.addBackgroundOperation(newOperation);
+        App.router.get('backgroundOperationsController').showPopup();
         this.hide();
       },
       onSecondary: function() {
@@ -177,9 +125,7 @@ App.MainServiceItemController = Em.Contr
       secondary: 'No',
       onPrimary: function() {
         self.content.set('runRebalancer', true);
-        var newOperation = self.createBackgroundOperation('Service', 'Run Rebalancer');
-        newOperation.detail = "Some detail info";
-        self.addBackgroundOperation(newOperation);
+        App.router.get('backgroundOperationsController').showPopup();
         this.hide();
       },
       onSecondary: function() {
@@ -196,8 +142,7 @@ App.MainServiceItemController = Em.Contr
       secondary: 'No',
       onPrimary: function() {
         self.content.set('runCompaction', true);
-        var newOperation = self.createBackgroundOperation('Service', 'Run Compaction');
-        self.addBackgroundOperation(newOperation);
+        App.router.get('backgroundOperationsController').showPopup();
         this.hide();
       },
       onSecondary: function() {
@@ -214,8 +159,7 @@ App.MainServiceItemController = Em.Contr
       secondary: 'No',
       onPrimary: function() {
         self.content.set('runSmokeTest', true);
-        var newOperation = self.createBackgroundOperation('Service', 'Run Smoke Test');
-        self.addBackgroundOperation(newOperation);
+        App.router.get('backgroundOperationsController').showPopup();
         this.hide();
       },
       onSecondary: function() {
@@ -236,33 +180,5 @@ App.MainServiceItemController = Em.Contr
         this.runSmokeTest();
         break;
     }
-  },
-  serviceOperations: function(){
-    var serviceName = this.get('content.serviceName');
-    return this.get('backgroundOperations').filterProperty('serviceName', serviceName);
-  }.property('backgroundOperations.length', 'content'),
-  serviceOperationsCount: function() {
-    return this.get('serviceOperations.length');
-  }.property('serviceOperations'),
-  showBackgroundOperationsPopup: function(){
-    console.log(this.get('backgroundOperations'));
-    App.ModalPopup.show({
-      headerClass: Ember.View.extend({
-        controllerBinding: 'App.router.mainServiceItemController',
-        template:Ember.Handlebars.compile('{{serviceOperationsCount}} Background Operations Running')
-      }),
-      bodyClass: Ember.View.extend({
-        controllerBinding: 'App.router.mainServiceItemController',
-        templateName: require('templates/main/service/background_operations_popup')
-      }),
-      onPrimary: function() {
-        this.hide();
-      }
-    });
-  },
-  addBackgroundOperation: function (operation) {
-    var backgroundOperations = this.get('backgroundOperations');
-    backgroundOperations.pushObject(operation);
-    this.showBackgroundOperationsPopup();
   }
 })
\ No newline at end of file

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=1418901&r1=1418900&r2=1418901&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 12:05:10 2012
@@ -33,6 +33,7 @@ require('router');
 
 require('mappers/server_data_mapper');
 require('mappers/services_mapper');
+require('mappers/hosts_mapper');
 
 require('utils/http_client');
 

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=1418901&r1=1418900&r2=1418901&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 12:05:10 2012
@@ -18,21 +18,5 @@
 
 //todo: refactor it
 App.hostsMapper = App.ServerDataMapper.create({
-  map: function (json) {
-    if (json.items) {
-      json.items.forEach(function (data) {
-        if (data.Hosts) {
-          App.store.createRecord(App.Host, {
-            id: data.Hosts.host_name,
-            hostName: data.Hosts.host_name,
-            cpuCount: data.Hosts.cpu_count,
-            totalMem: data.Hosts.total_mem,
-            osArch: data.Hosts.os_arch,
-            osType: data.Hosts.os_type,
-            ip: data.Hosts.ip
-          });
-        }
-      });
-    }
-  }
+  config: {}
 });

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/mappers/server_data_mapper.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/mappers/server_data_mapper.js?rev=1418901&r1=1418900&r2=1418901&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/mappers/server_data_mapper.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/mappers/server_data_mapper.js Sun Dec  9 12:05:10 2012
@@ -39,7 +39,44 @@ App.ServerDataMapper = Em.Object.extend(
 
 App.QuickDataMapper = App.ServerDataMapper.extend({
   config : {},
-  map : function(json){
-    //todo: move code here
+  map:function(json){
+    if(json.items){
+      var result = [];
+      json.items.forEach(function(item){
+        result.push(this.parseIt(item, this.config));
+      }, this)
+    App.store.loadMany(App.Service1, result);
+    }
+  },
+  parseIt : function(data, config){
+    var result = {};
+    for(var i in config){
+      if(i.substr(-4) !== '_key' && typeof config[i] == 'string'){
+        result[i] = this.getJsonProperty(data, config[i]);
+      } else if(typeof config[i] == 'object'){
+      result[i] = [];
+      var _data = data[config[i+'_key']];
+      var l = _data.length;
+      for(var index = 0; index<l; index++){
+        result[i].push(this.parseIt(_data[index], config[i]));
+      }
+      }
+    }
+    return result;
+  },
+  getJsonProperty:function(json, path){
+    var pathArr = path.split('.');
+    var current = json;
+    while(pathArr.length){
+      if(pathArr[0].substr(-1) == ']'){
+        var index = parseInt(pathArr[0].substr(-2,1));
+        var attr = pathArr[0].substr(0, pathArr[0].length-3);
+        current = current[attr][index];
+      } else {
+        current = current[pathArr[0]];
+      }
+      pathArr.splice(0,1);
+    }
+    return current;
   }
 });

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=1418901&r1=1418900&r2=1418901&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 12:05:10 2012
@@ -71,46 +71,5 @@ App.servicesMapper = App.QuickDataMapper
         state: 'host_components[0].HostRoles.state',
         host_name: 'host_components[0].HostRoles.host_name'
       }
-  },
-  map:function(json){
-    if(json.items){
-      var result = [];
-      json.items.forEach(function(item){
-        result.push(this.parseIt(item, this.config));
-      }, this)
-
-      App.store.loadMany(App.Service1, result);
-    }
-  },
-  parseIt : function(data, config){
-    var result = {};
-    for(var i in config){
-      if(i.substr(-4) !== '_key' && typeof config[i] == 'string'){
-        result[i] = this.getJsonProperty(data, config[i]);
-      } else if(typeof config[i] == 'object'){
-        result[i] = [];
-        var _data = data[config[i+'_key']];
-        var l = _data.length;
-        for(var index = 0; index<l; index++){
-          result[i].push(this.parseIt(_data[index], config[i]));
-        }
-      }
-    }
-    return result;
-  },
-  getJsonProperty:function(json, path){
-    var pathArr = path.split('.');
-    var current = json;
-    while(pathArr.length){
-      if(pathArr[0].substr(-1) == ']'){
-        var index = parseInt(pathArr[0].substr(-2,1));
-        var attr = pathArr[0].substr(0, pathArr[0].length-3);
-        current = current[attr][index];
-      } else {
-        current = current[pathArr[0]];
-      }
-      pathArr.splice(0,1);
-    }
-    return current;
   }
 });

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/router.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/router.js?rev=1418901&r1=1418900&r2=1418901&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/router.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/router.js Sun Dec  9 12:05:10 2012
@@ -32,7 +32,6 @@ App.Router = Em.Router.extend({
     var previousStep = parseInt(this.getInstallerCurrentStep());
     this.set('isFwdNavigation', newStep >= previousStep);
   },
-
   clearAllSteps: function() {
     this.get('installerController.content').set('cluster',null);
     this.get('wizardStep2Controller').set('hasSubmitted',false);
@@ -54,7 +53,7 @@ App.Router = Em.Router.extend({
    * @return {*}
    */
   getClusterName: function(){
-    return App.db.getClusterName();
+    return App.router.get('clusterController').get('clusterName');
   },
 
 

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/routes/main.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/routes/main.js?rev=1418901&r1=1418900&r2=1418901&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/routes/main.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/routes/main.js Sun Dec  9 12:05:10 2012
@@ -21,7 +21,7 @@ module.exports = Em.Route.extend({
   enter:function (router) {
     console.log('in /main:enter');
     if (router.getAuthenticated()) {
-      router.get('mainController').startLoadOperationsPeriodically();
+      router.get('mainController').initialize();
       // TODO: redirect to last known state
     } else {
       Ember.run.next(function () {

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=1418901&r1=1418900&r2=1418901&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 12:05:10 2012
@@ -219,15 +219,20 @@ h1 {
       border: 1px solid #ccc;
       margin-top: 5px;
       padding: 8px;
-      font-family: Consolas,"Liberation Mono",Courier,monospace;
+      font-family: Consolas, "Liberation Mono", Courier, monospace;
+    }
+    .sshKey-file-view.disabled {
+      background-color: #eee;
     }
     .manual-install {
       margin-top: 10px;
+      width: 504px;
+      height: auto;
     }
     #targetHosts {
 
     }
-    .span6{
+    .span6 {
       min-width: 504px;
     }
     #hostConnectivity {
@@ -769,12 +774,12 @@ a:focus {
   .health-status-DEAD-YELLOW {
     background-image: @status-dead-yellow-marker;
   }
-  .host-name-search{
+  .host-name-search {
     position: relative;
     top: 0px;
     left: 10px;
   }
-  .host-name-pos{
+  .host-name-pos {
     position: relative;
     top: 10px;
   }
@@ -882,138 +887,140 @@ a:focus {
       }
     }
   }
-  }
+}
 
-  #host-details {
+#host-details {
 
-    margin-top: 27px;
+  margin-top: 27px;
 
-    .component-operation-button{
-      background-color: #E5E5E5;
-      background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#E5E5E5), to(#F1F1F1));
-      background-image: -webkit-linear-gradient(top, #E5E5E5, #F1F1F1);
-      background-image: -o-linear-gradient(top, #E5E5E5, #F1F1F1);
-      background-image: linear-gradient(to bottom, #E5E5E5, #F1F1F1);
-      background-image: -moz-linear-gradient(top, #E5E5E5, #F1F1F1);
-      background-repeat: repeat-x;
-      color:#000000;
-    }
-    .caret{
-      border-top-color: #000000;
-      border-bottom-color: #000000;
-    }
-    .health-status-STARTED, .health-status-STARTING {
-      background-image: @status-live-marker;
-      background-repeat: no-repeat;
-      background-position: 0px 4px;
-    }
-    .health-status-STOPPED, .health-status-STOPPING {
-      background-image: @status-dead-marker;
-      background-repeat: no-repeat;
-      background-position: 0px 4px;
-    }
-    .span3.host-components {
-        width: 300px;
-    }
+  .component-operation-button {
+    background-color: #E5E5E5;
+    background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#E5E5E5), to(#F1F1F1));
+    background-image: -webkit-linear-gradient(top, #E5E5E5, #F1F1F1);
+    background-image: -o-linear-gradient(top, #E5E5E5, #F1F1F1);
+    background-image: linear-gradient(to bottom, #E5E5E5, #F1F1F1);
+    background-image: -moz-linear-gradient(top, #E5E5E5, #F1F1F1);
+    background-repeat: repeat-x;
+    color: #000000;
+  }
+  .caret {
+    border-top-color: #000000;
+    border-bottom-color: #000000;
+  }
+  .health-status-STARTED, .health-status-STARTING {
+    background-image: @status-live-marker;
+    background-repeat: no-repeat;
+    background-position: 0px 4px;
+  }
+  .health-status-STOPPED, .health-status-STOPPING {
+    background-image: @status-dead-marker;
+    background-repeat: no-repeat;
+    background-position: 0px 4px;
+  }
+  .span3.host-components {
+    width: 300px;
+  }
 
-    .health-status-LIVE {
-      background-image: @status-live-marker;
-      background-repeat: no-repeat;
-      background-position: 0px 4px;
-    }
-    .health-status-DEAD {
-      background-image: @status-dead-marker;
-      background-repeat: no-repeat;
-      background-position: 0px 4px;
-    }
-    .health-status-DEAD-ORANGE {
-      background-image: @status-dead-orange-marker;
-      background-repeat: no-repeat;
-      background-position: 0px 4px;
-    }
-    .health-status-DEAD-YELLOW {
-      background-image: @status-dead-yellow-marker;
-      background-repeat: no-repeat;
-      background-position: 0px 4px;
-    }
-    .back {
-      display: block;
-      width: 105px;
-      margin-bottom: 5px;
-    }
-    .box-header .host-title {
-      margin: 0;
-      padding-left: 17px;
-    }
-    .box-header .button-section {
-      margin-bottom: 5px;
-    }
-    hr {
-      margin-bottom: 0;
-      clear: both;
-    }
-    .content {
-      padding: 10px;
-    }
-    .host-configuration .dl-horizontal dt {
-      width: 90px;
-      line-height: 20px;
-    }
-    .host-configuration .dl-horizontal dd {
-      margin-left: 100px;
-      line-height: 20px;
-    }
-    .host-metrics{
-      [class*="span"] {
-        float: left;
-        margin-left: 10px;
-      }
-      .chart-container {
-        .chart-x-axis {
-          left: 30%;
-          width: 40%;
-        }
-      }
-    }
-    
-    .host-components {
-      padding: 10px;
-      padding-bottom: 0;
-      border: 1px solid #DEDEDE;
-      border-radius: 4px;
-      background: #F5F5F5;
+  .health-status-LIVE {
+    background-image: @status-live-marker;
+    background-repeat: no-repeat;
+    background-position: 0px 4px;
+  }
+  .health-status-DEAD {
+    background-image: @status-dead-marker;
+    background-repeat: no-repeat;
+    background-position: 0px 4px;
+  }
+  .health-status-DEAD-ORANGE {
+    background-image: @status-dead-orange-marker;
+    background-repeat: no-repeat;
+    background-position: 0px 4px;
+  }
+  .health-status-DEAD-YELLOW {
+    background-image: @status-dead-yellow-marker;
+    background-repeat: no-repeat;
+    background-position: 0px 4px;
+  }
+  .back {
+    display: block;
+    width: 105px;
+    margin-bottom: 5px;
+  }
+  .box-header .host-title {
+    margin: 0;
+    padding-left: 17px;
+  }
+  .box-header .button-section {
+    margin-bottom: 5px;
+  }
+  hr {
+    margin-bottom: 0;
+    clear: both;
+  }
+  .content {
+    padding: 10px;
+  }
+  .host-configuration .dl-horizontal dt {
+    width: 90px;
+    line-height: 20px;
+  }
+  .host-configuration .dl-horizontal dd {
+    margin-left: 100px;
+    line-height: 20px;
+  }
+  .host-metrics {
+    [class*="span"] {
+      float: left;
+      margin-left: 10px;
     }
-    .host-components .btn-group {
-      margin: 0 5px 10px 0;
-      .components-health{
-        margin-top: 4px;
-        width:13px;
-        height: 13px;
-        float:left;
-        background-position: center center;
+    .chart-container {
+      .chart-x-axis {
+        left: 30%;
+        width: 40%;
       }
     }
   }
-  .background-operations {
-    .open-details {
-      clear: left;
-      display: block;
+
+  .host-components {
+    padding: 10px;
+    padding-bottom: 0;
+    border: 1px solid #DEDEDE;
+    border-radius: 4px;
+    background: #F5F5F5;
+  }
+  .host-components .btn-group {
+    margin: 0 5px 10px 0;
+    .components-health {
+      margin-top: 4px;
+      width: 13px;
+      height: 13px;
       float: left;
-      text-decoration: none;
-      width: 16px;
-    }
-    .operation-details {
-      padding-left: 16px;
-      padding-top: 5px;
-      display: none;
+      background-position: center center;
     }
-    margin-bottom: 10px;
   }
-  .background-operations.is-open {
-    .operation-details {
-      display: block;
-    }
+}
+
+.background-operations {
+  .open-details {
+    clear: left;
+    display: block;
+    float: left;
+    text-decoration: none;
+    width: 16px;
+  }
+  .operation-details {
+    padding-left: 16px;
+    padding-top: 5px;
+    display: none;
   }
+  margin-bottom: 10px;
+}
+
+.background-operations.is-open {
+  .operation-details {
+    display: block;
+  }
+}
 
 /*End Hosts*/
 
@@ -1645,13 +1652,13 @@ ul.inline li {
 
 /* End Carousel*/
 
-#add-host .back{
+#add-host .back {
   display: block;
   width: 105px;
   margin-bottom: 10px;
 }
 
-#add-service .back{
+#add-service .back {
   display: block;
   width: 130px;
   margin-bottom: 10px;
@@ -1660,6 +1667,20 @@ ul.inline li {
 #step8-content {
   max-height: 440px;
 }
+
 #step10-content {
   max-height: 440px;
 }
+
+//bootstrap
+//.dropdown-menu .active > a, .dropdown-menu .active > a:hover {
+//  background-color: #49AFCD;
+//  background-image: -moz-linear-gradient(center top, #5BC0DE, #2F96B4);
+//}
+//bootstrap end
+
+// COMBOBOX FIXES
+.combobox-container .btn:hover {
+  background-position: 0;
+}
+// COMBOBOX FIXES END

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/templates/main.hbs
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/templates/main.hbs?rev=1418901&r1=1418900&r2=1418901&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/templates/main.hbs (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/templates/main.hbs Sun Dec  9 12:05:10 2012
@@ -15,17 +15,25 @@
 * See the License for the specific language governing permissions and
 * limitations under the License.
 -->
+{{#if isClusterDataLoaded}}
 <div id="main-nav">
   <div class="navbar">
     <div class="navbar-inner">
       <a class="brand" href="#">
         My Cluster
-          {{#if backgroundOperationsCount}}
-            <span class="label operations-count" {{action "showBackgroundOperationsPopup" target="controller"}}>{{backgroundOperationsCount}}</span>
-          {{/if}}
+
+          {{#view App.EmptyView controllerBinding="App.router.backgroundOperationsController"}}
+            {{#if allOperationsCount}}
+              <span class="label operations-count" {{action "showPopup" target="controller"}}>{{allOperationsCount}}</span>
+            {{/if}}
+          {{/view}}
+
       </a>
       {{view App.MainMenuView}}
     </div>
   </div>
 </div>
-{{outlet}}
\ No newline at end of file
+{{outlet}}
+{{else}}
+<h2>loading...</h2>
+{{/if}}
\ No newline at end of file

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=1418901&r1=1418900&r2=1418901&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 12:05:10 2012
@@ -15,7 +15,7 @@
 * See the License for the specific language governing permissions and
 * limitations under the License.
 -->
-{{#each operation in backgroundOperations}}
+{{#each operation in allOperations}}
   {{#view App.MainBackgroundOperation contentBinding="operation"}}
     <a class="open-details" {{action openDetails target="view"}} href="#">
       <i {{bindAttr class="view.iconClass"}}></i>

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=1418901&r1=1418900&r2=1418901&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 12:05:10 2012
@@ -18,7 +18,16 @@
 <div id="hosts" class="box">
   <div class="box-header">
     <div class="button-section">
-      {{view view.RackCombobox}}
+      <div>
+        <div class="span3">
+          {{view view.RackCombobox}}
+        </div>
+        <div class="span">
+          <button {{bindAttr disabled="view.assignRackButtonDisabled"}} class="btn" {{action assignHostsToRack target="App.router.mainHostController"}}>
+            Assign
+          </button>
+        </div>
+      </div>
       <button class="btn btn-inverse add-host-button" {{action addHost}}>
         <i class="icon-plus icon-white"></i>
         Add New Hosts

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/templates/main/service/menu_item.hbs
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/templates/main/service/menu_item.hbs?rev=1418901&r1=1418900&r2=1418901&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/templates/main/service/menu_item.hbs (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/templates/main/service/menu_item.hbs Sun Dec  9 12:05:10 2012
@@ -17,9 +17,9 @@
 -->
 
 <a href="#/main/services/{{unbound view.content.id}}/summary">
-  {{view App.MainDashboardServiceHealthView serviceBinding="view.content"}}&nbsp;<span>{{unbound view.content.displayName}}</span>
+  {{view App.MainDashboardServiceHealthView serviceBinding="view.content"}}&nbsp;<span>{{unbound view.content.label}}</span>
   {{#if view.serviceOperationsCount}}
-    <span class="label operations-count" {{action "showBackgroundOperationsPopup" target="App.router.mainServiceItemController"}}>
+    <span class="label operations-count" {{action "showPopup" target="App.router.backgroundOperationsController"}}>
       {{view.serviceOperationsCount}}
     </span>
   {{/if}}

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/utils/http_client.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/utils/http_client.js?rev=1418901&r1=1418900&r2=1418901&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/utils/http_client.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/utils/http_client.js Sun Dec  9 12:05:10 2012
@@ -108,10 +108,6 @@ App.HttpClient = Em.Object.create({
 //  }
 });
 
-//App.HttpClient.get("/data/hosts/hosts.json", App.hostsMapper);
-
-App.HttpClient.get("/data/dashboard/services.json", App.servicesMapper);
-
 /*App.HttpClient.get(
   'http://nagiosserver/hdp/nagios/nagios_alerts.php?q1=alerts&alert_type=all',
   App.alertsMapper,

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/views.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/views.js?rev=1418901&r1=1418900&r2=1418901&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/views.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/views.js Sun Dec  9 12:05:10 2012
@@ -31,6 +31,7 @@ require('views/common/metric');
 require('views/common/time_range');
 require('views/common/form/field');
 require('views/common/quick_view_link_view');
+require('views/common/empty_view');
 require('views/login');
 require('views/main');
 require('views/main/test');

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/views/common/combobox.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/views/common/combobox.js?rev=1418901&r1=1418900&r2=1418901&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/views/common/combobox.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/views/common/combobox.js Sun Dec  9 12:05:10 2012
@@ -59,9 +59,17 @@ App.Combobox = Em.Select.extend({
     this.get('combobox').clearTarget();
 
   },
+
+  test:function () {
+    console.warn("qwerty");
+  },
+
   didInsertElement:function () {
     this._super();
-    this.set('combobox', this.$().combobox().data('combobox'));
+
+    this.set('combobox', this.$().combobox({
+      template:'<div class="combobox-container"><input type="text" autocomplete="off" /><button class="add-on btn dropdown-toggle" data-dropdown="dropdown"><span class="caret"/><span class="combobox-clear"><i class="icon-remove"/></span></button></div>'
+    }).data('combobox'));
 
     this.clearTextFieldValue(); // fix of script tags in
 

Added: incubator/ambari/branches/AMBARI-666/ambari-web/app/views/common/empty_view.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/views/common/empty_view.js?rev=1418901&view=auto
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/views/common/empty_view.js (added)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/views/common/empty_view.js Sun Dec  9 12:05:10 2012
@@ -0,0 +1,24 @@
+/**
+ * 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.EmptyView = Em.View.extend({
+  tagName : ''
+});
+

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/apps_view.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/apps_view.js?rev=1418901&r1=1418900&r2=1418901&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/apps_view.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/apps_view.js Sun Dec  9 12:05:10 2012
@@ -237,6 +237,8 @@ App.MainAppsView = Em.View.extend({
     if (perPage !== -1) { // Change page after reDraw (if show All is selected this will not happens)
       this.get('oTable').fnPageChange(Math.floor(rowIndex / perPage));
     }
+    var d = this.get('oTable').fnGetData();
+    console.log(this.get('oTable').fnSettings()['aiDisplay']);
   }.observes('controller.lastStarClicked'),
   /**
    * Flush all starred runs

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/host.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/host.js?rev=1418901&r1=1418900&r2=1418901&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/host.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/host.js Sun Dec  9 12:05:10 2012
@@ -143,6 +143,16 @@ App.MainHostView = Em.View.extend({
     placeholderText:Em.I18n.t('hosts.assignRack'),
     selectionBinding:"App.router.mainHostController.selectedRack",
     optionLabelPath:"content.clusterName",
-    optionValuePath:"content.id"
-  })
+    optionValuePath:"content.id",
+    didInsertElement:function () {
+      this._super();
+      App.router.get('mainHostController').propertyDidChange('selectedHostsIds');
+    }
+  }),
+
+  assignRackButtonDisabled:function () {
+    var selectedHostsIds = App.router.get('mainHostController.selectedHostsIds');
+    var rack = App.router.get('mainHostController.selectedRack');
+    return (selectedHostsIds.length && rack && rack.constructor == 'App.Cluster') ? false : "disabled";
+  }.property('App.router.mainHostController.selectedHostsIds', 'App.router.mainHostController.selectedRack')
 });
\ No newline at end of file

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/menu.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/menu.js?rev=1418901&r1=1418900&r2=1418901&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/menu.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/menu.js Sun Dec  9 12:05:10 2012
@@ -62,10 +62,9 @@ App.MainServiceMenuView = Em.CollectionV
     classNameBindings: ["active"],
     active: "",
     serviceOperationsCount: function () {
-      if (this.get('content.id') == App.router.get('mainServiceItemController.content.id')) {
-        return App.router.get('mainServiceItemController.serviceOperationsCount');
-      }
-    }.property('App.router.mainServiceItemController.serviceOperationsCount'),
+      var operations = App.router.get('backgroundOperationsController').getOperationsFor(this.get('content.serviceName'));
+      return operations.length;
+    }.property('App.router.backgroundOperationsController.serviceOperationsChangeTime'),
 
     templateName: require('templates/main/service/menu_item')
   })

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/test.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/test.js?rev=1418901&r1=1418900&r2=1418901&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/test.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/test.js Sun Dec  9 12:05:10 2012
@@ -20,5 +20,9 @@ var App = require('app');
 
 App.MainTestView = Em.View.extend({
   templateName: require('templates/main/test'),
-  services: App.Service1.find()
+  services: App.Service1.find(),
+  hosts: function(){
+      console.log(App.Host.find());
+      return 'hosts';
+  }.property()
 });

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/views/wizard/step2_view.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/views/wizard/step2_view.js?rev=1418901&r1=1418900&r2=1418901&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/views/wizard/step2_view.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/views/wizard/step2_view.js Sun Dec  9 12:05:10 2012
@@ -75,8 +75,16 @@ App.WizardStep2View = Em.View.extend({
   }.property(),
 
   sshKeyPreviewClass: function() {
-    return (this.get('controller.content.sshKey').trim() != '') ? 'sshKey-file-view help-inline' : 'hidden';
-  }.property('controller.content.sshKey')
+    if (this.get('controller.content.sshKey').trim() != '') {
+      if (this.get('controller.content.manualInstall')) {
+        return 'sshKey-file-view disabled';
+      } else {
+        return 'sshKey-file-view';
+      }
+    } else {
+      return 'hidden';
+    }
+  }.property('controller.content.sshKey', 'controller.content.manualInstall')
 
 });
 

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/package.json
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/package.json?rev=1418901&r1=1418900&r2=1418901&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/package.json (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/package.json Sun Dec  9 12:05:10 2012
@@ -1,31 +1,32 @@
 {
-  "name": "Ambari",
-  "description": "Front-end package for the Apache Ambari Project",
-  "version": "1.0.0",
-  "homepage": "",
-  "repository": {
-    "type": "git",
-    "url": ""
+  "name":"Ambari",
+  "description":"Front-end package for the Apache Ambari Project",
+  "version":"1.0.0",
+  "homepage":"",
+  "repository":{
+    "type":"git",
+    "url":""
   },
-  "engines": {
-    "node": "~0.6.10 || 0.8 || 0.9"
+  "engines":{
+    "node":"~0.6.10 || 0.8 || 0.9"
   },
-  "scripts": {
-    "start": "brunch watch --server"
+  "scripts":{
+    "start":"brunch watch --server"
   },
-  "dependencies": {
-    "javascript-brunch": ">= 1.0 < 1.5",
-    "css-brunch": ">= 1.0 < 1.5",
-    "uglify-js-brunch": ">= 1.0 < 1.5",
-    "clean-css-brunch": ">= 1.0 < 1.5",
-    "ember-handlebars-brunch": "git://github.com/icholy/ember-handlebars-brunch.git",
-    "less-brunch": "git://github.com/brunch/less-brunch.git"
+  "dependencies":{
+    "javascript-brunch":">= 1.0 < 1.5",
+    "css-brunch":">= 1.0 < 1.5",
+    "uglify-js-brunch":">= 1.0 < 1.5",
+    "clean-css-brunch":">= 1.0 < 1.5",
+    "ember-handlebars-brunch":"git://github.com/icholy/ember-handlebars-brunch.git",
+    "less-brunch":"git://github.com/brunch/less-brunch.git"
   },
-  "devDependencies": {
-    "mocha": "0.14.0",
-    "chai": "1.2.0",
-    "sinon": "1.4.2",
-    "sinon-chai": "2.1.2",
-    "express": "2.5.8"
+  "devDependencies":{
+    "mocha":"0.14.0",
+    "chai":"1.2.0",
+    "sinon":"1.4.2",
+    "sinon-chai":"2.1.2",
+    "express":"2.5.8",
+    "jsdom":"0.2.19"
   }
 }

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/pom.xml
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/pom.xml?rev=1418901&r1=1418900&r2=1418901&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/pom.xml (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/pom.xml Sun Dec  9 12:05:10 2012
@@ -9,14 +9,19 @@
   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. -->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <parent>
+    <groupId>org.apache.ambari</groupId>
+    <artifactId>ambari-project</artifactId>
+    <version>1.0.3-SNAPSHOT</version>
+    <relativePath>../ambari-project</relativePath>
+  </parent>
   <modelVersion>4.0.0</modelVersion>
   <groupId>org.apache.ambari</groupId>
   <artifactId>ambari-web</artifactId>
   <packaging>pom</packaging>
   <name>Ambari Web</name>
-  <version>1.0.3</version>
+  <version>1.0.3-SNAPSHOT</version>
   <description>Ambari Web</description>
   <dependencies>
     <dependency>
@@ -40,6 +45,9 @@
             </goals>
             <configuration>
               <target name="ambari-web-compile">
+                <exec dir="${basedir}" executable="npm" failonerror="false">
+                  <arg value="install"/>
+                </exec>
                 <exec dir="${basedir}" executable="brunch" failonerror="false">
                   <arg value="build"/>
                 </exec>
@@ -73,7 +81,7 @@
                   <fileset dir="${basedir}/../ambari-web/public"/>
                 </copy>
                 -->
-                <symlink overwrite="true" link="${basedir}/../ambari-server/target/ambari-server-${project.version}/ambari-server-${project.version}/web" resource="${basedir}/public" failonerror="false" />
+                <symlink overwrite="true" link="${basedir}/../ambari-server/target/ambari-server-${project.version}-dist/ambari-server-${project.version}/web" resource="${basedir}/public" failonerror="false"/>
               </target>
             </configuration>
           </execution>

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/vendor/scripts/bootstrap-combobox.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/vendor/scripts/bootstrap-combobox.js?rev=1418901&r1=1418900&r2=1418901&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/vendor/scripts/bootstrap-combobox.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/vendor/scripts/bootstrap-combobox.js Sun Dec  9 12:05:10 2012
@@ -135,6 +135,14 @@
         this.$element.on('keydown', $.proxy(this.keypress, this))
       }
 
+//      hide menu hack
+      this.$button.on('mouseenter', $.proxy(this.addClassOnMouseEnter, this.$button))
+        .on('mouseleave', $.proxy(this.addClassOnMouseLeave, this.$button));
+
+      $(window).on('click', $.proxy(this.hideList, this));
+//      hide menu hack end
+
+
       this.$menu
         .on('click', $.proxy(this.click, this))
         .on('mouseenter', 'li', $.proxy(this.mouseenter, this))
@@ -173,10 +181,20 @@
 
       e.stopPropagation()
       e.preventDefault()
-    }
+    },
+
+    addClassOnMouseEnter:function (e) {
+      console.warn("Enter");
+      this.addClass('hover');
+    },
+
+    addClassOnMouseLeave:function (e) {
+      console.warn("Leave");
+      this.removeClass('hover');
+    },
 
     // modified typeahead function to only hide menu if it is visible
-    , blur:function (e) {
+    blur:function (e) {
       var that = this
       e.stopPropagation()
       e.preventDefault()
@@ -190,6 +208,21 @@
           that.hide()
         }, 150)
       }
+    },
+
+    /**
+     * hide list
+     * @param e
+     */
+    hideList:function (e) {
+      if (!this.$button.is(".hover")) {
+        var that = this;
+        if (this.shown) {
+          setTimeout(function () {
+            that.hide()
+          }, 150)
+        }
+      }
     }
   })
 
@@ -207,7 +240,7 @@
   }
 
   $.fn.combobox.defaults = {
-    template:'<div class="combobox-container"><input type="text" autocomplete="off" /><button class="add-on btn dropdown-toggle" data-dropdown="dropdown"><span class="caret"/><span class="combobox-clear"><i class="icon-remove"/></span></button></div>',
+    template:'<div class="combobox-container"><input type="text" autocomplete="off" /><span class="add-on btn dropdown-toggle" data-dropdown="dropdown"><span class="caret"/><span class="combobox-clear"><i class="icon-remove"/></span></span></div>',
     menu:'<ul class="typeahead typeahead-long dropdown-menu"></ul>',
     item:'<li><a href="#"></a></li>', placeholder:null
   }

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/vendor/styles/bootstrap-combobox.css
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/vendor/styles/bootstrap-combobox.css?rev=1418901&r1=1418900&r2=1418901&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/vendor/styles/bootstrap-combobox.css (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/vendor/styles/bootstrap-combobox.css Sun Dec  9 12:05:10 2012
@@ -140,6 +140,7 @@
 .open.btn-group .combobox-clear {
     opacity: 1;
     filter: alpha(opacity = 100);
+
 }
 
 .typeahead-long {