incubator-ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yus...@apache.org
Subject svn commit: r1393835 [1/2] - in /incubator/ambari/branches/AMBARI-666: ./ ambari-web/app/ ambari-web/app/controllers/ ambari-web/app/controllers/installer/ ambari-web/app/controllers/main/ ambari-web/app/controllers/main/admin/ ambari-web/app/controlle...
Date Wed, 03 Oct 2012 23:49:00 GMT
Author: yusaku
Date: Wed Oct  3 23:48:57 2012
New Revision: 1393835

URL: http://svn.apache.org/viewvc?rev=1393835&view=rev
Log:
AMBARI-802. Enhance Cluster Management pages. (yusaku)

Added:
    incubator/ambari/branches/AMBARI-666/ambari-web/app/data/mock/service_components.js
    incubator/ambari/branches/AMBARI-666/ambari-web/app/templates/common/grid/filter.hbs
    incubator/ambari/branches/AMBARI-666/ambari-web/app/templates/common/grid/pager.hbs
    incubator/ambari/branches/AMBARI-666/ambari-web/app/views/common/grid.js
    incubator/ambari/branches/AMBARI-666/ambari-web/test/main/
    incubator/ambari/branches/AMBARI-666/ambari-web/test/main/dashboard_test.js
    incubator/ambari/branches/AMBARI-666/ambari-web/test/main/host/
    incubator/ambari/branches/AMBARI-666/ambari-web/test/main/host/details_test.js
    incubator/ambari/branches/AMBARI-666/ambari-web/test/main/host_test.js
    incubator/ambari/branches/AMBARI-666/ambari-web/test/main/item_test.js
    incubator/ambari/branches/AMBARI-666/ambari-web/test/utils/form_field_test.js
Removed:
    incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/installer/step3.js
    incubator/ambari/branches/AMBARI-666/ambari-web/app/templates/main/hosts.hbs
    incubator/ambari/branches/AMBARI-666/ambari-web/app/templates/main/service/info/audit.hbs
    incubator/ambari/branches/AMBARI-666/ambari-web/app/views/installer/step1.js
    incubator/ambari/branches/AMBARI-666/ambari-web/app/views/installer/step2.js
    incubator/ambari/branches/AMBARI-666/ambari-web/app/views/installer/step3.js
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/login_controller.js
    incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main.js
    incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/admin.js
    incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/admin/advanced.js
    incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/admin/authentication.js
    incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/admin/item.js
    incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/admin/user.js
    incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/admin/user/edit.js
    incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/alert.js
    incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/dashboard.js
    incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/host.js
    incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/host/details.js
    incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/service.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/info/configs.js
    incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/service/info/metrics.js
    incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/service/info/summary.js
    incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/service/item.js
    incubator/ambari/branches/AMBARI-666/ambari-web/app/messages.js
    incubator/ambari/branches/AMBARI-666/ambari-web/app/models/authentication.js
    incubator/ambari/branches/AMBARI-666/ambari-web/app/models/cluster.js
    incubator/ambari/branches/AMBARI-666/ambari-web/app/models/form.js
    incubator/ambari/branches/AMBARI-666/ambari-web/app/models/pagination.js
    incubator/ambari/branches/AMBARI-666/ambari-web/app/models/service.js
    incubator/ambari/branches/AMBARI-666/ambari-web/app/models/service_audit.js
    incubator/ambari/branches/AMBARI-666/ambari-web/app/models/user.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/app.css
    incubator/ambari/branches/AMBARI-666/ambari-web/app/styles/application.less
    incubator/ambari/branches/AMBARI-666/ambari-web/app/templates/common/grid/header.hbs
    incubator/ambari/branches/AMBARI-666/ambari-web/app/templates/installer/step3.hbs
    incubator/ambari/branches/AMBARI-666/ambari-web/app/templates/main/admin.hbs
    incubator/ambari/branches/AMBARI-666/ambari-web/app/templates/main/admin/audit.hbs
    incubator/ambari/branches/AMBARI-666/ambari-web/app/templates/main/admin/authentication.hbs
    incubator/ambari/branches/AMBARI-666/ambari-web/app/templates/main/admin/security.hbs
    incubator/ambari/branches/AMBARI-666/ambari-web/app/templates/main/admin/user.hbs
    incubator/ambari/branches/AMBARI-666/ambari-web/app/templates/main/admin/user/edit.hbs
    incubator/ambari/branches/AMBARI-666/ambari-web/app/templates/main/dashboard.hbs
    incubator/ambari/branches/AMBARI-666/ambari-web/app/templates/main/host.hbs
    incubator/ambari/branches/AMBARI-666/ambari-web/app/templates/main/host/details.hbs
    incubator/ambari/branches/AMBARI-666/ambari-web/app/templates/main/host/summary.hbs
    incubator/ambari/branches/AMBARI-666/ambari-web/app/templates/main/service/info/summary.hbs
    incubator/ambari/branches/AMBARI-666/ambari-web/app/utils/db.js
    incubator/ambari/branches/AMBARI-666/ambari-web/app/utils/helper.js
    incubator/ambari/branches/AMBARI-666/ambari-web/app/utils/validator.js
    incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/admin/audit.js
    incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/admin/menu.js
    incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/host.js
    incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/host/summary.js
    incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/info/audit.js
    incubator/ambari/branches/AMBARI-666/ambari-web/test/login_test.js
    incubator/ambari/branches/AMBARI-666/ambari-web/test/utils/validator_test.js

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=1393835&r1=1393834&r2=1393835&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/AMBARI-666-CHANGES.txt (original)
+++ incubator/ambari/branches/AMBARI-666/AMBARI-666-CHANGES.txt Wed Oct  3 23:48:57 2012
@@ -12,6 +12,8 @@ AMBARI-666 branch (unreleased changes)
 
   NEW FEATURES
 
