incubator-ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yus...@apache.org
Subject svn commit: r1390762 [1/3] - in /incubator/ambari/branches/AMBARI-666: ./ ambari-web/app/ ambari-web/app/assets/img/ ambari-web/app/controllers/main/ ambari-web/app/controllers/main/admin/ ambari-web/app/controllers/main/admin/user/ ambari-web/app/cont...
Date Wed, 26 Sep 2012 22:32:51 GMT
Author: yusaku
Date: Wed Sep 26 22:32:47 2012
New Revision: 1390762

URL: http://svn.apache.org/viewvc?rev=1390762&view=rev
Log:
AMBARI-770. Cluster Management pages for Ambari Web. (yusaku)

Added:
    incubator/ambari/branches/AMBARI-666/ambari-web/app/assets/img/arrow-right.png   (with props)
    incubator/ambari/branches/AMBARI-666/ambari-web/app/assets/img/health-status-dead.png   (with props)
    incubator/ambari/branches/AMBARI-666/ambari-web/app/assets/img/health-status-live.png   (with props)
    incubator/ambari/branches/AMBARI-666/ambari-web/app/assets/img/status-corrupt.jpg   (with props)
    incubator/ambari/branches/AMBARI-666/ambari-web/app/assets/img/status-ok.jpg   (with props)
    incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/admin/
    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/
    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/dashboard.js
    incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/host/
    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/info/
    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/models/authentication.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_audit.js
    incubator/ambari/branches/AMBARI-666/ambari-web/app/models/service_metrics.js
    incubator/ambari/branches/AMBARI-666/ambari-web/app/templates/common/
    incubator/ambari/branches/AMBARI-666/ambari-web/app/templates/common/form/
    incubator/ambari/branches/AMBARI-666/ambari-web/app/templates/common/form.hbs
    incubator/ambari/branches/AMBARI-666/ambari-web/app/templates/common/form/checkbox.hbs
    incubator/ambari/branches/AMBARI-666/ambari-web/app/templates/common/form/field.hbs
    incubator/ambari/branches/AMBARI-666/ambari-web/app/templates/common/grid/
    incubator/ambari/branches/AMBARI-666/ambari-web/app/templates/common/grid/header.hbs
    incubator/ambari/branches/AMBARI-666/ambari-web/app/templates/main/admin/
    incubator/ambari/branches/AMBARI-666/ambari-web/app/templates/main/admin/advanced/
    incubator/ambari/branches/AMBARI-666/ambari-web/app/templates/main/admin/advanced.hbs
    incubator/ambari/branches/AMBARI-666/ambari-web/app/templates/main/admin/advanced/uninstall.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/
    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/admin/user/row.hbs
    incubator/ambari/branches/AMBARI-666/ambari-web/app/templates/main/host/
    incubator/ambari/branches/AMBARI-666/ambari-web/app/templates/main/host.hbs
    incubator/ambari/branches/AMBARI-666/ambari-web/app/templates/main/host/audit.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/metrics.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/
    incubator/ambari/branches/AMBARI-666/ambari-web/app/templates/main/service/info/audit.hbs
    incubator/ambari/branches/AMBARI-666/ambari-web/app/templates/main/service/info/configs.hbs
    incubator/ambari/branches/AMBARI-666/ambari-web/app/templates/main/service/info/metrics.hbs
    incubator/ambari/branches/AMBARI-666/ambari-web/app/templates/main/service/info/summary.hbs
    incubator/ambari/branches/AMBARI-666/ambari-web/app/utils/helper.js
    incubator/ambari/branches/AMBARI-666/ambari-web/app/views/common/form/
    incubator/ambari/branches/AMBARI-666/ambari-web/app/views/common/form/field.js
    incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/admin/
    incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/admin/advanced/
    incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/admin/advanced.js
    incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/admin/advanced/password.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/authentication.js
    incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/admin/menu.js
    incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/admin/security.js
    incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/admin/user/
    incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/admin/user.js
    incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/admin/user/edit.js
    incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/admin/user/row.js
    incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/host/
    incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/host.js
    incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/host/audit.js
    incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/host/details.js
    incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/host/menu.js
    incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/host/metrics.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/
    incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/info/audit.js
    incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/info/configs.js
    incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/info/menu.js
    incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/info/metrics.js
    incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/info/summary.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/main/alert.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/messages.js
    incubator/ambari/branches/AMBARI-666/ambari-web/app/models.js
    incubator/ambari/branches/AMBARI-666/ambari-web/app/models/alert.js
    incubator/ambari/branches/AMBARI-666/ambari-web/app/models/cluster.js
    incubator/ambari/branches/AMBARI-666/ambari-web/app/models/service.js
    incubator/ambari/branches/AMBARI-666/ambari-web/app/models/user.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/installer/slave_hosts.hbs
    incubator/ambari/branches/AMBARI-666/ambari-web/app/templates/main/admin.hbs
    incubator/ambari/branches/AMBARI-666/ambari-web/app/templates/main/dashboard.hbs
    incubator/ambari/branches/AMBARI-666/ambari-web/app/templates/main/menu.hbs
    incubator/ambari/branches/AMBARI-666/ambari-web/app/templates/main/service/item.hbs
    incubator/ambari/branches/AMBARI-666/ambari-web/app/utils/validator.js
    incubator/ambari/branches/AMBARI-666/ambari-web/app/views.js
    incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/admin.js
    incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/dashboard.js
    incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/menu.js
    incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/menu.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=1390762&r1=1390761&r2=1390762&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/AMBARI-666-CHANGES.txt (original)
+++ incubator/ambari/branches/AMBARI-666/AMBARI-666-CHANGES.txt Wed Sep 26 22:32:47 2012
@@ -12,6 +12,8 @@ AMBARI-666 branch (unreleased changes)
 
   NEW FEATURES
 
+  AMBARI-770. Cluster Management pages for Ambari Web. (yusaku)
+
   AMBARI-769. Implement step 9 (Install,start and test) of installer wizard.
   (Jaimin Jetly via yusaku)
 

Added: incubator/ambari/branches/AMBARI-666/ambari-web/app/assets/img/arrow-right.png
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/assets/img/arrow-right.png?rev=1390762&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/ambari/branches/AMBARI-666/ambari-web/app/assets/img/arrow-right.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/ambari/branches/AMBARI-666/ambari-web/app/assets/img/health-status-dead.png
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/assets/img/health-status-dead.png?rev=1390762&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/ambari/branches/AMBARI-666/ambari-web/app/assets/img/health-status-dead.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/ambari/branches/AMBARI-666/ambari-web/app/assets/img/health-status-live.png
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/assets/img/health-status-live.png?rev=1390762&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/ambari/branches/AMBARI-666/ambari-web/app/assets/img/health-status-live.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/ambari/branches/AMBARI-666/ambari-web/app/assets/img/status-corrupt.jpg
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/assets/img/status-corrupt.jpg?rev=1390762&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/ambari/branches/AMBARI-666/ambari-web/app/assets/img/status-corrupt.jpg
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/ambari/branches/AMBARI-666/ambari-web/app/assets/img/status-ok.jpg
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/assets/img/status-ok.jpg?rev=1390762&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/ambari/branches/AMBARI-666/ambari-web/app/assets/img/status-ok.jpg
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

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=1390762&r1=1390761&r2=1390762&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers.js Wed Sep 26 22:32:47 2012
@@ -31,6 +31,19 @@ require('controllers/installer/step6_con
 require('controllers/installer/step7_controller');
 require('controllers/installer/step9_controller');
 require('controllers/main');
+require('controllers/main/admin');
+require('controllers/main/admin/item');
+require('controllers/main/admin/user');
+require('controllers/main/admin/user/edit');
+require('controllers/main/admin/advanced');
+require('controllers/main/admin/authentication');
 require('controllers/main/service');
 require('controllers/main/service/item');
+require('controllers/main/service/info/summary');
+require('controllers/main/service/info/metrics');
+require('controllers/main/service/info/configs');
+require('controllers/main/service/info/audit');
 require('controllers/main/alert');
+require('controllers/main/host');
+require('controllers/main/host/details');
+require('controllers/main/dashboard');

Added: 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=1390762&view=auto
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/admin.js (added)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/admin.js Wed Sep 26 22:32:47 2012
@@ -0,0 +1,21 @@
+/**
+ * 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.
+ */
+
+App.MainAdminController = Em.Controller.extend({
+  name:'mainAdminController'
+})
\ No newline at end of file

Added: 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=1390762&view=auto
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/admin/advanced.js (added)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/admin/advanced.js Wed Sep 26 22:32:47 2012
@@ -0,0 +1,52 @@
+/**
+ * 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.
+ */
+
+App.MainAdminAdvancedController = Em.Controller.extend({
+  name:'mainAdminAdvancedController',
+  uninstall: function(event){
+    var params = event.context;
+    App.ModalPopup.show({
+      uninstallParams: params,
+      header: Em.I18n.t('admin.advanced.popup.header'),
+      bodyClass: App.MainAdminAdvancedPasswordView.reopen({}), // layout: Em.Handlebars.compile()
+      onPrimary: function(){
+        var form = this.getForm();
+        if(form) {
+          if(form.isValid()) {
+            console.warn("TODO: request for cluster uninstall");
+          }
+        }
+        this.onClose();
+      },
+      onSecondary: function(){
+        this.onClose();
+      },
+
+      getForm: function(){
+        var form = false;
+        $.each(this.get('_childViews'), function(){
+          if(this.get('path') == "bodyClass") {
+            return form = this.get('_childViews')[0];
+          }
+        });
+
+        return form;
+      }
+    })
+  }
+})
\ No newline at end of file

Added: 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=1390762&view=auto
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/admin/authentication.js (added)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/admin/authentication.js Wed Sep 26 22:32:47 2012
@@ -0,0 +1,34 @@
+/**
+ * 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.
+ */
+
+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();
+      }
+    });
+  },
+  content:App.Authentication.find(1)
+})
\ No newline at end of file

Added: 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=1390762&view=auto
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/admin/item.js (added)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/admin/item.js Wed Sep 26 22:32:47 2012
@@ -0,0 +1,21 @@
+/**
+ * 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.
+ */
+
+App.MainAdminItemController = Em.Controller.extend({
+  name:'mainAdminItemController'
+})
\ No newline at end of file

Added: 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=1390762&view=auto
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/admin/user.js (added)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/admin/user.js Wed Sep 26 22:32:47 2012
@@ -0,0 +1,27 @@
+/**
+ * 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.
+ */
+
+App.MainAdminUserController = Em.Controller.extend({
+  name:'mainAdminUserController',
+  deleteRecord:function (event) {
+    if (Em.I18n.t('question.sure')) {
+      event.context.deleteRecord();
+      App.store.commit();
+    }
+  }
+})
\ No newline at end of file

Added: 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=1390762&view=auto
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/admin/user/edit.js (added)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/admin/user/edit.js Wed Sep 26 22:32:47 2012
@@ -0,0 +1,22 @@
+/**
+ * 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.
+ */
+
+App.MainAdminUserEditController = Em.Controller.extend({
+  name:'mainAdminUserEditController',
+  content:false
+})
\ No newline at end of file

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=1390762&r1=1390761&r2=1390762&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 Sep 26 22:32:47 2012
@@ -17,6 +17,5 @@
  */
 
 App.MainAlertController = Em.ArrayController.extend({
-  name:'mainAlertController',
-  content: App.Alert.find()
+  name:'mainAlertController'
 })
\ No newline at end of file

Added: 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=1390762&view=auto
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/dashboard.js (added)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/dashboard.js Wed Sep 26 22:32:47 2012
@@ -0,0 +1,38 @@
+/**
+ * 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.
+ */
+
+App.MainDashboardController = Em.Controller.extend({
+  name:'mainDashboardController',
+  alerts: App.Alert.find(),
+  services:function(){
+    return App.router.get('mainServiceController.content');
+  }.property('App.router.mainServiceController.content'),
+  alertsFilteredBy: 'All',
+  alertsFilter: function(event) {
+    if (event.context) {
+      this.set('alerts', event.context.get('alerts'));
+      this.set('alertsFilteredBy', event.context.get('label'))
+    } else {
+      this.set('alerts', App.Alert.find());
+      this.set('alertsFilteredBy', 'All')
+    }
+  },
+  alertsCount: function() {
+    return this.alerts.get('content').length;
+  }.property()
+})
\ No newline at end of file