+  AMBARI-802. Enhance Cluster Management pages. (yusaku)
+
   AMBARI-800. Hack to add a stage for testing in in-memory db. (jitendra)
 
   AMBARI-801. Fix heartbeat message from the agent which is causing NPE at the

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=1393835&r1=1393834&r2=1393835&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers.js Wed Oct  3 23:48:57 2012
@@ -26,6 +26,7 @@ require('controllers/installer/step1_con
 require('controllers/installer/step2_controller');
 require('controllers/installer/step3_controller');
 require('controllers/installer/step4_controller');
+require('controllers/installer/step6_controller');
 require('controllers/installer/step5_controller');
 require('controllers/installer/step6_controller');
 require('controllers/installer/step7_controller');

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/login_controller.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/login_controller.js?rev=1393835&r1=1393834&r2=1393835&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/login_controller.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/login_controller.js Wed Oct  3 23:48:57 2012
@@ -20,29 +20,42 @@ var App = require('app');
 
 App.LoginController = Em.Object.extend({
 
-  name: 'loginController',
-  loginName: '',
-  password: '',
-  errorMessage: '',
+  name:'loginController',
+  loginName:'',
+  password:'',
+  errorMessage:'',
 
   submit: function (e) {
     console.log('Login: ' + this.get('loginName') + ' Password: ' + this.get('password'));
 
     this.set('errorMessage', '');
 
-    if (this.validateCredentials()) {
-      console.log('Logging in as: ' + this.get('loginName'));
-      App.get('router').login(this.get('loginName'));
+    var user = this.validateCredentials();
+    if (user) {
+      App.get('router').login(this.get('loginName'), user);
     } else {
       console.log('Failed to login as: ' + this.get('loginName'));
       this.set('errorMessage', Em.I18n.t('login.error'));
     }
-
   },
 
+  /**
+   *
+   * @return {number} user by credentials || {undefined}
+   */
   validateCredentials: function () {
     //TODO: REST api that validates the login
-    return (this.get('loginName').trim() !== '' && this.get('loginName') === this.get('password'));
+    var thisController = this;
+
+    var user = App.store.filter(App.User, function (data) {
+      return data.get('user_name') == thisController.get('loginName') && data.get('password') == thisController.get('password');
+    });
+
+    var clientId = user.content[0];
+
+    if (user.content[0] !== undefined) {
+      return App.store.findByClientId(App.User, clientId);
+    }
   }
 
 });
\ No newline at end of file

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=1393835&r1=1393834&r2=1393835&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 Wed Oct  3 23:48:57 2012
@@ -16,6 +16,8 @@
  * limitations under the License.
  */
 
+var App = require('app');
+
 App.MainController = Em.Controller.extend({
   name: 'mainController'
 })
\ No newline at end of file

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/admin.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/admin.js?rev=1393835&r1=1393834&r2=1393835&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/admin.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/admin.js Wed Oct  3 23:48:57 2012
@@ -16,6 +16,9 @@
  * limitations under the License.
  */
 
+var App = require('app');
+
 App.MainAdminController = Em.Controller.extend({
-  name:'mainAdminController'
+  name:'mainAdminController',
+  category:'user'
 })
\ No newline at end of file

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/admin/advanced.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/admin/advanced.js?rev=1393835&r1=1393834&r2=1393835&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/admin/advanced.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/admin/advanced.js Wed Oct  3 23:48:57 2012
@@ -16,6 +16,8 @@
  * limitations under the License.
  */
 
+var App = require('app');
+
 App.MainAdminAdvancedController = Em.Controller.extend({
   name:'mainAdminAdvancedController',
   uninstall: function(event){

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/admin/authentication.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/admin/authentication.js?rev=1393835&r1=1393834&r2=1393835&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/admin/authentication.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/admin/authentication.js Wed Oct  3 23:48:57 2012
@@ -16,19 +16,23 @@
  * limitations under the License.
  */
 
+var App = require('app');
+
 App.MainAdminAuthenticationController = Em.Controller.extend({
   name:'mainAdminAuthenticationController',
   save:function (event) {
     var form = event.context;
-    form.save();
-    App.ModalPopup.show({
-      header: Em.I18n.t('admin.authentication.form.testConfiguration'),
-      body:form.get('resultText'),
-      secondary:false,
-      onPrimary: function(){
-        this.hide();
-      }
-    });
+    if (form.isValid()) {
+      form.save();
+      App.ModalPopup.show({
+        header:Em.I18n.t('admin.authentication.form.testConfiguration'),
+        body:form.get('resultText'),
+        secondary:false,
+        onPrimary:function () {
+          this.hide();
+        }
+      });
+    }
   },
   content:App.Authentication.find(1)
 })
\ No newline at end of file

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/admin/item.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/admin/item.js?rev=1393835&r1=1393834&r2=1393835&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/admin/item.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/admin/item.js Wed Oct  3 23:48:57 2012
@@ -16,6 +16,8 @@
  * limitations under the License.
  */
 
+var App = require('app');
+
 App.MainAdminItemController = Em.Controller.extend({
   name:'mainAdminItemController'
 })
\ No newline at end of file

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/admin/user.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/admin/user.js?rev=1393835&r1=1393834&r2=1393835&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/admin/user.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/admin/user.js Wed Oct  3 23:48:57 2012
@@ -16,10 +16,18 @@
  * limitations under the License.
  */
 
+var App = require('app');
+
 App.MainAdminUserController = Em.Controller.extend({
   name:'mainAdminUserController',
   deleteRecord:function (event) {
-    if (Em.I18n.t('question.sure')) {
+
+    if (event.context.get('userName') == App.get('router').getLoginName()) {
+      alert(Em.I18n.t('admin.users.deleteYourselfMessage'));
+      return;
+    }
+
+    if (confirm(Em.I18n.t('question.sure'))) {
       event.context.deleteRecord();
       App.store.commit();
     }

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/admin/user/edit.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/admin/user/edit.js?rev=1393835&r1=1393834&r2=1393835&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/admin/user/edit.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/admin/user/edit.js Wed Oct  3 23:48:57 2012
@@ -16,6 +16,8 @@
  * limitations under the License.
  */
 
+var App = require('app');
+
 App.MainAdminUserEditController = Em.Controller.extend({
   name:'mainAdminUserEditController',
   content:false

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/alert.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/alert.js?rev=1393835&r1=1393834&r2=1393835&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/alert.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/alert.js Wed Oct  3 23:48:57 2012
@@ -16,6 +16,8 @@
  * limitations under the License.
  */
 
+var App = require('app');
+
 App.MainAlertController = Em.ArrayController.extend({
   name:'mainAlertController'
 })
\ No newline at end of file

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/dashboard.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/dashboard.js?rev=1393835&r1=1393834&r2=1393835&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/dashboard.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/dashboard.js Wed Oct  3 23:48:57 2012
@@ -16,6 +16,8 @@
  * limitations under the License.
  */
 
+var App = require('app');
+
 App.MainDashboardController = Em.Controller.extend({
   name:'mainDashboardController',
   alerts: App.Alert.find(),
@@ -33,6 +35,6 @@ App.MainDashboardController = Em.Control
     }
   },
   alertsCount: function() {
-    return this.alerts.get('content').length;
+    return this.alerts.filterProperty('status', 'corrupt').length;
   }.property()
 })
\ 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=1393835&r1=1393834&r2=1393835&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 Wed Oct  3 23:48:57 2012
@@ -16,13 +16,14 @@
  * limitations under the License.
  */
 
+var App = require('app');
 
 App.MainHostController = Em.ArrayController.extend(App.Pagination, {
   name:'mainHostController',
   content: [],
   fullContent: App.Host.find(),
   clusters: App.Cluster.find(),
-  allComponents: App.Component.find(),
+  componentsForFilter: App.Component.find(),
   totalBinding: 'fullContent.length',
   filters: {components:[]},
   pageSize: 3,
@@ -31,7 +32,10 @@ App.MainHostController = Em.ArrayControl
   allChecked: false,
   selectedHostsIds: [],
   sortingAsc: true,
-
+  isSort: false,
+  sortClass: function(){
+    return this.get('sortingAsc')? 'icon-arrow-down' : 'icon-arrow-up';
+  }.property('sortingAsc'),
   isDisabled:true,
 
   onAllChecked: function () {
@@ -42,11 +46,12 @@ App.MainHostController = Em.ArrayControl
     this.set('selectedHostsIds', selectedHostsIds);
   }.observes('allChecked'),
 
-  onHostChecked: function (checked, hostId) {
+  onHostChecked: function (host) {
     var selected = this.get('selectedHostsIds');
-    if (checked) selected.push(hostId);
+    host.set('isChecked', !host.get('isChecked'));
+    if (host.get('isChecked')) selected.push(host.get('id'));
     else {
-      var index = selected.indexOf(hostId);
+      var index = selected.indexOf(host.get('id'));
       if(index!=-1) selected.splice(index, 1);
     }
     this.set('isDisabled', selected.length == 0);
@@ -63,19 +68,20 @@ App.MainHostController = Em.ArrayControl
     this.set('selectedHostsIds', selectedHosts.getEach('id'));
   },
 
-  setFilters: function(checked, componentId) {
-    var filters = this.get('filters.components');
-    if (checked){
-      filters.push(componentId);
-    } else {
-      var index = filters.indexOf(componentId);
-      if(index!=-1) filters.splice(index, 1);
-    }
+  filterByComponentsIds: function(componentsIds) {
+    this.set('filters.components', componentsIds);
+    this.get('componentsForFilter').forEach(function(component) {
+      if (componentsIds.indexOf(component.get('id')) == -1){
+        component.set('isChecked', false);
+      } else component.set('isChecked', true);
+    });
     this.changeContent();
   },
 
-  filterByComponentId: function(componentId) {
-    this.set('filters.components', [componentId]);
+  filterByComponent: function(component) {
+    this.get('componentsForFilter').setEach('isChecked', false);
+    component.set('isChecked', true);
+    this.set('filters.components', [component.get('id')]);
     this.changeContent();
   },
 
@@ -84,10 +90,10 @@ App.MainHostController = Em.ArrayControl
     var filters = this.get('filters.components');
     if (filters.length){
       this.get('fullContent').forEach(function(item) {
-        var inFilters = true;
-        $.each(filters, function (i, componentId) {
-          if (item.get('components').getEach('id').indexOf(componentId) == -1){
-            inFilters = false;
+        var inFilters = false;
+        item.get('components').forEach(function(component) {
+          if (filters.indexOf(component.get('id')) != -1){
+            inFilters = true;
           }
         });
         if (inFilters){
@@ -102,7 +108,7 @@ App.MainHostController = Em.ArrayControl
     var content = items.slice(this.get('rangeStart'), this.get('rangeStop'));
     this.replace(0, this.get('length'), content);
     this.changeSelectedHosts();
-  }.observes('rangeStart', 'rangeStop', 'filters.components', 'total'),
+  }.observes('rangeStart', 'rangeStop', 'total'),
 
   showNextPage: function() {
     this.nextPage();
@@ -187,6 +193,7 @@ App.MainHostController = Em.ArrayControl
       return 0;
     });
     this.set('fullContent', objects);
+    this.set('isSort', true);
     this.set('sortingAsc', !this.get('sortingAsc'));
     this.changeContent();
   }

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/host/details.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/host/details.js?rev=1393835&r1=1393834&r2=1393835&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/host/details.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/host/details.js Wed Oct  3 23:48:57 2012
@@ -16,25 +16,26 @@
  * limitations under the License.
  */
 
+var App = require('app');
+
 App.MainHostDetailsController = Em.Controller.extend({
   name: 'mainHostDetailsController',
   content: null,
-  startComponents: function(){
+
+  isFromHosts: false,
+
+  isStarting: function(){
     return this.get('content.workStatus');
   }.property('content.workStatus'),
-  stopComponents: function(){
-    return !this.get('startComponents');
-  }.property('startComponents'),
-  changeWorkStatus: function(){
-    if (this.get('startComponents')) {
-      this.set('iconClass', 'play');
-    } else {
-      this.set('iconClass', 'stop');
-    }
-  }.observes('startComponents'),
-  iconClass: '',
+  isStopping: function(){
+    return !this.get('isStarting');
+  }.property('isStarting'),
 
-  startConfirmPopup: function (event) {
+  setBack: function(isFromHosts){
+    this.set('isFromHosts', isFromHosts);
+  },
+
+  startComponent: function(event){
     var self = this;
     App.ModalPopup.show({
       header: Em.I18n.t('hosts.host.start.popup.header'),
@@ -42,11 +43,50 @@ App.MainHostDetailsController = Em.Contr
       primary: 'Yes',
       secondary: 'No',
       onPrimary: function() {
-        console.log(self.get('content.components').getEach('workStatus'));
-        self.get('content.components').setEach('workStatus', self.get('content.workStatus'));
+        var component = event.context;
+        component.set('workStatus', true);
+        var stopped = self.get('content.components').filterProperty('workStatus', false);
+        if (stopped.length == 0)
+          self.set('content.workStatus', true);
+        this.hide();
+      },
+      onSecondary: function() {
+        this.hide();
+      }
+    });
+  },
+  stopComponent: function(event){
+    var self = this;
+    App.ModalPopup.show({
+      header: Em.I18n.t('hosts.host.start.popup.header'),
+      body: Em.I18n.t('hosts.host.start.popup.body'),
+      primary: 'Yes',
+      secondary: 'No',
+      onPrimary: function() {
+        var component = event.context;
+        component.set('workStatus', false);
+        var started = self.get('content.components').filterProperty('workStatus', true);
+        if (started.length == 0)
+          self.set('content.workStatus', false);
+        this.hide();
+      },
+      onSecondary: function() {
+        this.hide();
+      }
+    });
 
-        self.set('content.workStatus', !self.get('content.workStatus'));
+  },
 
+  startConfirmPopup: function (event) {
+    var self = this;
+    App.ModalPopup.show({
+      header: Em.I18n.t('hosts.host.start.popup.header'),
+      body: Em.I18n.t('hosts.host.start.popup.body'),
+      primary: 'Yes',
+      secondary: 'No',
+      onPrimary: function() {
+        self.get('content.components').setEach('workStatus', true);
+        self.set('content.workStatus', !self.get('content.workStatus'));
         this.hide();
       },
       onSecondary: function() {
@@ -62,8 +102,7 @@ App.MainHostDetailsController = Em.Contr
       primary: 'Yes',
       secondary: 'No',
       onPrimary: function() {
-        console.log(self.get('content.components').getEach('workStatus'));
-        self.get('content.components').setEach('workStatus', self.get('content.workStatus'));
+        self.get('content.components').setEach('workStatus', false);
         self.set('content.workStatus', !self.get('content.workStatus'));
         this.hide();
       },

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/service.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/service.js?rev=1393835&r1=1393834&r2=1393835&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/service.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/service.js Wed Oct  3 23:48:57 2012
@@ -16,6 +16,8 @@
  * limitations under the License.
  */
 
+var App = require('app');
+
 App.MainServiceController = Em.ArrayController.extend({
   name:'mainServiceController',
   content: App.Service.find()

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=1393835&r1=1393834&r2=1393835&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 Wed Oct  3 23:48:57 2012
@@ -16,17 +16,8 @@
  * limitations under the License.
  */
 
+var App = require('app');
+
 App.MainServiceInfoAuditController = Em.Controller.extend({
-  name: 'mainServiceInfoAuditController',
-  users: App.User.find(),
-  performedBy: function() {
-    var auditItems = this.content.get('serviceAudit');
-    var itemUsers = auditItems.getEach('user');
-    var result = [];
-    this.users.forEach(function(item, index, self) {
-      if (res = itemUsers.findProperty ('id', item.get('id')))
-        result.push(res);
-    });
-    return result;
-  }.property('content')
+  name: 'mainServiceInfoAuditController'
 })
\ No newline at end of file

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=1393835&r1=1393834&r2=1393835&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 Wed Oct  3 23:48:57 2012
@@ -16,6 +16,8 @@
  * limitations under the License.
  */
 
+var App = require('app');
+
 App.MainServiceInfoConfigsController = Em.Controller.extend({
   name: 'mainServiceInfoConfigsController',
   content: 'Configs'

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/service/info/metrics.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/service/info/metrics.js?rev=1393835&r1=1393834&r2=1393835&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/service/info/metrics.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/service/info/metrics.js Wed Oct  3 23:48:57 2012
@@ -16,6 +16,8 @@
  * limitations under the License.
  */
 
+var App = require('app');
+
 App.MainServiceInfoMetricsController = Em.Controller.extend({
   name: 'mainServiceInfoMetricsController',
   content: 'Metrics'

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/service/info/summary.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/service/info/summary.js?rev=1393835&r1=1393834&r2=1393835&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/service/info/summary.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/service/info/summary.js Wed Oct  3 23:48:57 2012
@@ -16,6 +16,8 @@
  * limitations under the License.
  */
 
+var App = require('app');
+
 App.MainServiceInfoSummaryController = Em.Controller.extend({
   name: 'mainServiceInfoSummaryController'
 })
\ 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=1393835&r1=1393834&r2=1393835&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 Wed Oct  3 23:48:57 2012
@@ -16,9 +16,11 @@
  * limitations under the License.
  */
 
+var App = require('app');
+
 App.MainServiceItemController = Em.Controller.extend({
   name: 'mainServiceItemController',
-//  content: App.Service.find(1),
+  content: App.Service.find(1),
   showRebalancer: function() {
     if(this.content.get('serviceName') == 'hdfs') {
       return true;

Added: incubator/ambari/branches/AMBARI-666/ambari-web/app/data/mock/service_components.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/data/mock/service_components.js?rev=1393835&view=auto
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/data/mock/service_components.js (added)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/data/mock/service_components.js Wed Oct  3 23:48:57 2012
@@ -0,0 +1,245 @@
+/**
+ * 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.
+ */
+
+module.exports = new Ember.Set([
+
+      {
+        service_name: 'HDFS',
+        component_name: 'NAMENODE',
+        display_name: 'NameNode',
+        isMaster: true,
+        isClient: false,
+        description: 'Master server that manages the file system namespace and regulates access to files by clients'
+      },
+      {
+        service_name: 'HDFS',
+        component_name: 'SNAMENODE',
+        display_name: 'SNameNode',
+        isMaster: true,
+        isClient: false,
+        description: 'Helper to the primary NameNode that is responsible for supporting periodic checkpoints of the HDFS metadata'
+      },
+      {
+        service_name: 'HDFS',
+        component_name: 'DATANODE',
+        display_name: 'Datanode',
+        isMaster: false,
+        isClient: false,
+        description: 'The slave for HDFS'
+      },
+      {
+        service_name: 'HDFS',
+        component_name: 'HDFS_CLIENT',
+        display_name: 'HDFS Client',
+        isMaster: false,
+        isClient: true,
+        description: 'Client component for HDFS'
+      },
+      {
+        service_name: 'MAPREDUCE',
+        component_name: 'JOBTRACKER',
+        display_name: 'JobTracker',
+        isMaster: true,
+        isClient: false,
+        description: 'Central Master service that pushes work (MR tasks) out to available TaskTracker nodes in the cluster'
+      },
+      {
+        service_name: 'MAPREDUCE',
+        component_name: 'TASKTRACKER',
+        display_name: 'TaskTracker',
+        isMaster: false,
+        isClient: false,
+        description: 'The slave for MapReduce'
+      },
+      {
+        service_name: 'MAPREDUCE',
+        component_name: 'MAPREDUCE_CLIENT',
+        display_name: 'MapReduce Client',
+        isMaster: false,
+        isClient: true,
+        description: 'Client component for MapReduce'
+      },
+      {
+        service_name: 'ZOOKEEPER',
+        component_name: 'ZOOKEEPER_SERVER',
+        display_name: 'ZooKeeper',
+        isMaster: true,
+        isClient: false,
+        description: ''
+      },
+      {
+        service_name: 'ZOOKEEPER',
+        component_name: 'ZOOKEEPER_CLIENT',
+        display_name: 'ZooKeeper Client',
+        isMaster: false,
+        isClient: true,
+        description: ''
+      },
+      {
+        service_name: 'HBASE',
+        component_name: 'HBASE_MASTER',
+        display_name: 'HBase Master',
+        isMaster: true,
+        isClient: false,
+        description: ''
+      },
+      {
+        service_name: 'HBASE',
+        component_name: 'HBASE_REGIONSERVER',
+        display_name: 'HBase Region Server',
+        isMaster: false,
+        isClient: false,
+        description: 'The slave for HBase'
+      },
+      {
+        service_name: 'HBASE',
+        component_name: 'HBASE_CLIENT',
+        display_name: 'HBase Client',
+        isMaster: false,
+        isClient: true,
+        description: 'The slave for HBase'
+      },
+      {
+        service_name: 'PIG',
+        component_name: 'PIG_CLIENT',
+        display_name: 'Pig Client',
+        isMaster: false,
+        isClient: true,
+        description: ''
+      },
+      {
+        service_name: 'SQOOP',
+        component_name: 'SQOOP_CLIENT',
+        display_name: 'Sqoop Client',
+        isMaster: false,
+        isClient: true,
+        description: ''
+      },
+      {
+        service_name: 'OOZIE',
+        component_name: 'OOZIE_SERVER',
+        display_name: 'Oozie Server',
+        isMaster: true,
+        isClient: false,
+        description: ''
+      },
+      {
+        service_name: 'OOZIE',
+        component_name: 'OOZIE_CLIENT',
+        display_name: 'Oozie Client',
+        isMaster: false,
+        isClient: true,
+        description: ''
+      },
+      {
+        service_name: 'HIVE',
+        component_name: 'HIVE_SERVER',
+        display_name: 'Hive Metastore',
+        isMaster: true,
+        isClient: false,
+        description: ''
+      },
+      {
+        service_name: 'HIVE',
+        component_name: 'HIVE_CLIENT',
+        display_name: 'Hive Client',
+        isMaster: false,
+        isClient: true,
+        description: ''
+      },
+      {
+        service_name: 'HIVE',
+        component_name: 'HIVE_MYSQL',
+        display_name: 'MySql Server for Hive',
+        isMaster: false,
+        isClient: false,
+        description: 'The slave for HBase'
+      },
+      {
+        service_name: 'TEMPLETON',
+        component_name: 'TEMPLETON_SERVER',
+        display_name: 'Templeton Server',
+        isMaster: true,
+        isClient: false,
+        description: ''
+      },
+      {
+        service_name: 'TEMPLETON',
+        component_name: 'TEMPLETON_CLIENT',
+        display_name: 'Templeton Client',
+        isMaster: false,
+        isClient: true,
+        description: ''
+      },
+      {
+        service_name: 'DASHBOARD',
+        component_name: 'DASHBOARD',
+        display_name: 'Monitoring Dashboard',
+        isMaster: false,
+        isClient: false,
+        description: ''
+      },
+      {
+        service_name: 'NAGIOS',
+        component_name: 'NAGIOS_SERVER',
+        display_name: 'Nagios Server',
+        isMaster: true,
+        isClient: false,
+        description: ''
+      },
+      {
+        service_name: 'GANGLIA',
+        component_name: 'GANGLIA_MONITOR_SERVER',
+        display_name: 'Ganglia Collector',
+        isMaster: true,
+        isClient: false,
+        description: ''
+      },
+      {
+        service_name: 'GANGLIA',
+        component_name: 'GANGLIA_MONITOR',
+        display_name: 'Ganglia Slave',
+        isMaster: false,
+        isClient: false,
+        description: ''
+      },
+      {
+        service_name: 'KERBEROS',
+        component_name: 'KERBEROS_SERVER',
+        display_name: 'Kerberos Server',
+        isMaster: true,
+        isClient: false,
+        description: ''
+      },
+      {
+        service_name: 'KERBEROS',
+        component_name: 'KERBEROS_ADMIN_CLIENT',
+        display_name: 'Kerberos Admin Client',
+        isMaster: false,
+        isClient: true,
+        description: ''
+      },
+      {
+        service_name: 'KERBEROS',
+        component_name: 'KERBEROS_CLIENT',
+        display_name: 'Kerberos Client',
+        isMaster: false,
+        isClient: true,
+        description: ''
+      }
+]);
\ No newline at end of file

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=1393835&r1=1393834&r2=1393835&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/messages.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/messages.js Wed Oct  3 23:48:57 2012
@@ -42,8 +42,7 @@ Em.I18n.translations = {
   'installer.header': 'Cluster Install Wizard',
   'installer.step1.header': 'Welcome',
   'installer.step1.body.header': 'Welcome to Apache Ambari!',
-  'installer.step1.body':
-    'Ambari makes it easy to install, manage, and monitor Hadoop clusters.<br>' +
+  'installer.step1.body': 'Ambari makes it easy to install, manage, and monitor Hadoop clusters.<br>' +
     'We will walk you through the cluster installation process with this step-by-step wizard.',
   'installer.step1.clusterName': 'Name your cluster',
   'installer.step1.clusterName.tooltip.title': 'Cluster Name',
@@ -115,54 +114,57 @@ Em.I18n.translations = {
   'installer.step9.host.status.success': 'success',
   'installer.step9.host.status.warning': 'tolerable failures encountered',
   'installer.step9.host.status.failed': 'failures encountered',
+
   'installer.step10.header': 'Summary',
 
   'form.create': 'Create',
   'form.save': 'Save',
   'form.cancel': 'Cancel',
-  'form.password':'Password',
-  'form.passwordRetype':'Retype Password',
-  'form.saveSuccess':'Successfully saved.',
-  'form.saveError':'Sorry, errors occured.',
-
-  'form.validator.invalidIp':'Please enter valid ip address',
-
-  'admin.advanced.title':'Advanced',
-  'admin.advanced.caution':'This section is for advanced user only.<br/>Proceed with caution.',
-  'admin.advanced.button.uninstallIncludingData':'Uninstall cluster including all data.',
-  'admin.advanced.button.uninstallKeepData':'Uninstall cluster but keep data.',
+  'form.password': 'Password',
+  'form.passwordRetype': 'Retype Password',
+  'form.saveSuccess': 'Successfully saved.',
+  'form.saveError': 'Sorry, errors occured.',
+
+  'form.validator.invalidIp': 'Please enter valid ip address',
+
+  'admin.advanced.title': 'Advanced',
+  'admin.advanced.caution': 'This section is for advanced user only.<br/>Proceed with caution.',
+  'admin.advanced.button.uninstallIncludingData': 'Uninstall cluster including all data.',
+  'admin.advanced.button.uninstallKeepData': 'Uninstall cluster but keep data.',
 
-  'admin.advanced.popup.header':'Uninstall Cluster',
+  'admin.advanced.popup.header': 'Uninstall Cluster',
   /*'admin.advanced.popup.text':'Uninstall Cluster',*/
 
-  'admin.audit.grid.date':"Date/Time",
-  'admin.audit.grid.category':"Category",
-  'admin.audit.grid.operationName':"Operation",
-  'admin.audit.grid.performedBy':"Performed By",
-
-  'admin.authentication.form.method.database':'Use Ambari Database to authenticate users',
-  'admin.authentication.form.method.ldap':'Use LDAP/Active Directory to authenticate',
-  'admin.authentication.form.primaryServer':'Primary Server',
-  'admin.authentication.form.secondaryServer':'Secondary Server',
-  'admin.authentication.form.useSsl':'Use SSL',
-  'admin.authentication.form.bind.anonymously':"Bind Anonymously",
-  'admin.authentication.form.bind.useCrenedtials':"Use Credentials To Bind",
-  'admin.authentication.form.bindUserDN':'Bind User DN',
-  'admin.authentication.form.searchBaseDN':'Search Base DN',
-  'admin.authentication.form.usernameAttribute':'Username Attribute',
-
-  'admin.authentication.form.userDN':'User DN',
-  'admin.authentication.form.password':'Password',
-  'admin.authentication.form.configurationTest':'Configuration Test',
-  'admin.authentication.form.testConfiguration':'Test Configuration',
+  'admin.audit.grid.date': "Date/Time",
+  'admin.audit.grid.category': "Category",
+  'admin.audit.grid.operationName': "Operation",
+  'admin.audit.grid.performedBy': "Performed By",
+  'admin.audit.grid.service': "Category",
+
+  'admin.authentication.form.method.database': 'Use Ambari Database to authenticate users',
+  'admin.authentication.form.method.ldap': 'Use LDAP/Active Directory to authenticate',
+  'admin.authentication.form.primaryServer': 'Primary Server',
+  'admin.authentication.form.secondaryServer': 'Secondary Server',
+  'admin.authentication.form.useSsl': 'Use SSL',
+  'admin.authentication.form.bind.anonymously': "Bind Anonymously",
+  'admin.authentication.form.bind.useCrenedtials': "Use Credentials To Bind",
+  'admin.authentication.form.bindUserDN': 'Bind User DN',
+  'admin.authentication.form.searchBaseDN': 'Search Base DN',
+  'admin.authentication.form.usernameAttribute': 'Username Attribute',
+
+  'admin.authentication.form.userDN': 'User DN',
+  'admin.authentication.form.password': 'Password',
+  'admin.authentication.form.configurationTest': 'Configuration Test',
+  'admin.authentication.form.testConfiguration': 'Test Configuration',
 
-  'admin.authentication.form.test.success':'The configuration passes the test',
-  'admin.authentication.form.test.fail':'The configuration fails the test',
+  'admin.authentication.form.test.success': 'The configuration passes the test',
+  'admin.authentication.form.test.fail': 'The configuration fails the test',
 
-  'admin.security.title':'Kerberos Security has not been enabled on this cluster.',
-  'admin.security.button.enable':'Kerberos Security has not been enabled on this cluster.',
+  'admin.security.title': 'Kerberos Security has not been enabled on this cluster.',
+  'admin.security.button.enable': 'Enable Kerberos Security on this cluster',
 
-  'admin.users.ldapAuthentionUsed':'LDAP Authentication is being used to authenticate users',
+  'admin.users.ldapAuthentionUsed': 'LDAP Authentication is being used to authenticate users',
+  'admin.users.deleteYourselfMessage': 'You can\'t delete yourself',
   'admin.users.addButton': 'Add User',
   'admin.users.delete': 'delete',
   'admin.users.edit': 'edit',
@@ -190,5 +192,4 @@ Em.I18n.translations = {
   'hosts.decommission.popup.header': 'Confirmation',
   'hosts.delete.popup.body': 'Are you sure?',
   'hosts.delete.popup.header': 'Confirmation'
-};
-
+};
\ No newline at end of file

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/models/authentication.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/models/authentication.js?rev=1393835&r1=1393834&r2=1393835&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/models/authentication.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/models/authentication.js Wed Oct  3 23:48:57 2012
@@ -24,7 +24,7 @@ App.Authentication = DS.Model.extend({
   bindMethod:DS.attr('boolean'), // use credentials
   bindUser:DS.attr('string'),
   password:DS.attr('string'),
-  retypePassword:DS.attr('string'),
+  passwordRetype:DS.attr('string'),
   searchBaseDn:DS.attr('string'),
   usernameAttribute:DS.attr('string')
 });
@@ -32,16 +32,16 @@ App.Authentication = DS.Model.extend({
 App.Authentication.FIXTURES = [
   {
     id:1,
-    method:false,
-    primary_server:"1.2.3.4:78",
-    secondary_server:"225.225.255.255:12",
+    method:0,
+    primary_server:"",
+    secondary_server:"",
     use_ssl:false,
-    bind_method:false,
-    bind_user:"hadoop\Administrator",
-    password:"1234",
-    retype_password:"1234",
-    search_base_dn:"DC=hadoop,DC=abc,DC=com",
-    username_attribute:"sAMAccountName"
+    bind_method:0,
+    bind_user:"",
+    password:"",
+    password_retype:"",
+    search_base_dn:"",
+    username_attribute:""
   }
 ]
 
@@ -55,19 +55,40 @@ App.AuthenticationForm = App.Form.extend
         {value:1, label:Em.I18n.t("admin.authentication.form.method.ldap")}
       ]
     },
-    { name:"primaryServer", displayName:Em.I18n.t("admin.authentication.form.primaryServer"), validator:'ipaddress'},
-    { name:"secondaryServer", displayName:Em.I18n.t("admin.authentication.form.secondaryServer"), validator:'ipaddress'},
+    { name:"primaryServer", displayName:Em.I18n.t("admin.authentication.form.primaryServer"), /*validator:'ipaddress',*/
+      isRequired:function () {
+        return this.get('form.field.method.value');
+      }.property('form.field.method.value')
+    },
+    { name:"secondaryServer", displayName:Em.I18n.t("admin.authentication.form.secondaryServer"), /*validator:'ipaddress',*/ isRequired:false},
     { name:"useSsl", displayName:Em.I18n.t("admin.authentication.form.useSsl"), displayType:"checkbox", isRequired:false },
     { name:"bindMethod", displayName:'', displayType:"select", isRequired:false,
       values:[
         {value:0, label:Em.I18n.t("admin.authentication.form.bind.anonymously")},
         {value:1, label:Em.I18n.t("admin.authentication.form.bind.useCrenedtials")}
       ]},
-    { name:"bindUser", displayName:Em.I18n.t('admin.authentication.form.bindUserDN')},
-    { name:"password", displayName:Em.I18n.t('form.password'), displayType:"password" },
-    { name:"passwordRetype", displayName:Em.I18n.t('form.passwordRetype'), displayType:"passwordRetype"},
-    { name:"searchBaseDn", displayName:Em.I18n.t('admin.authentication.form.searchBaseDN')},
-    { name:"usernameAttribute", displayName:Em.I18n.t('admin.authentication.form.usernameAttribute')},
+    { name:"bindUser", displayName:Em.I18n.t('admin.authentication.form.bindUserDN'), isRequired:function () {
+      return this.get('form.field.bindMethod.value');
+    }.property('form.field.bindMethod.value')},
+    { name:"password", displayName:Em.I18n.t('form.password'), displayType:"password",
+      isRequired:function () {
+        return this.get('form.field.bindMethod.value');
+      }.property('form.field.bindMethod.value') },
+    { name:"passwordRetype", displayName:Em.I18n.t('form.passwordRetype'), displayType:"password",
+      validator: "passwordRetype",
+      isRequired:function () {
+        return this.get('form.field.bindMethod.value');
+      }.property('form.field.bindMethod.value')},
+    { name:"searchBaseDn", displayName:Em.I18n.t('admin.authentication.form.searchBaseDN'),
+      isRequired:function () {
+        return this.get('form.field.method.value');
+      }.property('form.field.method.value')
+    },
+    { name:"usernameAttribute", displayName:Em.I18n.t('admin.authentication.form.usernameAttribute'),
+      isRequired:function () {
+        return this.get('form.field.method.value');
+      }.property('form.field.method.value')
+    },
 
     { name:"userDN", displayName:Em.I18n.t('admin.authentication.form.userDN') },
     { name:"userPassword", displayName:Em.I18n.t('admin.authentication.form.password'), displayType:'password'}
@@ -83,5 +104,6 @@ App.AuthenticationForm = App.Form.extend
   }.property('testResult'),
   testConfigurationClass:function () {
     return this.get('testResult') ? "text-success" : "text-error";
-  }.property('testConfigurationMessage')
-});
\ No newline at end of file
+  }.property('testConfigurationMessage'),
+})
+;
\ No newline at end of file

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/models/cluster.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/models/cluster.js?rev=1393835&r1=1393834&r2=1393835&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/models/cluster.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/models/cluster.js Wed Oct  3 23:48:57 2012
@@ -60,7 +60,6 @@ App.Host = DS.Model.extend({
   loadAvg: DS.attr('string'),
   os: DS.attr('string'),
   ip: DS.attr('string'),
-  isChecked: false,
   healthStatus: DS.attr('string'),
   workStatus: DS.attr('boolean')
 });
@@ -70,7 +69,7 @@ App.Host.FIXTURES = [
     id: 1,
     host_name: 'z_host1',
     cluster_id: 1,
-    components:[1, 2, 3, 4],
+    components:[1, 2, 4],
     cpu: '2x2.5GHz',
     memory: '8GB',
     disk_usage: '40',
@@ -104,6 +103,7 @@ App.Host.FIXTURES = [
     id: 4,
     host_name: 'b_host4',
     cluster_id: 2,
+    components:[1, 2, 4, 5],
     health_status: 'DEAD',
     work_status: false
   },
@@ -111,7 +111,7 @@ App.Host.FIXTURES = [
     id: 5,
     host_name: 'host5',
     cluster_id: 1,
-    components:[4, 5],
+    components:[3, 4, 5],
     cpu: '2x2.5GHz',
     memory: '8GB',
     disk_usage: '20',
@@ -138,7 +138,7 @@ App.Host.FIXTURES = [
     id: 7,
     host_name: 'host7',
     cluster_id: 1,
-    components:[4, 5],
+    components:[3, 4, 7],
     cpu: '2x2.5GHz',
     memory: '8GB',
     disk_usage: '20',

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/models/form.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/models/form.js?rev=1393835&r1=1393834&r2=1393835&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/models/form.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/models/form.js Wed Oct  3 23:48:57 2012
@@ -45,9 +45,8 @@ App.Form = Em.View.extend({
           thisForm.set("field." + field.get('name'), field);
         });
   },
-  getField:function (name) {
-//    return this.fields[name];
 
+  getField:function (name) {
     var field = false;
     $.each(this.fields, function () {
       if (this.get('name') == name) {
@@ -55,14 +54,15 @@ App.Form = Em.View.extend({
       }
     });
     return field;
-
   },
+
   isValid:function () {
     var isValid = true;
     $.each(this.fields, function () {
       this.validate();
       if (!this.get('isValid')) {
         isValid = false;
+        console.warn(this.get('name') + " IS INVALID : " + this.get('errorMessage'));
       }
     })
 
@@ -78,7 +78,7 @@ App.Form = Em.View.extend({
     var object = this.get('object');
     if (object instanceof Em.Object) {
       $.each(this.fields, function () {
-        this.set('value', object.get(this.get('name')));
+        this.set('value', this.get('displayType') == 'password' ? '' : object.get(this.get('name')));
       });
     } else {
       this.clearValues();
@@ -92,7 +92,8 @@ App.Form = Em.View.extend({
   getValues:function () {
     var values = {};
     $.each(this.fields, function () {
-      values[this.get('name')] = this.get('value');
+      if(!(this.get('displayType') == 'password') && validator.empty(this.get('value'))) // if this is not empty password field
+        values[this.get('name')] = this.get('value');
     });
     return values;
   },
@@ -163,7 +164,7 @@ App.FormField = Em.Object.extend({ // tr
   form:false,
   isRequired:true, // by default a config property is required
   unit:'',
-  value:null,
+  value:'',
 
   isValid:function () {
     return this.get('errorMessage') === '';
@@ -181,15 +182,12 @@ App.FormField = Em.Object.extend({ // tr
         element = Em.Select;
         options.content = this.get('values');
         options.valueBinding = "value";
-        options.optionValuePath="content.value";
-        options.optionLabelPath="content.label";
+        options.optionValuePath = "content.value";
+        options.optionLabelPath = "content.label";
         break;
       case 'password':
         options['type'] = 'password';
         break;
-      case 'passwordRetype':
-        options['type'] = 'password';
-        break;
       case 'textarea':
         element = Em.TextArea;
         break;
@@ -201,32 +199,42 @@ App.FormField = Em.Object.extend({ // tr
   validate:function () {
     var digitsRegex = /^\d+$/;
     var numberRegex = /^-?(?:\d+|\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/;
-
     var value = this.get('value');
-
     var isError = false;
+    this.set('errorMessage', '');
 
-    if (!(!this.get('form.isObjectNew') && this.get('disableRequiredOnExistent')) && this.get('isRequired')) {
-      if (typeof value === 'string' && value.trim().length === 0) {
-        this.set('errorMessage', 'This is required');
-        isError = true;
-      }
+    if (this.get('isRequired') && (typeof value === 'string' && value.trim().length === 0)) {
+      this.set('errorMessage', 'This is required');
+      isError = true;
     }
 
-    if (!isError) {
+    if (typeof value === 'string' && value.trim().length === 0) { // this is not to validate empty field.
+      isError = true;
+    }
 
+    if (!isError) {
       switch (this.get('validator')) {
         case 'ipaddress':
-          if (!validator.isIpAddress(value)) {
+          if (!validator.isIpAddress(value) && !validator.isDomainName(value)) {
             isError = true;
             this.set('errorMessage', Em.I18n.t("form.validator.invalidIp"));
-          };
+          }
+          break;
+        case 'passwordRetype':
+          var form = this.get('form');
+          var passwordField = form.getField('password');
+          if (passwordField.get('isValid')
+            && (passwordField.get('value') != this.get('value'))
+            && passwordField.get('value') && this.get('value')
+            ) {
+            this.set('errorMessage', "Passwords are different");
+            isError = true;
+          }
           break;
         default:
           break;
       }
 
-
       switch (this.get('displayType')) {
         case 'digits':
           if (!digitsRegex.test(value)) {
@@ -246,18 +254,6 @@ App.FormField = Em.Object.extend({ // tr
           break;
         case 'password':
           break;
-        case 'passwordRetype':
-          var form = this.get('form');
-          var passwordField = form.getField('password');
-          if (passwordField.get('isValid')
-            && (passwordField.get('value') != this.get('value'))
-            && passwordField.get('value') && this.get('value')
-            ) {
-            this.set('errorMessage', "Passwords are different");
-            isError = true;
-          }
-
-          break;
       }
     }
     if (!isError) {

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/models/pagination.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/models/pagination.js?rev=1393835&r1=1393834&r2=1393835&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/models/pagination.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/models/pagination.js Wed Oct  3 23:48:57 2012
@@ -27,7 +27,6 @@ App.Pagination = Em.Mixin.create({
   total: 0,
   rangeStart: 0,
   pageSize: 0,
-//  didRequestRange: Em.K,
 
   rangeStop: function() {
     var rangeStop = this.get('rangeStart') + this.get('pageSize'),
@@ -63,8 +62,10 @@ App.Pagination = Em.Mixin.create({
   }.property('rangeStop', 'pageSize').cacheable(),
 
   startPosition: function() {
+    if (this.get('total') == 0)
+      return 0;
     return this.get('rangeStart')  + 1;
-  }.property('rangeStart').cacheable(),
+  }.property('rangeStart', 'total').cacheable(),
 
   totalPages: function() {
     return Math.ceil(this.get('total') / this.get('pageSize'));

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=1393835&r1=1393834&r2=1393835&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 Wed Oct  3 23:48:57 2012
@@ -62,7 +62,7 @@ App.Component = DS.Model.extend({
   type:DS.attr('boolean'),
   service:DS.belongsTo('App.Service'),
   host:DS.belongsTo('App.Host'),
-  workStatus:DS.attr('string')
+  workStatus: DS.attr('boolean')
 });
 
 App.Component.FIXTURES = [
@@ -73,7 +73,7 @@ App.Component.FIXTURES = [
     type: true,
     service_id:1,
     host_id:1,
-    work_status:true
+    work_status:false
   },
   {
     id:2,
@@ -82,7 +82,7 @@ App.Component.FIXTURES = [
     type: true,
     service_id:1,
     host_id:2,
-    work_status:false
+    work_status:true
   },
   {
     id:3,
@@ -90,12 +90,13 @@ App.Component.FIXTURES = [
     label: 'DN',
     service_id:1,
     type: false,
-    host_id:2
+    host_id:2,
+    work_status:true
   },
   {
     id:4,
     component_name:'JobTracker',
-    label: 'TT',
+    label: 'JT',
     type: true,
     service_id:2,
     host_id:4,
@@ -104,10 +105,11 @@ App.Component.FIXTURES = [
   {
     id:5,
     component_name:'TaskTracker',
-    label: 'JT',
+    label: 'TT',
     type: false,
     service_id:2,
-    host_id:4
+    host_id:4,
+    work_status:true
   },
   {
     id:6,
@@ -115,7 +117,8 @@ App.Component.FIXTURES = [
     label: 'HBM',
     type: true,
     service_id:3,
-    host_id:4
+    host_id:4,
+    work_status:true
   },
   {
     id:7,
@@ -123,7 +126,8 @@ App.Component.FIXTURES = [
     label: 'RS',
     type: false,
     service_id:3,
-    host_id:2
+    host_id:2,
+    work_status:true
   }
 ];
 

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/models/service_audit.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/models/service_audit.js?rev=1393835&r1=1393834&r2=1393835&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/models/service_audit.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/models/service_audit.js Wed Oct  3 23:48:57 2012
@@ -30,36 +30,42 @@ App.ServiceAudit.FIXTURES = [
     id: 1,
     date: 'September 12, 2012 17:00',
     operation_name: 'Reconfigure',
-    user_id: 2
+    user_id: 2,
+    service_id: 1
   },
   {
     id: 2,
     date: 'September 13, 2012 17:00',
     operation_name: 'Start',
-    user_id: 1
+    user_id: 1,
+    service_id: 1
   },
   {
     id: 3,
     date: 'September 14, 2012 17:00',
     operation_name: 'Install',
-    user_id: 1
+    user_id: 1,
+    service_id: 1
   },
   {
     id: 4,
     date: 'September 12, 2012 17:00',
     operation_name: 'Reconfigure',
-    user_id: 2
+    user_id: 2,
+    service_id: 2
   },
   {
     id: 5,
     date: 'September 13, 2012 17:00',
     operation_name: 'Start',
-    user_id: 1
+    user_id: 1,
+    service_id: 2
   },
   {
     id: 6,
     date: 'September 14, 2012 17:00',
     operation_name: 'Install',
-    user_id: 1
+    user_id: 1,
+    service_id: 2
   }
 ];
\ No newline at end of file

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/models/user.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/models/user.js?rev=1393835&r1=1393834&r2=1393835&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/models/user.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/models/user.js Wed Oct  3 23:48:57 2012
@@ -17,6 +17,7 @@
  */
 
 var App = require('app');
+var validator = require('utils/validator');
 
 App.UserModel = Em.Object.extend({
   userName:null,
@@ -34,22 +35,62 @@ App.UserForm = App.Form.extend({
   className:App.User,
   fieldsOptions:[
     { name:"userName", displayName:"Username" },
-    { name:"password", displayName:"Password", displayType:"password", disableRequiredOnExistent:true },
-    { name:"passwordRetype", displayName:"Retype Password", displayType:"passwordRetype", disableRequiredOnExistent:true },
+    { name:"password", displayName:"Password", displayType:"password", isRequired: function(){ return this.get('form.isObjectNew'); }.property('form.isObjectNew') },
+    { name:"passwordRetype", displayName:"Retype Password", displayType:"password", validator:"passwordRetype", isRequired: false },
     { name:"admin", displayName:"Admin", displayType:"checkbox", isRequired:false }
   ],
   fields:[],
   disableUsername:function () {
     var field = this.getField("userName");
     if (field) field.set("disabled", this.get('isObjectNew') ? false : "disabled");
-  }.observes('isObjectNew')
+
+  }.observes('isObjectNew'),
+  disableAdminCheckbox:function () {
+    if (!this.get('isObjectNew')) {
+      var object = this.get('object');
+      var field = this.getField("admin");
+      if (field) {
+        field.set("disabled", object.get('userName') == App.get('router').getLoginName() ? "disabled" : false);
+      }
+    }
+  }.observes('isObjectNew'),
+
+  isValid: function(){
+    var isValid = this._super();
+    thisForm = this;
+
+    var passField = this.get('field.password');
+    var passRetype = this.get('field.passwordRetype');
+
+    if(!validator.empty(passField.get('value'))) {
+      if(passField.get('value') != passRetype.get('value')) {
+        passRetype.set('errorMessage', "Passwords are different");
+        isValid = false;
+      }
+    }
+
+    if(isValid && this.get('isObjectNew')) {
+      var users = App.User.find();
+      var userNameField = this.getField('userName');
+      var userName = userNameField.get('value');
+
+      users.forEach(function(user){
+        if(userName == user.get('userName')) {
+          userNameField.set('errorMessage', 'User with the same name is already exists');
+          return isValid = false;
+        }
+      });
+    }
+    
+    return isValid;
+  }
 });
 
 App.User.FIXTURES = [
   {
     id:1,
     user_name:'admin',
-    password: 'admin',
+    password:'admin',
     admin:1
   },
   {

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=1393835&r1=1393834&r2=1393835&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/router.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/router.js Wed Oct  3 23:48:57 2012
@@ -66,11 +66,20 @@ App.Router = Em.Router.extend({
     //localStorage.setItem('Ambari' + 'loginName', loginName);
   },
 
-  login: function (loginName) {
+  // that works incorrectly
+  setUser: function(user){ App.db.setUser(user); },
+  // that works incorrectly
+  getUser: function(){ return App.db.getUser(); },
+
+  login: function (loginName, user) {
     // TODO: this needs to be hooked up with server authentication
     console.log("In login function");
     this.setAuthenticated(true);
     this.setLoginName(loginName);
+
+//    refactor to get user attributes
+//    this.setUser(user);
+
     this.transitionTo(this.getSection());
 
   },

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=1393835&r1=1393834&r2=1393835&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 Wed Oct  3 23:48:57 2012
@@ -34,9 +34,9 @@ module.exports = Em.Route.extend({
     }
   },
 
-  index: Ember.Route.extend({
-    route: '/',
-    redirectsTo: 'dashboard'
+  index:Ember.Route.extend({
+    route:'/',
+    redirectsTo:'dashboard'
   }),
 
   connectOutlets:function (router, context) {
@@ -56,7 +56,10 @@ module.exports = Em.Route.extend({
       router.get('mainController').connectOutlet('mainHost');
     },
 
-    showDetails:Em.Router.transitionTo('hostDetails.index')
+    showDetails:function (router, event) {
+      router.get('mainHostDetailsController').setBack(true);
+      router.transitionTo('hostDetails.index', event.context)
+    }
 
   }),
 
@@ -106,32 +109,41 @@ module.exports = Em.Route.extend({
 
   admin:Em.Route.extend({
     route:'/admin',
-    enter:function (router) {
-      Ember.run.next(function () {
-        router.transitionTo('adminUser');
-      });
+
+    enter: function(router) {
+      if(router.get('currentState.name') != 'main') { // is user comes from main -> navigate to users
+        Em.run.next(function () {
+          router.transitionTo('adminUser');
+        });
+      }
+    },
+
+    connectOutlets:function (router, context) {
+      router.get('mainController').connectOutlet('mainAdmin');
     },
 
     adminUser:Em.Route.extend({
       route:'/user',
       enter:function (router) {
-        Ember.run.next(function () {
-          router.transitionTo('all');
+        router.set('mainAdminController.category', "user");
+        Em.run.next(function () {
+          router.transitionTo('allUsers');
         });
       },
-      connectOutlets:function (router) {
-        console.log("ADMIN USER RECONNECTED");
-      },
 
-      all:Em.Route.extend({
+      // events
+      gotoUsers:Em.Router.transitionTo("allUsers"),
+      gotoCreateUser:Em.Router.transitionTo("createUser"),
+      gotoEditUser:function (router, event) { router.transitionTo("editUser", event.context) },
+
+      // states
+      allUsers:Em.Route.extend({
         route:'/',
         connectOutlets:function (router) {
           router.get('mainAdminController').connectOutlet('mainAdminUser');
         }
       }),
 
-      gotoUsers:Em.Router.transitionTo("all"),
-
       createUser:Em.Route.extend({
         route:'/create',
         connectOutlets:function (router) {
@@ -139,8 +151,6 @@ module.exports = Em.Route.extend({
         }
       }),
 
-      gotoCreateUser:Em.Router.transitionTo("createUser"),
-
       editUser:Em.Route.extend({
         route:'/edit/:userName',
         connectOutlets:function (router, user) {
@@ -148,15 +158,12 @@ module.exports = Em.Route.extend({
           router.get('mainAdminController').connectOutlet('mainAdminUserEdit', user);
         }
       }),
-
-      gotoEditUser:function (router, event) {
-        router.transitionTo("editUser", event.context);
-      }
     }),
 
     adminAuthentication:Em.Route.extend({
       route:'/authentication',
       connectOutlets:function (router) {
+        router.set('mainAdminController.category', "authentication");
         router.get('mainAdminController').connectOutlet('mainAdminAuthentication');
       }
     }),
@@ -164,6 +171,7 @@ module.exports = Em.Route.extend({
     adminSecurity:Em.Route.extend({
       route:'/security',
       connectOutlets:function (router) {
+        router.set('mainAdminController.category', "security");
         router.get('mainAdminController').connectOutlet('mainAdminSecurity');
       }
     }),
@@ -171,6 +179,7 @@ module.exports = Em.Route.extend({
     adminAdvanced:Em.Route.extend({
       route:'/advanced',
       connectOutlets:function (router) {
+        router.set('mainAdminController.category', "advanced");
         router.get('mainAdminController').connectOutlet('mainAdminAdvanced');
       }
     }),
@@ -178,33 +187,14 @@ module.exports = Em.Route.extend({
     adminAudit:Em.Route.extend({
       route:'/audit',
       connectOutlets:function (router) {
+        router.set('mainAdminController.category', "audit");
         router.get('mainAdminController').connectOutlet('mainAdminAudit');
       }
     }),
 
-    connectOutlets:function (router, context) {
-      router.get('mainController').connectOutlet('mainAdmin');
-    },
-
-//    adminDetails:Em.Route.extend({
-//      route:'/:route',
-//      connectOutlets:function (router, menu) {
-//        router.get('mainAdminController').connectOutlet('mainAdmin' + menu.route.capitalize(), menu);
-//      }
-//    }),
-
-//    advanced:Em.Route.extend({
-//      route:'/:name',
-//      connectOutlets:function (router, service) {
-//        router.get('mainServiceController').connectOutlet('mainServiceItem', service);
-//      }
-//    }),
-
     adminNavigate:function (router, object) {
-      object.view._parentView.activateView(object.context.route);
-      console.log(object.context.route);
       Em.run.next(function () {
-        router.transitionTo('admin' + object.context.route.capitalize());
+        router.transitionTo('admin' + object.context.capitalize());
       });
     }
   }),
@@ -213,12 +203,6 @@ module.exports = Em.Route.extend({
     route:'/dashboard',
     connectOutlets:function (router, context) {
       router.get('mainController').connectOutlet('mainDashboard');
-    },
-    selectService: Em.Route.transitionTo('services.service'),
-    selectHost: Em.Router.transitionTo('hostDetails.index'),
-    filterHosts: function(router, component) {
-      router.get('mainHostController').set('filters.components', [component.context.get('id')]);
-      router.transitionTo('hosts');
     }
   }),
 
@@ -233,7 +217,7 @@ module.exports = Em.Route.extend({
         if (!service) {
           service = App.Service.find(1); // getting the first service to display
         }
-        router.transitionTo('service', service);
+        router.transitionTo('service.summary', service);
       });
     },
     connectOutlets:function (router, context) {
@@ -279,12 +263,6 @@ module.exports = Em.Route.extend({
           router.get('mainServiceItemController').connectOutlet('mainServiceInfoAudit', item);
         }
       }),
-      selectService: Em.Route.transitionTo('services.service'),
-      selectHost: Em.Router.transitionTo('hostDetails.index'),
-      filterHosts: function(router, component) {
-        router.get('mainHostController').set('filters.components', [component.context.get('id')]);
-        router.transitionTo('hosts');
-      },
       showInfo:function (router, event) {
         var parent = event.view._parentView;
         parent.deactivateChildViews();
@@ -292,25 +270,21 @@ module.exports = Em.Route.extend({
         router.transitionTo(event.context);
       }
     }),
-    connectOutlets:function (router, context) {
-      router.get('mainController').connectOutlet('mainService');
-    },
     showService:Em.Router.transitionTo('service')
   }),
 
+  selectService:Em.Route.transitionTo('services.service'),
+  selectHost:function (router, event) {
+    router.get('mainHostDetailsController').setBack(false);
+    router.transitionTo('hostDetails.index', event.context);
+  },
+  filterHosts:function (router, component) {
+    router.get('mainHostController').filterByComponent(component.context);
+    router.transitionTo('hosts');
+  },
   navigate:function (router, event) {
     var parent = event.view._parentView;
     parent.deactivateChildViews(event.context);
     router.transitionTo(event.context.routing);
   }
-
-  // TODO: create new routes here
-  // dashboard
-  // charts
-  // hosts
-  // hosts/:hostname
-  // admin
-  // etc...
-
-
 });
\ No newline at end of file

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/styles/app.css
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/styles/app.css?rev=1393835&r1=1393834&r2=1393835&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/styles/app.css (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/styles/app.css Wed Oct  3 23:48:57 2012
@@ -16,55 +16,6 @@
  * limitations under the License.
  */
 
-/*Box styles*/
-.box {
-    border: 1px solid #5fa3c3;
-    margin-bottom: 20px;
-}
-.box-header,
-.box-footer {
-    padding: 10px;
-    background: #dedede;
-}
-.box-footer hr {
-    margin: 0px;
-}
-.box-header:after,
-.box-footer:after {
-    content: "";
-    display: table;
-    clear: both;
-}
-.box-header .btn-group {
-    float: right;
-}
-.box-header h4 {
-    float: left;
-}
-
-.alerts {
-    margin: 0px;
-}
-.alerts li {
-    border-bottom: 1px solid #b7b9bb;
-    list-style: none;
-    padding: 5px 10px 5px 43px;
-}
-.alerts li.status-ok {
-    background: url("../img/status-ok.jpg") no-repeat 14px 9px;
-}
-.alerts li.status-corrupt {
-    background: url("../img/status-corrupt.jpg") no-repeat 14px 9px;
-}
-.alerts li .date-time {
-    float: right;
-}
-.go-to {
-    float: right;
-    background: url("../img/arrow-right.png") no-repeat right center;
-    padding-right: 40px;
-    margin-top: 20px;
-}
 /*Services*/
 .service-summary {
     background: #F6FAFD;
@@ -106,7 +57,7 @@
 .service-button {
     text-align: right;
     margin-bottom: 5px;
-    margin-top: -57px;
+    margin-top: -55px;
 }
 .add-service-button {
     position: relative;
@@ -143,18 +94,22 @@
 #hosts .table td.first label{
     padding-top: 3px;
 }
-#hosts .table td.first label span{
+#hosts .table td.name span{
     display: block;
+    float: left;
     height: 13px;
-    margin: 3px 0 0 3px;
+    margin: 4px 5px 0 0;
     width: 13px;
 }
-#hosts .table ul.filter-components li{
+#hosts .open-group > .dropdown-menu{
+    display: block;
+}
+#hosts .table ul#filter-dropdown li{
     display: block;
     padding: 3px 0 3px 5px;
     line-height: 20px;
 }
-#hosts .table ul.filter-components li input[type="checkbox"]{
+#hosts .table ul#filter-dropdown li input[type="checkbox"]{
     margin-top: 0;
     margin-right: 2px;
     margin-bottom: 2px;
@@ -232,7 +187,7 @@
     border: 1px solid #DEDEDE;
     background: #fff;
 }
-#host-details .host-components .btn{
+#host-details .host-components .btn-group{
     margin:0 5px 10px 0;
 }
 /*End Hosts*/

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=1393835&r1=1393834&r2=1393835&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 Wed Oct  3 23:48:57 2012
@@ -16,6 +16,13 @@
  * limitations under the License.
  */
 
+.gradient(@color: #FAFAFA, @start: #FFFFFF, @stop: #F2F2F2) {
+  background: @color;
+  background: -webkit-gradient(linear, left top, left bottom, color-stop(0, @start), color-stop(1, @stop));
+  background: -ms-linear-gradient(top, @start, @stop);
+  background: -moz-linear-gradient(center top, @start 0%, @stop 100%);
+}
+
 html, body {
   height: 100%;
 }
@@ -226,9 +233,51 @@ a:focus {
 
 @status-live-marker: url("../img/health-status-live.png");
 @status-dead-marker: url("../img/health-status-dead.png");
+@status-ok-marker: url("../img/status-ok.jpg");
+@status-corrupt-marker: url("../img/status-corrupt.jpg");
+@arrow-right: url("../img/arrow-right.png");
+
+/*****start styles for boxes*****/
+.box {
+  border: 1px solid #D4D4D4;
+  border-radius: 4px;
+  margin-bottom: 20px;
+
+  .box-header {
+    border-bottom: 1px solid #D4D4D4;
+    border-radius: 4px 4px 0 0;
+  }
+  .box-header,
+  .box-footer {
+    padding: 10px;
+    /*background: #dedede;*/
+    .gradient(#dedede, #ffffff, #dedede)
+  }
+  .box-header:after,
+  .box-footer:after {
+    content: "";
+    display: table;
+    clear: both;
+  }
+  .box-header {
+    .btn-group {
+      float: right;
+    }
+    h4 {
+      float: left;
+    }
+  }
+  .box-footer {
+    hr {
+      margin: 0px;
+    }
+  }
+}
+/*****end styles for boxes*****/
 
-/*Dashboard*/
+/*****start styles for dashboard page*****/
 
+/*start services summary*/
 .services {
   margin-left: 5px;
   .tab-marker-position {
@@ -245,7 +294,50 @@ a:focus {
     .tab-marker-position;
     background-image: @status-dead-marker;
   }
+  dt {
+    text-align: left;
+    width: 120px;
+  }
+  dd{
+    margin-left: 145px;
+  }
+}
+/*end services summary*/
+
+/*start alerts summary*/
+.alerts {
+  margin: 0px;
+  li {
+    border-bottom: 1px solid #b7b9bb;
+    list-style: none;
+    padding: 5px 10px 5px 43px;
+    background-position: 14px 9px;
+    background-repeat: no-repeat;
+    .date-time {
+      float: right;
+    }
+    p {
+      margin-bottom: 2px;
+    }
+  }
+  li.status-ok {
+    background-image: @status-ok-marker;
+  }
+  li.status-corrupt {
+    background-image: @status-corrupt-marker;
+  }
+}
+.go-to {
+  float: right;
+  background-position: right center;
+  background-repeat: no-repeat;
+  background-image: @arrow-right;
+  padding-right: 40px;
+  margin-top: 10px;
 }
+/*end alerts summary*/
+
+/*****end styles for dashboard page*****/
 
 /*Services*/
 .nav-tabs {
@@ -332,17 +424,18 @@ a:focus {
     border: solid 1px #cccccc;
     padding: 8px;
     margin-bottom: 10px;
-    background-color: #FFFAFA;
+    background-color: #fafafa;
   }
 
   .host-assignments .assignedService {
-    padding: 5px;
+    padding: 2px 8px;
     border: solid 1px #cccccc;
     margin: 2px;
-    background-color: #69BE28;
+    background-color: @green;
     color: white;
     white-space: nowrap;
     font-size: 0.9em;
+    display: inline-block;
   }
 
   .form-horizontal .controls {
@@ -364,7 +457,7 @@ a:focus {
   }
 
   .controls .badge {
-    background-color: #ADC299;
+    background-color: @green;
     color: #ffffff;
     cursor: pointer;
     font-weight: bold;
@@ -372,7 +465,7 @@ a:focus {
   }
 
   .assign-master  .controls .badge:hover {
-    background-color: #99B280;
+    background-color: @green;
   }
 
   .alertFlag {
@@ -388,4 +481,23 @@ a:focus {
 /*Dashboard*/
 .alerts-count {
   margin-left: 5px;
+}
+
+ul.filter {
+  background: #ffffff;
+  list-style: none;
+  position: absolute;
+  padding: 10px;
+}
+
+#main-admin-menu {
+  margin-left: 0;
+
+  ul {
+    margin-bottom: 0;
+  }
+}
+
+#user-auth-method select {
+  width: 320px;
 }
\ No newline at end of file

Added: incubator/ambari/branches/AMBARI-666/ambari-web/app/templates/common/grid/filter.hbs
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/templates/common/grid/filter.hbs?rev=1393835&view=auto
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/templates/common/grid/filter.hbs (added)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/templates/common/grid/filter.hbs Wed Oct  3 23:48:57 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.
+-->
+{{#each filter in view.filters}}
+<li>
+  <label class="checkbox">
+    {{view Em.Checkbox checkedBinding="filter.checked"}} {{filter.label}}
+  </label>
+</li>
+{{/each}}
\ No newline at end of file

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/templates/common/grid/header.hbs
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/templates/common/grid/header.hbs?rev=1393835&r1=1393834&r2=1393835&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/templates/common/grid/header.hbs (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/templates/common/grid/header.hbs Wed Oct  3 23:48:57 2012
@@ -15,4 +15,8 @@
 * See the License for the specific language governing permissions and
 * limitations under the License.
 -->
-{{view.label}}<i {{action doFilter target="view"}} class="icon-filter"></i>
\ No newline at end of file
+{{view.label}}<i {{action toggleFilter target="view"}} class="icon-filter"></i>
+{{#if view.showFilter}}
+{{view view.filter}}
+  <a {{action applyFilter target="view"}}>apply</a>
+{{/if}}
\ No newline at end of file

Added: incubator/ambari/branches/AMBARI-666/ambari-web/app/templates/common/grid/pager.hbs
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/templates/common/grid/pager.hbs?rev=1393835&view=auto
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/templates/common/grid/pager.hbs (added)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/templates/common/grid/pager.hbs Wed Oct  3 23:48:57 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.
+-->
+<ul>
+    <li {{bindAttr class="view.prevPageDisabled"}}><a {{action activatePrevPage target="view"}} href="#">Prev</a></li>
+  {{#each page in view.pages}}
+    <li {{bindAttr class="page.activeClass"}} ><a {{action activatePage page target="view" }} href="#">{{page.number}}</a></li>
+  {{/each}}
+    <li {{bindAttr class="view.nextPageDisabled"}}><a {{action activateNextPage target="view"}} href="#">Next</a></li>
+</ul>

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/templates/installer/step3.hbs
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/templates/installer/step3.hbs?rev=1393835&r1=1393834&r2=1393835&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/templates/installer/step3.hbs (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/templates/installer/step3.hbs Wed Oct  3 23:48:57 2012
@@ -57,7 +57,6 @@
     <tr>
       <th>
         {{view Ember.Checkbox checkedBinding="allChecked"}}
-        {{controller.category}}
       </th>
       <th>Status</th>
       <!--  given by the parsing function that parses data from bootstrap call -->
@@ -65,8 +64,9 @@
       <!-- retrieved from local storage initially -->
       <th>Message</th>
       <!-- given by the parsing function that parses data from bootstrap call, dynamically assign the color -->
-      <th>Delete</th>
+      <th>Action</th>
       <!-- trash icon -->
+      <!-- retry icon -->
     </tr>
     </thead>
 

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/templates/main/admin.hbs
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/templates/main/admin.hbs?rev=1393835&r1=1393834&r2=1393835&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/templates/main/admin.hbs (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/templates/main/admin.hbs Wed Oct  3 23:48:57 2012
@@ -16,7 +16,9 @@
 * limitations under the License.
 -->
 
+<div id="main-admin-menu" class="well span2">
 {{view App.MainAdminMenuView}}
+</div>
 <div class="span9">
   {{outlet}}
 </div>
\ No newline at end of file

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/templates/main/admin/audit.hbs
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/templates/main/admin/audit.hbs?rev=1393835&r1=1393834&r2=1393835&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/templates/main/admin/audit.hbs (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/templates/main/admin/audit.hbs Wed Oct  3 23:48:57 2012
@@ -16,22 +16,20 @@
 * limitations under the License.
 -->
 
-<table class="table">
+<table class="table table-striped">
   <thead>
   <tr>
     {{#each column in view.columns}}
-      {{view column}}
+    {{view column}}
     {{/each}}
   </tr>
   </thead>
+  <tbody>
+  {{#each row in view.rows}}
+  {{view row}}
+  {{/each}}
+  </tbody>
 </table>
-<div class="pagination">
-  <ul>
-    <li><a href="#">Prev</a></li>
-    <li><a href="#">1</a></li>
-    <li><a href="#">2</a></li>
-    <li><a href="#">3</a></li>
-    <li><a href="#">4</a></li>
-    <li><a href="#">Next</a></li>
-  </ul>
-</div>
\ No newline at end of file
+{{#if view.pager}}
+  {{view view.pager}}
+{{/if}}
\ No newline at end of file

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/templates/main/admin/authentication.hbs
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/templates/main/admin/authentication.hbs?rev=1393835&r1=1393834&r2=1393835&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/templates/main/admin/authentication.hbs (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/templates/main/admin/authentication.hbs Wed Oct  3 23:48:57 2012
@@ -16,7 +16,7 @@
 * limitations under the License.
 -->
 
-{{view App.FormFieldTemplate fieldBinding="view.form.field.method"}}
+{{view App.FormFieldTemplate fieldBinding="view.form.field.method" id="user-auth-method"}}
 
 {{#if view.ldapChecked}}
   {{view App.FormFieldTemplate fieldBinding="view.form.field.primaryServer"}}
@@ -42,8 +42,7 @@
       <p {{bindAttr class="view.form.testConfigurationClass"}}>{{view.form.testConfigurationMessage}}</p>
     {{/if}}
 {{/if}}
-<div class="span3"></div>
-<div>
+<div style="margin:40px 0">
   <button {{action updateValues target="view.form"}} class="btn">{{t form.cancel}}</button>
   <button {{action save view.form target="App.router.mainAdminAuthenticationController"}} class="btn btn-primary">{{t form.save}}</button>
 </div>
\ No newline at end of file



Mime
View raw message