Added: 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=1390762&view=auto
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/host.js (added)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/host.js Wed Sep 26 22:32:47 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.
+ */
+
+
+App.MainHostController = Em.ArrayController.extend(App.Pagination, {
+  name:'mainHostController',
+  content: [],
+  fullContent: App.Host.find(),
+  clusters: App.Cluster.find(),
+  allComponents: App.Component.find(),
+  totalBinding: 'fullContent.length',
+  filters: {components:[]},
+  pageSize: 3,
+  pageSizeRange: [1,3,5,'all'],
+  rangeStart: 0,
+  allChecked: false,
+  selectedHostsIds: [],
+  sortingAsc: true,
+
+  isDisabled:true,
+
+  onAllChecked: function () {
+    var hosts = this.get('content');
+    hosts.setEach('isChecked', this.get('allChecked'));
+    this.set('isDisabled', !this.get('allChecked'));
+    var selectedHostsIds = this.get('allChecked') ? hosts.getEach('id'):[];
+    this.set('selectedHostsIds', selectedHostsIds);
+  }.observes('allChecked'),
+
+  onHostChecked: function (checked, hostId) {
+    var selected = this.get('selectedHostsIds');
+    if (checked) selected.push(hostId);
+    else {
+      var index = selected.indexOf(hostId);
+      if(index!=-1) selected.splice(index, 1);
+    }
+    this.set('isDisabled', selected.length == 0);
+  },
+
+  changeSelectedHosts: function() {
+    var visibleHosts = this.get('content');
+    var selectedHosts = visibleHosts.filterProperty('isChecked', true);
+    this.get('fullContent').forEach(function(item) {
+      var index = visibleHosts.getEach('id').indexOf(item.get('id'));
+      if(index == -1) item.set('isChecked', false);
+    });
+    this.set('isDisabled', selectedHosts.length == 0);
+    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);
+    }
+    this.changeContent();
+  },
+
+  filterByComponentId: function(componentId) {
+    this.set('filters.components', [componentId]);
+    this.changeContent();
+  },
+
+  changeContent: function() {
+    var items = [];
+    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;
+          }
+        });
+        if (inFilters){
+          items.push(item);
+        }
+      });
+      this.set('total', items.length);
+    } else {
+      items = this.get('fullContent');
+      this.set('total', this.get('fullContent.length'));
+    }
+    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'),
+
+  showNextPage: function() {
+    this.nextPage();
+  },
+  showPreviousPage: function() {
+    this.previousPage();
+  },
+  assignedToRackPopup: function(event) {
+    var self = this;
+    App.ModalPopup.show({
+      header: Em.I18n.t('hosts.assignedToRack.popup.header'),
+      body: Em.I18n.t('hosts.assignedToRack.popup.body'),
+      primary: 'Yes',
+      secondary: 'No',
+      onPrimary: function() {
+        self.assignedToRack(event.context);
+        this.hide();
+      },
+      onSecondary: function() {
+        this.hide();
+      }
+    });
+  },
+
+  assignedToRack: function(rack) {
+    var hosts = this.get('content');
+    var selectedHosts = hosts.filterProperty('isChecked', true);
+    selectedHosts.setEach('cluster', rack);
+  },
+
+  decommissionButtonPopup: function() {
+    var self = this;
+    App.ModalPopup.show({
+      header: Em.I18n.t('hosts.decommission.popup.header'),
+      body: Em.I18n.t('hosts.decommission.popup.body'),
+      primary: 'Yes',
+      secondary: 'No',
+      onPrimary: function() {
+        alert('do');
+        this.hide();
+      },
+      onSecondary: function() {
+        this.hide();
+      }
+    });
+  },
+  deleteButtonPopup: function() {
+    var self = this;
+    App.ModalPopup.show({
+      header: Em.I18n.t('hosts.delete.popup.header'),
+      body: Em.I18n.t('hosts.delete.popup.body'),
+      primary: 'Yes',
+      secondary: 'No',
+      onPrimary: function() {
+        self.removeHosts();
+        this.hide();
+      },
+      onSecondary: function() {
+        this.hide();
+      }
+    });
+  },
+  removeHosts: function () {
+    var hosts = this.get('content');
+    var selectedHosts = hosts.filterProperty('isChecked', true);
+    selectedHosts.forEach(function (_hostInfo) {
+      console.log('Removing:  ' + _hostInfo.hostName);
+    });
+//    App.db.removeHosts(selectedHosts);
+    this.get('fullContent').removeObjects(selectedHosts);
+  },
+  sortByName: function () {
+    var asc = this.get('sortingAsc');
+    var objects = this.get('fullContent').toArray().sort(function(a, b)
+    {
+      var nA = a.get('hostName').toLowerCase();
+      var nB = b.get('hostName').toLowerCase();
+      if(nA < nB)
+        return asc ? -1 : 1;
+      else if(nA > nB)
+        return asc ? 1 : -1;
+      return 0;
+    });
+    this.set('fullContent', objects);
+    this.set('sortingAsc', !this.get('sortingAsc'));
+    this.changeContent();
+  }
+
+});
\ No newline at end of file

Added: 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=1390762&view=auto
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/host/details.js (added)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/host/details.js Wed Sep 26 22:32:47 2012
@@ -0,0 +1,75 @@
+/**
+ * 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.
+ */
+
+App.MainHostDetailsController = Em.Controller.extend({
+  name: 'mainHostDetailsController',
+  content: null,
+  startComponents: 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: '',
+
+  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() {
+        console.log(self.get('content.components').getEach('workStatus'));
+        self.get('content.components').setEach('workStatus', self.get('content.workStatus'));
+
+        self.set('content.workStatus', !self.get('content.workStatus'));
+
+        this.hide();
+      },
+      onSecondary: function() {
+        this.hide();
+      }
+    });
+  },
+  stopConfirmPopup: function (event) {
+    var self = this;
+    App.ModalPopup.show({
+      header: Em.I18n.t('hosts.host.stop.popup.header'),
+      body: Em.I18n.t('hosts.host.stop.popup.body'),
+      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.set('content.workStatus', !self.get('content.workStatus'));
+        this.hide();
+      },
+      onSecondary: function() {
+        this.hide();
+      }
+    });
+  }
+})
\ No newline at end of file

Added: 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=1390762&view=auto
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/service/info/audit.js (added)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/service/info/audit.js Wed Sep 26 22:32:47 2012
@@ -0,0 +1,32 @@
+/**
+ * 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.
+ */
+
+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')
+})
\ No newline at end of file

Added: 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=1390762&view=auto
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/service/info/configs.js (added)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/service/info/configs.js Wed Sep 26 22:32:47 2012
@@ -0,0 +1,22 @@
+/**
+ * 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.
+ */
+
+App.MainServiceInfoConfigsController = Em.Controller.extend({
+  name: 'mainServiceInfoConfigsController',
+  content: 'Configs'
+})
\ No newline at end of file

Added: 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=1390762&view=auto
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/service/info/metrics.js (added)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/service/info/metrics.js Wed Sep 26 22:32:47 2012
@@ -0,0 +1,22 @@
+/**
+ * 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.
+ */
+
+App.MainServiceInfoMetricsController = Em.Controller.extend({
+  name: 'mainServiceInfoMetricsController',
+  content: 'Metrics'
+})
\ No newline at end of file

Added: 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=1390762&view=auto
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/service/info/summary.js (added)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/service/info/summary.js Wed Sep 26 22:32:47 2012
@@ -0,0 +1,21 @@
+/**
+ * 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.
+ */
+
+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=1390762&r1=1390761&r2=1390762&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 Sep 26 22:32:47 2012
@@ -18,5 +18,44 @@
 
 App.MainServiceItemController = Em.Controller.extend({
   name: 'mainServiceItemController',
-  content: null
+//  content: App.Service.find(1),
+  showRebalancer: function() {
+    if(this.content.get('serviceName') == 'hdfs') {
+      return true;
+    } else {
+      return false;
+    }
+  }.property('content'),
+  startConfirmPopup: function (event) {
+    App.ModalPopup.show({
+      header: Em.I18n.t('services.service.start.popup.header'),
+      body: Em.I18n.t('services.service.start.popup.body'),
+      primary: 'Yes',
+      secondary: 'No',
+      onPrimary: function() {
+        alert('do');
+        this.hide();
+      },
+      onSecondary: function() {
+        alert('not do');
+        this.hide();
+      }
+    });
+  },
+  stopConfirmPopup: function (event) {
+    App.ModalPopup.show({
+      header: Em.I18n.t('services.service.stop.popup.header'),
+      body: Em.I18n.t('services.service.stop.popup.body'),
+      primary: 'Yes',
+      secondary: 'No',
+      onPrimary: function() {
+        alert('do');
+        this.hide();
+      },
+      onSecondary: function() {
+        alert('not do');
+        this.hide();
+      }
+    });
+  }
 })
\ 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=1390762&r1=1390761&r2=1390762&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/initialize.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/initialize.js Wed Sep 26 22:32:47 2012
@@ -21,6 +21,7 @@ window.App = require('app');
 
 require('messages');
 require('utils/db');
+require('utils/helper');
 require('models');
 require('controllers');
 require('views');

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=1390762&r1=1390761&r2=1390762&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/messages.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/messages.js Wed Sep 26 22:32:47 2012
@@ -89,6 +89,7 @@ Em.I18n.translations = {
   'installer.step4.body': 'Choose which services you want to install on your cluster.<br>Note that some services have dependencies (e.g., HBase requires ZooKeeper.)',
 
   'installer.step5.header': 'Assign Masters',
+  'installer.step5.attention': 'more hosts without master service',
   'installer.step5.body': 'Assign master components to hosts you want to run them on.',
 
   'installer.step6.header': 'Assign Slaves',
@@ -108,6 +109,80 @@ 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',
 
-  '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.',
+
+  '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.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.users.ldapAuthentionUsed':'LDAP Authentication is being used to authenticate users',
+  'admin.users.addButton': 'Add User',
+  'admin.users.delete': 'delete',
+  'admin.users.edit': 'edit',
+  'admin.users.privileges': 'Admin',
+  'admin.users.password': 'Password',
+  'admin.users.passwordRetype': 'Retype Password',
+  'admin.users.username': 'Username',
+
+  'question.sure': 'Are you sure?',
+
+  'services.service.start': 'Start',
+  'services.service.stop': 'Stop',
+  'services.service.start.popup.header': 'Confirmation',
+  'services.service.stop.popup.header': 'Confirmation',
+  'services.service.start.popup.body': 'Are you sure?',
+  'services.service.stop.popup.body': 'Are you sure?',
+
+  'hosts.host.start.popup.header': 'Confirmation',
+  'hosts.host.stop.popup.header': 'Confirmation',
+  'hosts.host.start.popup.body': 'Are you sure?',
+  'hosts.host.stop.popup.body': 'Are you sure?',
+  'hosts.assignedToRack.popup.body': 'Are you sure?',
+  'hosts.assignedToRack.popup.header': 'Confirmation',
+  'hosts.decommission.popup.body': 'Are you sure?',
+  'hosts.decommission.popup.header': 'Confirmation',
+  'hosts.delete.popup.body': 'Are you sure?',
+  'hosts.delete.popup.header': 'Confirmation'
 };
+

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/models.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/models.js?rev=1390762&r1=1390761&r2=1390762&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/models.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/models.js Wed Sep 26 22:32:47 2012
@@ -19,8 +19,14 @@
 
 // load all models here
 
+require('models/form'); // should be the 1st
+require('models/authentication');
 require('models/cluster');
 require('models/hosts');
 require('models/service');
 require('models/service_config');
-require('models/alert');
\ No newline at end of file
+require('models/service_audit');
+require('models/service_metrics');
+require('models/alert');
+require('models/user');
+require('models/pagination');

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/models/alert.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/models/alert.js?rev=1390762&r1=1390761&r2=1390762&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/models/alert.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/models/alert.js Wed Sep 26 22:32:47 2012
@@ -32,16 +32,95 @@ App.Alert.FIXTURES = [
     title: 'Corrupt/Missing Block',
     service_id: 1,
     date: 'August 29, 2012 17:00',
-    status: 'all bad',
+    status: 'corrupt',
     message: 'message'
   },
-
   {
     id: 2,
     title: 'Corrupt/Missing Block',
+    service_id: 1,
+    date: 'August 30, 2012 17:00',
+    status: 'ok',
+    message: 'message'
+  },
+  {
+    id: 3,
+    title: 'Corrupt/Missing Block',
+    service_id: 2,
+    date: 'August 29, 2012 17:00',
+    status: 'corrupt',
+    message: 'message'
+  },
+  {
+    id: 4,
+    title: 'Corrupt/Missing Block',
     service_id: 2,
+    date: 'August 30, 2012 17:00',
+    status: 'ok',
+    message: 'message'
+  },
+  {
+    id: 5,
+    title: 'Corrupt/Missing Block',
+    service_id: 3,
+    date: 'August 29, 2012 17:00',
+    status: 'corrupt',
+    message: 'message'
+  },
+  {
+    id: 6,
+    title: 'Corrupt/Missing Block',
+    service_id: 3,
+    date: 'August 30, 2012 17:00',
+    status: 'ok',
+    message: 'message'
+  },
+  {
+    id: 7,
+    title: 'Corrupt/Missing Block',
+    service_id: 4,
+    date: 'August 29, 2012 17:00',
+    status: 'corrupt',
+    message: 'message'
+  },
+  {
+    id: 8,
+    title: 'Corrupt/Missing Block',
+    service_id: 4,
+    date: 'August 30, 2012 17:00',
+    status: 'ok',
+    message: 'message'
+  },
+  {
+    id: 9,
+    title: 'Corrupt/Missing Block',
+    service_id: 5,
     date: 'August 29, 2012 17:00',
-    status: 'all bad',
+    status: 'corrupt',
+    message: 'message'
+  },
+  {
+    id: 10,
+    title: 'Corrupt/Missing Block',
+    service_id: 5,
+    date: 'August 30, 2012 17:00',
+    status: 'ok',
+    message: 'message'
+  },
+  {
+    id: 11,
+    title: 'Corrupt/Missing Block',
+    service_id: 6,
+    date: 'August 29, 2012 17:00',
+    status: 'corrupt',
+    message: 'message'
+  },
+  {
+    id: 12,
+    title: 'Corrupt/Missing Block',
+    service_id: 6,
+    date: 'August 30, 2012 17:00',
+    status: 'ok',
     message: 'message'
   }
 ];
\ No newline at end of file

Added: 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=1390762&view=auto
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/models/authentication.js (added)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/models/authentication.js Wed Sep 26 22:32:47 2012
@@ -0,0 +1,87 @@
+/**
+ * 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.
+ */
+
+App.Authentication = DS.Model.extend({
+  method:DS.attr('boolean'), // use LDAP
+  primaryServer:DS.attr('string'),
+  secondaryServer:DS.attr('string'),
+  useSsl:DS.attr('boolean'),
+  bindMethod:DS.attr('boolean'), // use credentials
+  bindUser:DS.attr('string'),
+  password:DS.attr('string'),
+  retypePassword:DS.attr('string'),
+  searchBaseDn:DS.attr('string'),
+  usernameAttribute:DS.attr('string')
+});
+
+App.Authentication.FIXTURES = [
+  {
+    id:1,
+    method:false,
+    primary_server:"1.2.3.4:78",
+    secondary_server:"225.225.255.255:12",
+    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"
+  }
+]
+
+App.AuthenticationForm = App.Form.extend({
+  testResult:false,
+  isObjectNew:false,
+  fieldsOptions:[
+    { name:"method", displayName:"", isRequired:false, displayType:"select",
+      values:[
+        {value:0, label:Em.I18n.t("admin.authentication.form.method.database")},
+        {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:"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:"userDN", displayName:Em.I18n.t('admin.authentication.form.userDN') },
+    { name:"userPassword", displayName:Em.I18n.t('admin.authentication.form.password'), displayType:'password'}
+  ],
+  fields:[],
+  testConfiguration:function () {
+    console.warn('Configuration test is randomized');
+    this.set('testResult', parseInt(Math.random() * 2));
+    return true;
+  },
+  testConfigurationMessage:function () {
+    return this.get('testResult') ? Em.I18n.t('admin.authentication.form.test.success') : Em.I18n.t('admin.authentication.form.test.fail');
+  }.property('testResult'),
+  testConfigurationClass:function () {
+    return this.get('testResult') ? "text-success" : "text-error";
+  }.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=1390762&r1=1390761&r2=1390762&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 Sep 26 22:32:47 2012
@@ -20,9 +20,14 @@
 var App = require('app');
 
 App.User = Em.Object.extend({
-  username: null
+  username: DS.attr("string")
 });
 
+App.User.FIXTURES = [
+  {},
+  {}
+];
+
 App.ClusterModel = Em.Object.extend({
     clusterName: null,
     hosts: [],
@@ -46,31 +51,102 @@ DS.Model.reopen({
 */
 
 App.Host = DS.Model.extend({
-    hostName: DS.attr('string'),
-    cluster: DS.belongsTo('App.Cluster')
+  hostName: DS.attr('string'),
+  cluster: DS.belongsTo('App.Cluster'),
+  components: DS.hasMany('App.Component'),
+  cpu: DS.attr('string'),
+  memory: DS.attr('string'),
+  diskUsage: DS.attr('string'),
+  loadAvg: DS.attr('string'),
+  os: DS.attr('string'),
+  ip: DS.attr('string'),
+  isChecked: false,
+  healthStatus: DS.attr('string'),
+  workStatus: DS.attr('boolean')
 });
 
 App.Host.FIXTURES = [
-    {
-        id: 1,
-        host_name: 'host1',
-        cluster_id: 1
-    },
-    {
-        id: 2,
-        host_name: 'host2',
-        cluster_id: 1
-    },
-    {
-        id: 3,
-        host_name: 'host3',
-        cluster_id: 2
-    },
-    {
-        id: 4,
-        host_name: 'host4',
-        cluster_id: 2
-    }
+  {
+    id: 1,
+    host_name: 'z_host1',
+    cluster_id: 1,
+    components:[1, 2, 3, 4],
+    cpu: '2x2.5GHz',
+    memory: '8GB',
+    disk_usage: '40',
+    load_avg: '0.2, 1.2, 2.4',
+    ip: '123.123.123.123',
+    health_status: 'LIVE',
+    work_status: true
+  },
+  {
+    id: 2,
+    host_name: 'host2',
+    cluster_id: 1,
+    components:[4, 5],
+    cpu: '2x2.5GHz',
+    memory: '8GB',
+    disk_usage: '20',
+    load_avg: '0.2, 1.2, 2.4',
+    ip: '255.255.255.255',
+    health_status: 'DEAD',
+    work_status: true
+  },
+  {
+    id: 3,
+    host_name: 'n_host3',
+    cluster_id: 2,
+    components:[4, 5, 7],
+    health_status: 'LIVE',
+    work_status: false
+  },
+  {
+    id: 4,
+    host_name: 'b_host4',
+    cluster_id: 2,
+    health_status: 'DEAD',
+    work_status: false
+  },
+  {
+    id: 5,
+    host_name: 'host5',
+    cluster_id: 1,
+    components:[4, 5],
+    cpu: '2x2.5GHz',
+    memory: '8GB',
+    disk_usage: '20',
+    load_avg: '0.2, 1.2, 2.4',
+    ip: '255.255.255.255',
+    health_status: 'DEAD',
+    work_status: true
+  },
+  {
+    id: 6,
+    host_name: 'a_host6',
+    cluster_id: 1,
+    components:[4, 5],
+    cpu: '2x2.5GHz',
+    memory: '8GB',
+    disk_usage: '20',
+    load_avg: '0.2, 1.2, 2.4',
+    ip: '255.255.255.255',
+    health_status: 'LIVE',
+    work_status: false
+
+  },
+  {
+    id: 7,
+    host_name: 'host7',
+    cluster_id: 1,
+    components:[4, 5],
+    cpu: '2x2.5GHz',
+    memory: '8GB',
+    disk_usage: '20',
+    load_avg: '0.2, 1.2, 2.4',
+    ip: '255.255.255.255',
+    health_status: 'LIVE',
+    work_status: true
+  }
 ];
 
 App.Cluster = DS.Model.extend({
@@ -80,18 +156,18 @@ App.Cluster = DS.Model.extend({
 });
 
 App.Cluster.FIXTURES = [
-    {
-        id: 1,
-        cluster_name: 'cluster1',
-        stack_name: 'HDP',
-        hosts: [1, 2]
-    },
-
-    {
-        id: 2,
-        cluster_name: 'cluster2',
-        stack_name: 'BigTop',
-        hosts: [3]
-    }
+  {
+    id: 1,
+    cluster_name: 'cluster1',
+    stack_name: 'HDP',
+    hosts: [1, 2]
+  },
+
+{
+    id: 2,
+    cluster_name: 'cluster2',
+    stack_name: 'BigTop',
+    hosts: [3]
+  }
 ];
 

Added: 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=1390762&view=auto
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/models/form.js (added)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/models/form.js Wed Sep 26 22:32:47 2012
@@ -0,0 +1,267 @@
+/**
+ * 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');
+var validator = require('utils/validator');
+
+// move this to models cause some errors
+App.Form = Em.View.extend({
+  /**
+   * generating fields from fieldsOptions
+   */
+  classNames:["form-horizontal"],
+  i18nprefix:'form.',
+  fields:[],
+  field:{},
+  messages:[],
+  object:false,
+  result:0, // save result var (-1 - error; 0 - init; 1 - success)
+  templateName:require('templates/common/form'),
+  tagName:'form',
+
+  init:function () {
+    this._super();
+    var thisForm = this;
+    if (!this.fields.length)
+      $.each(this.fieldsOptions,
+        function () {
+          var field = App.FormField.create(this);
+          field.set('form', thisForm);
+          thisForm.fields.push(field);
+          thisForm.set("field." + field.get('name'), field);
+        });
+  },
+  getField:function (name) {
+//    return this.fields[name];
+
+    var field = false;
+    $.each(this.fields, function () {
+      if (this.get('name') == name) {
+        return field = this;
+      }
+    });
+    return field;
+
+  },
+  isValid:function () {
+    var isValid = true;
+    $.each(this.fields, function () {
+      this.validate();
+      if (!this.get('isValid')) {
+        isValid = false;
+      }
+    })
+
+    return isValid;
+  },
+
+  isObjectNew:function () {
+    var object = this.get('object');
+    return !(object instanceof DS.Model && object.get('id'));
+  }.property("object"),
+
+  updateValues:function () {
+    var object = this.get('object');
+    if (object instanceof Em.Object) {
+      $.each(this.fields, function () {
+        this.set('value', object.get(this.get('name')));
+      });
+    } else {
+      this.clearValues();
+    }
+
+  }.observes("object"),
+
+  /**
+   *
+   */
+  getValues:function () {
+    var values = {};
+    $.each(this.fields, function () {
+      values[this.get('name')] = this.get('value');
+    });
+    return values;
+  },
+
+  clearValues:function () {
+    $.each(this.fields, function () {
+      this.set('value', '');
+    });
+  },
+
+  /**
+   * need to refactor for integration
+   * @return {Boolean}
+   */
+  save:function () {
+    var thisForm = this;
+    var object = this.get('object');
+    if (!this.get('isObjectNew')) {
+      $.each(this.getValues(), function (i, v) {
+        object.set(i, v);
+      });
+    } else {
+      if (this.get('className'))
+        App.store.createRecord(App.User, this.getValues())
+      else
+        console.log("Please define class name for your form " + this.constructor);
+    }
+
+    App.store.commit();
+    this.set('result', 1);
+
+    return true;
+  },
+
+  resultText:function () {
+    var text = "";
+    switch (this.get('result')) {
+      case -1:
+        text = this.t("form.saveError");
+        break;
+      case 1:
+        text = this.t("form.saveSuccess");
+        break;
+    }
+
+    return text;
+  }.property('result'),
+
+  saveButtonText:function () {
+    return Em.I18n.t(this.get('i18nprefix') + (this.get('isObjectNew') ? "create" : "save"));
+  }.property('isObjectNew')
+
+//  not recommended
+//  cancelButtonText:function () {
+//    return Em.I18n.t(this.get('i18nprefix') + 'cancel').property();
+//  }
+});
+
+App.FormField = Em.Object.extend({ // try to realize this as view
+  name:'',
+  displayName:'',
+//  defaultValue:'', NOT REALIZED YET
+  description:'',
+  disabled:false,
+  displayType:'string', // string, digits, number, directories, textarea, checkbox
+  disableRequiredOnPresent:false,
+  errorMessage:'',
+  form:false,
+  isRequired:true, // by default a config property is required
+  unit:'',
+  value:null,
+
+  isValid:function () {
+    return this.get('errorMessage') === '';
+  }.property('errorMessage'),
+
+  viewClass:function () {
+    var options = {};
+    var element = Em.TextField;
+    switch (this.get('displayType')) {
+      case 'checkbox':
+        element = Em.Checkbox;
+        options.checkedBinding = "value";
+        break;
+      case 'select':
+        element = Em.Select;
+        options.content = this.get('values');
+        options.valueBinding = "value";
+        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;
+    }
+
+    return element.extend(options);
+  }.property('displayType'),
+
+  validate:function () {
+    var digitsRegex = /^\d+$/;
+    var numberRegex = /^-?(?:\d+|\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/;
+
+    var value = this.get('value');
+
+    var isError = false;
+
+    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 (!isError) {
+
+      switch (this.get('validator')) {
+        case 'ipaddress':
+          if (!validator.isIpAddress(value)) {
+            isError = true;
+            this.set('errorMessage', Em.I18n.t("form.validator.invalidIp"));
+          };
+          break;
+        default:
+          break;
+      }
+
+
+      switch (this.get('displayType')) {
+        case 'digits':
+          if (!digitsRegex.test(value)) {
+            this.set('errorMessage', 'Must contain digits only');
+            isError = true;
+          }
+          break;
+        case 'number':
+          if (!numberRegex.test(value)) {
+            this.set('errorMessage', 'Must be a valid number');
+            isError = true;
+          }
+          break;
+        case 'directories':
+          break;
+        case 'custom':
+          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) {
+      this.set('errorMessage', '');
+    }
+  }.observes('value')
+});
\ No newline at end of file

Added: 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=1390762&view=auto
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/models/pagination.js (added)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/models/pagination.js Wed Sep 26 22:32:47 2012
@@ -0,0 +1,81 @@
+/**
+ * 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');
+
+/**
+ @extends Ember.Mixin
+
+ Implements common pagination management properties for controllers.
+ */
+App.Pagination = Em.Mixin.create({
+
+  total: 0,
+  rangeStart: 0,
+  pageSize: 0,
+//  didRequestRange: Em.K,
+
+  rangeStop: function() {
+    var rangeStop = this.get('rangeStart') + this.get('pageSize'),
+      total = this.get('total');
+    if (rangeStop < total) {
+      return rangeStop;
+    }
+    return total;
+  }.property('total', 'rangeStart', 'pageSize').cacheable(),
+
+  hasPrevious: function() {
+    return this.get('rangeStart') > 0;
+  }.property('rangeStart').cacheable(),
+
+  hasNext: function() {
+    return this.get('rangeStop') < this.get('total');
+  }.property('rangeStop', 'total').cacheable(),
+
+  nextPage: function() {
+    if (this.get('hasNext')) {
+      this.incrementProperty('rangeStart', this.get('pageSize'));
+    }
+  },
+
+  previousPage: function() {
+    if (this.get('hasPrevious')) {
+      this.decrementProperty('rangeStart', this.get('pageSize'));
+    }
+  },
+
+  currentPage: function () {
+    return this.get('rangeStop') / this.get('pageSize');
+  }.property('rangeStop', 'pageSize').cacheable(),
+
+  startPosition: function() {
+    return this.get('rangeStart')  + 1;
+  }.property('rangeStart').cacheable(),
+
+  totalPages: function() {
+    return Math.ceil(this.get('total') / this.get('pageSize'));
+  }.property('total', 'pageSize').cacheable(),
+
+//  changeContent: function() {
+////    this.didRequestRange(this.get('rangeStart'), this.get('rangeStop'));
+//  }.observes('total', 'rangeStart', 'rangeStop'),
+
+  pageSizeChange: function() {
+    this.set('rangeStart', 0);
+  }.observes('pageSize')
+
+});
\ No newline at end of file

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=1390762&r1=1390761&r2=1390762&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 Sep 26 22:32:47 2012
@@ -56,52 +56,84 @@ App.ServiceModel = Em.Object.extend({
 
 App.Component = DS.Model.extend({
   componentName:DS.attr('string'),
+  label:DS.attr('string'),
+  type:DS.attr('boolean'),
   service:DS.belongsTo('App.Service'),
-  host:DS.belongsTo('App.Host')
+  host:DS.belongsTo('App.Host'),
+  workStatus:DS.attr('string')
 });
 
 App.Component.FIXTURES = [
   {
     id:1,
     component_name:'NameNode',
+    label: 'NN',
+    type: true,
     service_id:1,
-    host_id:1
+    host_id:1,
+    work_status:true
   },
   {
     id:2,
     component_name:'SNameNode',
+    label: 'SNN',
+    type: true,
     service_id:1,
-    host_id:2
+    host_id:2,
+    work_status:false
   },
   {
     id:3,
     component_name:'DataNode',
+    label: 'DN',
     service_id:1,
+    type: false,
     host_id:2
   },
   {
     id:4,
-    component_name:'100Tracker',
+    component_name:'JobTracker',
+    label: 'TT',
+    type: true,
     service_id:2,
-    host_id:4
+    host_id:4,
+    work_status:true
   },
   {
     id:5,
-    component_name:'jobTaskTracker',
+    component_name:'TaskTracker',
+    label: 'JT',
+    type: false,
     service_id:2,
     host_id:4
+  },
+  {
+    id:6,
+    component_name:'HBase Master',
+    label: 'HBM',
+    type: true,
+    service_id:3,
+    host_id:4
+  },
+  {
+    id:7,
+    component_name:'Region Server',
+    label: 'RS',
+    type: false,
+    service_id:3,
+    host_id:2
   }
 ];
-// COMPONENTS:
-//- HbaseMaster, 100 Region Servers
-//Zookeeper - 3 Zookeeper Servers
-//Oozie - Oozie Master
-//Hive - Hive Metastore
 
 App.Service = DS.Model.extend({
-  serviceName:DS.attr('string'),
-  label:DS.attr('string'),
-  components:DS.hasMany('App.Component')
+  serviceName: DS.attr('string'),
+  label: DS.attr('string'),
+  components: DS.hasMany('App.Component'),
+  serviceAudit: DS.hasMany('App.ServiceAudit'),
+  healthStatus: DS.attr('string'),
+  workStatus: DS.attr('boolean'),
+  alerts: DS.hasMany('App.Alert'),
+  quickLinks: DS.hasMany('App.QuickLinks')
 });
 
 App.Service.FIXTURES = [
@@ -109,33 +141,134 @@ App.Service.FIXTURES = [
     id:1,
     service_name:'hdfs',
     label:'HDFS',
-    components:[1, 2, 3]
+    components: [1, 2, 3],
+    service_audit: [1, 2, 3],
+    health_status: 'LIVE',
+    work_status: true,
+    alerts: [1, 2],
+    quick_links: [1, 2, 3, 4]
   },
   {
     id:2,
     service_name:'mapreduce',
     label:'MapReduce',
-    components:[4, 5]
+    components: [4, 5],
+    service_audit: [4, 5, 6],
+    health_status: 'LIVE',
+    work_status: true,
+    alerts: [3, 4],
+    quick_links: [5, 6, 7, 8, 9, 10]
   },
   {
     id:3,
     service_name:'hbase',
-    label:'HBase'
+    label:'HBase',
+    components: [6, 7],
+    health_status: 'DEAD',
+    work_status: false,
+    alerts: [5, 6],
+    quick_links: [11, 12, 13, 14]
   },
   {
     id:4,
     service_name:'zookeeper',
-    label:'Zookeeper'
+    label:'Zookeeper',
+    health_status: 'DEAD',
+    work_status: false,
+    alerts: [7, 8]
   },
   {
     id:5,
     service_name:'oozie',
-    label:'Oozie'
+    label:'Oozie',
+    health_status: 'DEAD',
+    work_status: false,
+    alerts: [9, 10]
   },
   {
     id:6,
     service_name:'hive',
-    label:'Hive'
+    label:'Hive',
+    health_status: 'DEAD',
+    work_status: false,
+    alerts: [11, 12]
   }
 ];
 
+App.QuickLinks = DS.Model.extend({
+  label: DS.attr('string'),
+  url: DS.attr('string')
+});
+
+App.QuickLinks.FIXTURES = [
+  {
+    id: 1,
+    label: 'NameNode UI',
+    url: ''
+  },
+  {
+    id: 2,
+    label: 'NameNode logs',
+    url: ''
+  },
+  {
+    id: 3,
+    label: 'NameNode JMX',
+    url: ''
+  },
+  {
+    id: 4,
+    label: 'Thread Stacks',
+    url: ''
+  },
+  {
+    id: 5,
+    label: 'JobTracker UI',
+    url: ''
+  },
+  {
+    id: 6,
+    label: 'Scheduling Info',
+    url: ''
+  },
+  {
+    id: 7,
+    label: 'Running Jobs',
+    url: ''
+  },
+  {
+    id: 8,
+    label: 'Retired Jobs',
+    url: ''
+  },
+  {
+    id: 9,
+    label: 'JobHistory Server',
+    url: ''
+  },
+  {
+    id: 10,
+    label: 'JobTracker Logs',
+    url: ''
+  },
+  {
+    id: 11,
+    label: 'HBase Master UI',
+    url: ''
+  },
+  {
+    id: 12,
+    label: 'HBase Logs',
+    url: ''
+  },
+  {
+    id: 13,
+    label: 'Zookeeper Info',
+    url: ''
+  },
+  {
+    id: 14,
+    label: 'HBase Master JMX',
+    url: ''
+  }
+];

Added: 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=1390762&view=auto
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/models/service_audit.js (added)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/models/service_audit.js Wed Sep 26 22:32:47 2012
@@ -0,0 +1,65 @@
+/**
+ * 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.ServiceAudit = DS.Model.extend({
+  date: DS.attr('date'),
+  service: DS.belongsTo('App.Service'),
+  operationName: DS.attr('string'),
+  user: DS.belongsTo('App.User')
+});
+
+App.ServiceAudit.FIXTURES = [
+  {
+    id: 1,
+    date: 'September 12, 2012 17:00',
+    operation_name: 'Reconfigure',
+    user_id: 2
+  },
+  {
+    id: 2,
+    date: 'September 13, 2012 17:00',
+    operation_name: 'Start',
+    user_id: 1
+  },
+  {
+    id: 3,
+    date: 'September 14, 2012 17:00',
+    operation_name: 'Install',
+    user_id: 1
+  },
+  {
+    id: 4,
+    date: 'September 12, 2012 17:00',
+    operation_name: 'Reconfigure',
+    user_id: 2
+  },
+  {
+    id: 5,
+    date: 'September 13, 2012 17:00',
+    operation_name: 'Start',
+    user_id: 1
+  },
+  {
+    id: 6,
+    date: 'September 14, 2012 17:00',
+    operation_name: 'Install',
+    user_id: 1
+  }
+];
\ No newline at end of file

Added: incubator/ambari/branches/AMBARI-666/ambari-web/app/models/service_metrics.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/models/service_metrics.js?rev=1390762&view=auto
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/models/service_metrics.js (added)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/models/service_metrics.js Wed Sep 26 22:32:47 2012
@@ -0,0 +1,20 @@
+/**
+ * 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');
\ 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=1390762&r1=1390761&r2=1390762&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 Sep 26 22:32:47 2012
@@ -18,9 +18,53 @@
 
 var App = require('app');
 
-App.userModel = Em.Object.extend({
+App.UserModel = Em.Object.extend({
+  userName:null,
+  id:0
+});
 
-  firstName : null,
-  id  : 0
+App.User = DS.Model.extend({
+  userName:DS.attr('string'),
+  admin:DS.attr('boolean'),
+  password:DS.attr('string'),
+  auditItems:DS.hasMany('App.ServiceAudit')
+});
 
-});
\ No newline at end of file
+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:"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')
+});
+
+App.User.FIXTURES = [
+  {
+    id:1,
+    user_name:'admin',
+    password: 'admin',
+    admin:1
+  },
+  {
+    id:2,
+    user_name:'vrossi',
+    admin:1
+  },
+  {
+    id:3,
+    user_name:'casey.stoner',
+    admin:0
+  },
+  {
+    id:4,
+    user_name:'danip',
+    admin:0
+  }
+];
\ No newline at end of file



Mime
View raw message