Browse Source

AMBARI-6589. Management Console: UI Layout, Basic Routing and Create User Management Page (with mock data). (jaimin)

Jaimin Jetly 11 years ago
parent
commit
31242e8f7d
41 changed files with 2049 additions and 15 deletions
  1. 124 15
      ambari-admin/pom.xml
  2. 3 0
      ambari-admin/src/main/resources/ui/admin-web/.bowerrc
  3. 10 0
      ambari-admin/src/main/resources/ui/admin-web/.gitignore
  4. 24 0
      ambari-admin/src/main/resources/ui/admin-web/.jshintrc
  5. 124 0
      ambari-admin/src/main/resources/ui/admin-web/app/index.html
  6. 32 0
      ambari-admin/src/main/resources/ui/admin-web/app/scripts/app.js
  7. 22 0
      ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/ambariViews/ViewsEditCtrl.js
  8. 22 0
      ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/ambariViews/ViewsListCtrl.js
  9. 62 0
      ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/clusters/ClustersManageAccessCtrl.js
  10. 22 0
      ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/groups/GroupsListCtrl.js
  11. 22 0
      ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/mainCtrl.js
  12. 35 0
      ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/users/UsersCreateCtrl.js
  13. 52 0
      ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/users/UsersListCtrl.js
  14. 91 0
      ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/users/UsersShowCtrl.js
  15. 36 0
      ambari-admin/src/main/resources/ui/admin-web/app/scripts/directives/PasswordVerify.js
  16. 40 0
      ambari-admin/src/main/resources/ui/admin-web/app/scripts/directives/linkToDir.js
  17. 104 0
      ambari-admin/src/main/resources/ui/admin-web/app/scripts/routes.js
  18. 62 0
      ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/User.js
  19. 78 0
      ambari-admin/src/main/resources/ui/admin-web/app/styles/main.css
  20. 99 0
      ambari-admin/src/main/resources/ui/admin-web/app/views/ambariViews/edit.html
  21. 123 0
      ambari-admin/src/main/resources/ui/admin-web/app/views/ambariViews/list.html
  22. 63 0
      ambari-admin/src/main/resources/ui/admin-web/app/views/clusters/manageAccess.html
  23. 59 0
      ambari-admin/src/main/resources/ui/admin-web/app/views/groups/list.html
  24. 17 0
      ambari-admin/src/main/resources/ui/admin-web/app/views/groupsAdmin.html
  25. 53 0
      ambari-admin/src/main/resources/ui/admin-web/app/views/leftNavbar.html
  26. 21 0
      ambari-admin/src/main/resources/ui/admin-web/app/views/main.html
  27. 64 0
      ambari-admin/src/main/resources/ui/admin-web/app/views/users/create.html
  28. 62 0
      ambari-admin/src/main/resources/ui/admin-web/app/views/users/list.html
  29. 52 0
      ambari-admin/src/main/resources/ui/admin-web/app/views/users/modals/changePassword.html
  30. 24 0
      ambari-admin/src/main/resources/ui/admin-web/app/views/users/modals/deleteUserConfirmation.html
  31. 103 0
      ambari-admin/src/main/resources/ui/admin-web/app/views/users/show.html
  32. 12 0
      ambari-admin/src/main/resources/ui/admin-web/bower.json
  33. 145 0
      ambari-admin/src/main/resources/ui/admin-web/gulpfile.js
  34. 67 0
      ambari-admin/src/main/resources/ui/admin-web/mock.js
  35. 32 0
      ambari-admin/src/main/resources/ui/admin-web/package.json
  36. 3 0
      ambari-admin/src/main/resources/ui/admin-web/test/.bowerrc
  37. 9 0
      ambari-admin/src/main/resources/ui/admin-web/test/bower.json
  38. 44 0
      ambari-admin/src/main/resources/ui/admin-web/test/index.html
  39. 30 0
      ambari-admin/src/main/resources/ui/admin-web/test/spec/test.js
  40. 1 0
      ambari-web/app/messages.js
  41. 1 0
      ambari-web/app/templates/application.hbs

+ 124 - 15
ambari-admin/pom.xml

@@ -58,6 +58,72 @@
           </execution>
         </executions>
       </plugin>
+      <plugin>
+        <groupId>com.github.eirslett</groupId>
+        <artifactId>frontend-maven-plugin</artifactId>
+        <version>0.0.14</version>
+        <configuration>
+          <nodeVersion>v0.10.26</nodeVersion>
+          <npmVersion>1.4.3</npmVersion>
+          <workingDirectory>src/main/resources/ui/admin-web/</workingDirectory>
+        </configuration>
+        <executions>
+          <execution>
+            <id>install node and npm</id>
+            <phase>generate-sources</phase>
+            <goals>
+              <goal>install-node-and-npm</goal>
+            </goals>
+          </execution>
+          <execution>
+            <id>npm install</id>
+            <phase>generate-sources</phase>
+            <goals>
+              <goal>npm</goal>
+            </goals>
+            <configuration>
+              <arguments>install --unsafe-perm</arguments>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+      <plugin>
+        <artifactId>exec-maven-plugin</artifactId>
+        <groupId>org.codehaus.mojo</groupId>
+        <executions>
+          <execution>
+            <id>Bower install</id>
+            <phase>generate-sources</phase>
+            <goals>
+              <goal>exec</goal>
+            </goals>
+            <configuration>
+              <workingDirectory>${basedir}/src/main/resources/ui/admin-web</workingDirectory>
+              <executable>node/node</executable>
+              <arguments>
+                <argument>node_modules/bower/bin/bower</argument>
+                <argument>install</argument>
+                <argument>--allow-root</argument>
+              </arguments>
+            </configuration>
+          </execution>
+          <execution>
+            <id>Gulp build</id>
+            <phase>generate-sources</phase>
+            <goals>
+              <goal>exec</goal>
+            </goals>
+            <configuration>
+              <workingDirectory>${basedir}/src/main/resources/ui/admin-web</workingDirectory>
+              <executable>node/node</executable>
+              <arguments>
+                <argument>node_modules/gulp/bin/gulp</argument>
+                <argument>build</argument>
+              </arguments>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
       <plugin>
         <artifactId>maven-compiler-plugin</artifactId>
         <version>3.0</version>
@@ -71,22 +137,65 @@
         </configuration>
       </plugin>
       <plugin>
-          <groupId>org.vafer</groupId>
-          <artifactId>jdeb</artifactId>
-          <version>1.0.1</version>
-          <executions>
-              <execution>
-                  <phase>none</phase>
-                  <goals>
-                      <goal>jdeb</goal>
-                  </goals>
-              </execution>
-          </executions>
-          <configuration>
-              <skip>true</skip>
-              <submodules>false</submodules>
-          </configuration>
+        <groupId>org.vafer</groupId>
+        <artifactId>jdeb</artifactId>
+        <version>1.0.1</version>
+        <executions>
+            <execution>
+                <phase>none</phase>
+                <goals>
+                    <goal>jdeb</goal>
+                </goals>
+            </execution>
+        </executions>
+        <configuration>
+            <skip>true</skip>
+            <submodules>false</submodules>
+        </configuration>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.rat</groupId>
+        <artifactId>apache-rat-plugin</artifactId>
+        <configuration>
+          <excludes>
+            <exclude>src/main/resources/ui/admin-web/bower_components/**</exclude>
+            <exclude>src/main/resources/ui/admin-web/dist/**</exclude>
+            <exclude>src/main/resources/ui/admin-web/node/**</exclude>
+            <exclude>src/main/resources/ui/admin-web/node_modules/**</exclude>
+            <exclude>src/main/resources/ui/admin-web/app/bower_components/**</exclude>
+            <exclude>src/main/resources/ui/admin-web/test/bower_components/**</exclude>
+            <exclude>src/main/resources/ui/admin-web/mock.js</exclude>
+            <exclude>src/main/resources/ui/admin-web/bower.json</exclude>
+            <exclude>src/main/resources/ui/admin-web/test/bower.json</exclude>
+            <exclude>src/main/resources/ui/admin-web/test/.bowerrc</exclude>
+            <exclude>src/main/resources/ui/admin-web/.bowerrc</exclude>
+            <exclude>src/main/resources/ui/admin-web/package.json</exclude>
+            <exclude>src/main/resources/ui/admin-web/.jshintrc</exclude>
+          </excludes>
+        </configuration>
+        <executions>
+          <execution>
+            <phase>test</phase>
+            <goals>
+              <goal>check</goal>
+            </goals>
+          </execution>
+        </executions>
       </plugin>
     </plugins>
+    <resources>
+      <resource>
+        <directory>src/main/resources</directory>
+        <filtering>false</filtering>
+        <includes>
+          <include>META-INF/**/*</include>
+          <include>view.xml</include>
+        </includes>
+      </resource>
+      <resource>
+        <directory>src/main/resources/ui/admin-web/dist</directory>
+        <filtering>false</filtering>
+      </resource>
+    </resources>
   </build>
 </project>

+ 3 - 0
ambari-admin/src/main/resources/ui/admin-web/.bowerrc

@@ -0,0 +1,3 @@
+{
+    "directory": "app/bower_components"
+}

+ 10 - 0
ambari-admin/src/main/resources/ui/admin-web/.gitignore

@@ -0,0 +1,10 @@
+node_modules
+public
+.tmp
+.sass-cache
+app/bower_components
+test/bower_components
+heroku
+/views
+dist
+node

+ 24 - 0
ambari-admin/src/main/resources/ui/admin-web/.jshintrc

@@ -0,0 +1,24 @@
+{
+  "node": true,
+  "browser": true,
+  "esnext": true,
+  "bitwise": true,
+  "camelcase": true,
+  "curly": true,
+  "eqeqeq": true,
+  "immed": true,
+  "indent": 2,
+  "latedef": true,
+  "newcap": true,
+  "noarg": true,
+  "quotmark": "single",
+  "regexp": true,
+  "undef": true,
+  "unused": false,
+  "strict": true,
+  "trailing": true,
+  "smarttabs": true,
+  "globals": {
+    "angular": false
+  }
+}

+ 124 - 0
ambari-admin/src/main/resources/ui/admin-web/app/index.html

@@ -0,0 +1,124 @@
+<!--
+* 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.
+-->
+<!doctype html>
+<html class="no-js">
+  <head>
+    <meta charset="utf-8">
+    <title>AdminConsole</title>
+    <meta name="description" content="">
+    <meta name="viewport" content="width=device-width, initial-scale=1">
+    <!-- Place favicon.ico and apple-touch-icon.png in the root directory -->
+
+    <!-- build:css styles/vendor.css -->
+    <!-- bower:css -->
+    <link rel="stylesheet" href="bower_components/bootstrap/dist/css/bootstrap.css" />
+    <!-- endbower -->
+    <!-- endbuild -->
+
+    <!-- build:css styles/main.css -->
+    <link rel="stylesheet" href="styles/main.css">
+    <!-- endbuild -->
+
+  </head>
+  <body ng-app="ambariAdminConsole">
+    <!--[if lt IE 10]>
+      <p class="browsehappy">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p>
+    <![endif]-->
+
+    <header class="navbar navbar-static-top navbar-inverse">
+      <div class="navbar-inner">
+        <div class="container">
+          <div class="navbar-header">
+            <a href="/#/main/dashboard" class="navbar-brand">Ambari Admin Console</a>
+          </div>  
+          <ul class="nav navbar-nav navbar-right">
+            <li>
+              <div class="btn-group" dropdown is-open="status.isopen">
+              <button type="button" class="btn btn-default dropdown-toggle navbar-btn" ng-disabled="disabled">
+                  Admin <span class="caret"></span>
+                </button>
+                <ul class="dropdown-menu" role="menu">
+                  <li><a href="#">About</a></li>
+                  <li><a href="#">Settings</a></li>
+                  <li><a href="#">Manage Ambari</a></li>
+                  <li class="divider"></li>
+                  <li><a href="#">Sign Out</a></li>
+                </ul>
+              </div>
+            </li>
+          </ul>
+        </div>        
+      </div>
+        
+    </header>
+    <div class="container">
+      <div class="row">
+        <div class="col-sm-3">
+          <div ng-include="'views/leftNavbar.html'"></div>
+        </div>
+        <div class="col-sm-9">
+          <ng-view></ng-view>
+        </div>
+      </div>
+    </div>
+
+    
+    <!-- build:js scripts/vendor.js -->
+    <!-- bower:js -->
+    <script src="bower_components/jquery/dist/jquery.js"></script>
+    <script src="bower_components/bootstrap/dist/js/bootstrap.js"></script>
+    <script src="bower_components/angular/angular.js"></script>
+    <script src="bower_components/angular-route/angular-route.js"></script>
+    <script src="bower_components/angular-bootstrap/ui-bootstrap-tpls.js"></script>
+    <script src="bower_components/lodash/dist/lodash.compat.js"></script>
+    <script src="bower_components/restangular/dist/restangular.js"></script>
+    <!-- endbower -->
+    <!-- endbuild -->
+
+    <!-- build:js scripts/plugins.js -->
+    <script src="bower_components/bootstrap/js/affix.js"></script>
+    <script src="bower_components/bootstrap/js/alert.js"></script>
+    <script src="bower_components/bootstrap/js/dropdown.js"></script>
+    <script src="bower_components/bootstrap/js/tooltip.js"></script>
+    <script src="bower_components/bootstrap/js/modal.js"></script>
+    <script src="bower_components/bootstrap/js/transition.js"></script>
+    <script src="bower_components/bootstrap/js/button.js"></script>
+    <script src="bower_components/bootstrap/js/popover.js"></script>
+    <script src="bower_components/bootstrap/js/carousel.js"></script>
+    <script src="bower_components/bootstrap/js/scrollspy.js"></script>
+    <script src="bower_components/bootstrap/js/collapse.js"></script>
+    <script src="bower_components/bootstrap/js/tab.js"></script>
+    <!-- endbuild -->
+
+    <!-- build:js scripts/main.js -->
+    <script src="scripts/app.js"></script>
+    <script src="scripts/routes.js"></script>
+    <script src="scripts/controllers/mainCtrl.js"></script>
+    <script src="scripts/controllers/users/UsersCreateCtrl.js"></script>
+    <script src="scripts/controllers/users/UsersListCtrl.js"></script>
+    <script src="scripts/controllers/users/UsersShowCtrl.js"></script>
+    <script src="scripts/controllers/groups/GroupsListCtrl.js"></script>
+    <script src="scripts/controllers/ambariViews/ViewsListCtrl.js"></script>
+    <script src="scripts/controllers/ambariViews/ViewsEditCtrl.js"></script>
+    <script src="scripts/controllers/clusters/ClustersManageAccessCtrl.js"></script>
+    <script src="scripts/directives/linkToDir.js"></script>
+    <script src="scripts/directives/PasswordVerify.js"></script>
+    <script src="scripts/services/User.js"></script>
+    <!-- endbuild -->
+</body>
+</html>

+ 32 - 0
ambari-admin/src/main/resources/ui/admin-web/app/scripts/app.js

@@ -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.
+ */
+'use strict';
+
+angular.module('ambariAdminConsole', [
+  'ngRoute',
+  'ui.bootstrap',
+  'restangular'
+])
+.config(['RestangularProvider', '$httpProvider', function(RestangularProvider, $httpProvider) {
+  // Config Ajax-module
+  RestangularProvider.setBaseUrl('/api/v1');
+  RestangularProvider.setDefaultHeaders({'X-Requested-By':'ambari'});
+
+  $httpProvider.defaults.headers.post['Content-Type'] = 'plain/text';
+  $httpProvider.defaults.headers.put['Content-Type'] = 'plain/text';
+}]);

+ 22 - 0
ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/ambariViews/ViewsEditCtrl.js

@@ -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.
+ */
+'use strict';
+
+angular.module('ambariAdminConsole')
+.controller('ViewsEditCtrl', ['$scope', function($scope) {
+}]);

+ 22 - 0
ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/ambariViews/ViewsListCtrl.js

@@ -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.
+ */
+'use strict';
+
+angular.module('ambariAdminConsole')
+.controller('ViewsListCtrl',['$scope', function($scope) {
+}]);

+ 62 - 0
ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/clusters/ClustersManageAccessCtrl.js

@@ -0,0 +1,62 @@
+/**
+ * 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.
+ */
+'use strict';
+
+angular.module('ambariAdminConsole')
+.controller('ClustersManageAccessCtrl', ['$scope', function($scope) {
+  $scope.isEditMode = false;
+  $scope.permissions = {
+    read:{
+      users: ['bill', 'kat'],
+      groups: ['users', 'contractors']
+    },
+    operate:{
+      users: ['jeff', 'tom', 'john', 'mike', 'steve'],
+      groups: ['sysadmins', 'hadoopadmins']
+    }
+  };
+
+  var processInput = function(obj) {
+    var result = [], item;
+    if(typeof obj === 'string'){
+      obj = obj.split(',');
+    } else if(!Array.isArray(obj)){
+      throw 'processInput:: argument must be Array or string!';
+    }
+    // Remove doubles
+    for(var i=0, max = obj.length; i < max; i++){
+      item = obj[i];
+      if(item != false && result.indexOf(item) < 0){
+
+        result.push(item);
+      }
+    }
+    return result;
+  };
+
+  $scope.toggleEditMode = function() {
+    if($scope.isEditMode){
+      $scope.permissions.read.users = processInput($scope.permissions.read.users);
+      $scope.permissions.read.groups = processInput($scope.permissions.read.groups);
+
+      $scope.permissions.operate.users = processInput($scope.permissions.operate.users);
+      $scope.permissions.operate.groups = processInput($scope.permissions.operate.groups);
+    }
+    $scope.isEditMode = !$scope.isEditMode;
+  };
+}]);

+ 22 - 0
ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/groups/GroupsListCtrl.js

@@ -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.
+ */
+'use strict';
+
+angular.module('ambariAdminConsole')
+.controller('GroupsListCtrl',['$scope', function($scope) {
+}]);

+ 22 - 0
ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/mainCtrl.js

@@ -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.
+ */
+'use strict';
+
+angular.module('ambariAdminConsole')
+.controller('MainCtrl',[function() {
+}]);

+ 35 - 0
ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/users/UsersCreateCtrl.js

@@ -0,0 +1,35 @@
+/**
+ * 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.
+ */
+'use strict';
+
+angular.module('ambariAdminConsole')
+.controller('UsersCreateCtrl',['$scope', '$routeParams', 'User', '$location', function($scope, $routeParams, User, $location) {
+  $scope.user = {};
+
+  $scope.createUser = function() {
+    $scope.form.submitted = true;
+    if ($scope.form.$valid){
+      User.create({
+        'Users/user_name': $scope.user.user_name,
+        'Users/password': $scope.user.password
+      }).then(function() {
+        $location.path('/users');
+      });
+    }
+  };
+}]);

+ 52 - 0
ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/users/UsersListCtrl.js

@@ -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.
+ */
+'use strict';
+
+angular.module('ambariAdminConsole')
+.controller('UsersListCtrl',['$scope', 'User', function($scope, User) {
+  $scope.users = [];
+  User.list().then(function(data) {
+    $scope.users = data.items;
+  });
+
+  $scope.actvieFilterOptions = ['All', 'Active', 'Inactive'];
+  $scope.currentActiveFilter = 'All';
+  $scope.activeFilter = function(user) {
+    var af = $scope.currentActiveFilter;
+    if (af === 'All') {
+      return user;
+    } else if(af === 'Active' && user.Users.active){
+      return user;
+    } else if(af === 'Inactive' && !user.Users.active){
+      return user;
+    }
+  };
+
+  $scope.typeFilterOptions = ['All', 'Local', 'LDAP'];
+  $scope.currentTypeFilter = 'All';
+  $scope.typeFilter = function(user) {
+    var tf = $scope.currentTypeFilter;
+    if (tf === 'All') {
+      return user;
+    } else if(tf === 'Local' && !user.Users.ldap_user){
+      return user;
+    } else if(tf === 'LDAP' && user.Users.ldap_user){
+      return user;
+    }
+  };
+}]);

+ 91 - 0
ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/users/UsersShowCtrl.js

@@ -0,0 +1,91 @@
+/**
+ * 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.
+ */
+'use strict';
+
+angular.module('ambariAdminConsole')
+.controller('UsersShowCtrl', ['$scope', '$routeParams', 'User', '$modal', '$location', function($scope, $routeParams, User, $modal, $location) {
+  $scope.user = {};
+
+  $scope.isGroupEditing = false;
+  $scope.enableGroupEditing = function() {
+    $scope.isGroupEditing = true;
+    $scope.editingGroupsList = $scope.user.user_groups.join();
+  };
+
+  $scope.updateGroups = function() {
+    $scope.user.user_groups = $scope.editingGroupsList.split(',');
+    $scope.isGroupEditing = false;
+  };
+
+  $scope.openChangePwdDialog = function() {
+    var modalInstance = $modal.open({
+      templateUrl: 'views/users/modals/changePassword.html',
+      controller: function($scope) {
+        $scope.passwordData = {
+          password: ''
+        };
+
+        $scope.form = {};
+
+        $scope.ok = function() {
+          $scope.form.passwordChangeForm.submitted = true;
+          if($scope.form.passwordChangeForm.$valid){
+            modalInstance.close($scope.passwordData.password, $scope.passwordData.currentUserPassword);
+          }
+        };
+        $scope.cancel = function() {
+          modalInstance.dismiss('cancel');
+        };
+      }
+    });
+
+    modalInstance.result.then(function(newPassword, currentUserPassword) {
+      User.setPassword($scope.user, newPassword, currentUserPassword);
+    }); 
+  };
+
+  $scope.toggleUserActive = function() {
+    $scope.user.active = !$scope.user.active;
+    User.setActive($scope.user.user_name, $scope.user.active);
+  };
+
+  User.get($routeParams.id).then(function(data) {
+    $scope.user = data.Users;
+  });
+
+  $scope.deleteUser = function() {
+    var modalInstance = $modal.open({
+      templateUrl: 'views/users/modals/deleteUserConfirmation.html',
+      controller: function($scope) {
+        $scope.delete = function() {
+          modalInstance.close();
+        };
+
+        $scope.cancel = function() {
+          modalInstance.dismiss('cancel');
+        };
+      }
+    });
+
+    modalInstance.result.then(function() {
+      User.delete($scope.user.user_name).then(function() {
+        $location.path('/users');
+      });
+    });
+  };
+}]);

+ 36 - 0
ambari-admin/src/main/resources/ui/admin-web/app/scripts/directives/PasswordVerify.js

@@ -0,0 +1,36 @@
+/**
+ * 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.
+ */
+'use strict';
+
+angular.module('ambariAdminConsole')
+.directive('passwordVerify', function() {
+  return {
+    require: 'ngModel',
+    restrict: 'A',
+    scope: {
+      passwordVerify: '='
+    },
+    link: function(scope, elem, attrs, ctrl) {
+      scope.$watch(function() {
+        return (ctrl.$pristine && angular.isUndefined(ctrl.$modelValue)) || scope.passwordVerify === ctrl.$modelValue;
+      }, function(currentValue) {
+        ctrl.$setValidity('passwordVerify', currentValue);
+      })
+    }
+  }
+});

+ 40 - 0
ambari-admin/src/main/resources/ui/admin-web/app/scripts/directives/linkToDir.js

@@ -0,0 +1,40 @@
+/**
+ * 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.
+ */
+'use strict';
+
+angular.module('ambariAdminConsole')
+.directive('linkTo', function() {
+  return {
+    restrict: 'E',
+    transclude: true,
+    replace: true,
+    scope: {
+      route: '@',
+      id: '@'
+    },
+
+    template: '<a href="#{{href}}" ng-transclude></a>',
+    controller: ['$scope', 'ROUTES', function($scope, ROUTES) {
+      var route = ROUTES;
+      angular.forEach($scope.route.split('.'), function(routeObj) {
+        route = route[routeObj];
+      });
+      $scope.href = route.url.replace(':id', $scope.id);
+    }]
+  };
+});

+ 104 - 0
ambari-admin/src/main/resources/ui/admin-web/app/scripts/routes.js

@@ -0,0 +1,104 @@
+/**
+ * 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.
+ */
+'use strict';
+
+angular.module('ambariAdminConsole')
+.constant('ROUTES', {
+  root: {
+    url: '/',
+    templateUrl: 'views/main.html',
+    controller: 'MainCtrl'
+  },
+  users: {
+    list: {
+      url: '/users',
+      templateUrl: 'views/users/list.html',
+      controller: 'UsersListCtrl'
+    },
+    edit: {
+      url: '/users/:id/edit',
+      templateUrl: 'views/users/create.html',
+      controller: 'UsersCreateCtrl'
+    },
+    create: {
+      url: '/users/new',
+      templateUrl: 'views/users/create.html',
+      controller: 'UsersCreateCtrl'
+    },
+    show: {
+      url: '/users/:id',
+      templateUrl: 'views/users/show.html',
+      controller: 'UsersShowCtrl'
+    }
+  },
+  groups: {
+    list: {
+      url: '/groups',
+      templateUrl: 'views/groups/list.html',
+      controller: 'GroupsListCtrl'
+    },
+    edit: {
+      url: '/groups/:id/edit',
+      templateUrl: 'views/groups/create.html',
+      controller: 'GroupsCreateCtrl'
+    },
+    create: {
+      url: '/groups/new',
+      templateUrl: 'views/groups/create.html',
+      controller: 'GroupsCreateCtrl'
+    }
+  },
+  views: {
+    list: {
+      url: '/views',
+      templateUrl: 'views/ambariViews/list.html',
+      controller: 'ViewsListCtrl',
+    },
+    edit: {
+      url: '/views/:id/edit',
+      templateUrl: 'views/ambariViews/edit.html',
+      controller: 'ViewsEditCtrl'
+    },
+    create: {
+      url: '/views/new',
+      templateUrl: 'views/ambariViews/create.html',
+      controller: 'ViewsCreateCtrl'
+    }
+  },
+  clusters:{
+    manageAccess: {
+      url: '/clusters/:id/manageAccess',
+      templateUrl: 'views/clusters/manageAccess.html',
+      controller: 'ClustersManageAccessCtrl'
+    }
+  }
+})
+.config(['$routeProvider', '$locationProvider', 'ROUTES', function($routeProvider, $locationProvider, ROUTES) {
+  var createRoute = function(routeObj) {
+    if(routeObj.url){
+      $routeProvider.when(routeObj.url, routeObj);
+    } else {
+      angular.forEach(routeObj, createRoute);
+    }
+  };
+  angular.forEach(ROUTES, createRoute);
+}])
+.run(['$rootScope', 'ROUTES', function($rootScope, ROUTES) {
+  // Make routes available in every template and controller
+  $rootScope.ROUTES = ROUTES;
+}]);

+ 62 - 0
ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/User.js

@@ -0,0 +1,62 @@
+/**
+ * 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.
+ */
+'use strict';
+
+angular.module('ambariAdminConsole')
+.factory('User', ['Restangular', function(Restangular) {
+  Restangular.addResponseInterceptor(function(data, operation, what, url, response, deferred) {
+    var extractedData;
+    if(operation === 'getList'){
+      extractedData = data.items;
+    } else {
+      extractedData = data;
+    }
+
+    return extractedData;
+  });
+
+  var Users = Restangular.all('users');
+
+  return {
+    list: function(cb) {
+      return Users.customGET('', {
+        fields: 'Users/ldap_user,Users/active'
+      });
+    },
+    get: function(userId) {
+      return Restangular.one('users', userId).get();
+    },
+    create: function(userObj) {
+      return Restangular.all('users').post(userObj);
+    },
+    setActive: function(userId, isActive) {
+      return Restangular.one('users', userId).customPUT({'Users/active':isActive});
+    },
+    setPassword: function(user, password, currentUserPassword) {
+
+      return Restangular.one('users', user.user_name).customPUT({
+        'Users/password': password,
+        'Users/old_password': currentUserPassword,
+        'Users/roles': user.roles[0] || 'user'
+      });
+    },
+    delete: function(userId) {
+      return Restangular.one('users', userId).remove();
+    }
+  };
+}]);

+ 78 - 0
ambari-admin/src/main/resources/ui/admin-web/app/styles/main.css

@@ -0,0 +1,78 @@
+/**
+ * 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.nav li > a{
+  cursor: pointer;
+}
+
+.top-buffer{
+  padding-top: 20px;
+}
+.bottom-buffer{
+  padding-bottom: 20px;
+}
+.right-buffer{
+  padding-right: 20px;
+}
+.right-margin{
+  margin-right: 20px;
+}
+.bottom-margin{
+  margin-bottom: 10px;
+}
+.top-margin{
+  margin-top: 10px;
+}
+.text-left{
+  text-align: left !important;
+}
+.text-center{
+  text-align: center!important;
+}
+.padding-top-7{
+  padding-top: 7px;
+}
+.no-margin-bottom{
+  margin-bottom: 0!important;
+}
+table.no-border tr td{
+  border: none;
+}
+.no-border{
+  border: none !important;
+}
+
+.groups-pane table ul{
+  list-style-type: none;
+  margin: 0;
+  padding: 0;
+}
+.groups-pane table ul li {
+  margin: 0;
+  padding: 0;
+}
+
+.views-list-pane{}
+.views-list-pane .panel-body table{
+  margin-bottom: 0;
+}
+.views-list-pane .panel-body table tbody td{
+  border-top: none;
+  vertical-align: middle;
+}

+ 99 - 0
ambari-admin/src/main/resources/ui/admin-web/app/views/ambariViews/edit.html

@@ -0,0 +1,99 @@
+<!--
+* 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.
+-->
+<h2>Edit PIG_CT: Pig for CT Cluster</h2>
+<hr>
+<div class="panel panel-default">
+  <div class="panel-heading">
+    <h3 class="panel-title">Settings</h3>
+  </div>
+  <div class="panel-body">
+    <form class="form-horizontal">
+      <div class="form-group">
+        <label for="" class="col-sm-2 control-label">Instance ID</label>
+        <label for="" class="col-sm-10 control-label text-left">PIG_CT</label>
+      </div>
+      <div class="form-group">
+        <label for="" class="col-sm-2 control-label">Display Name</label>
+        <div class="col-sm-10"><input type="text" class="form-control" placeholder="Display Name"></div>
+      </div>
+      <div class="form-group">
+        <div class="col-sm-offset-2 col-sm-10">
+          <div class="checkbox">
+            <label>
+              <input type="checkbox"> Visible
+            </label>
+          </div>
+        </div>
+      </div>
+    </form>
+  </div>
+</div>
+
+<div class="panel panel-default">
+  <div class="panel-heading">
+    <h3 class="panel-title">Permissions</h3>
+  </div>
+  <div class="panel-body">
+      
+    <form class="form-horizontal">
+      <div class="form-group">
+        <div class="col-sm-2"></div>
+        <label class="col-sm-5 control-label text-left">Users</label>
+        <label class="col-sm-5 control-label text-left">Groups</label>
+      </div>
+      <div class="form-group">
+        <label class="col-sm-2 control-label">USE</label>
+        <div class="col-sm-5"><textarea name="" id="" cols="30" rows="4" class="form-control"></textarea></div>
+        <div class="col-sm-5"><textarea name="" id="" cols="30" rows="4" class="form-control"></textarea></div>
+      </div>
+      <div class="form-group">
+        <label class="col-sm-2 control-label">EDIT_SCRIPT</label>
+        <div class="col-sm-5"><textarea name="" id="" cols="30" rows="4" class="form-control"></textarea></div>
+        <div class="col-sm-5"><textarea name="" id="" cols="30" rows="4" class="form-control"></textarea></div>
+      </div>
+      <div class="form-group">
+        <label class="control-label col-sm-2">EXECUTE_SCRIPT</label>
+        <div class="col-sm-5"><textarea name="" id="" cols="30" rows="4" class="form-control"></textarea></div>
+        <div class="col-sm-5"><textarea name="" id="" cols="30" rows="4" class="form-control"></textarea></div>
+      </div>
+    </form>
+      
+  </div>
+</div>
+
+<div class="panel panel-default">
+  <div class="panel-heading">
+    <h3 class="panel-title">Configuration</h3>
+  </div>
+  <div class="panel-body">
+    <form action="" class="form-horizontal">
+      <div class="form-group">
+        <label for="" class="control-label col-sm-2">WebHCat URL</label>
+        <div class="col-sm-10"><input type="text" class="form-control"></div>
+      </div>
+      <div class="form-group">
+        <label for="" class="control-label col-sm-2">Other Prop</label>
+        <div class="col-sm-10"><input type="text" class="form-control"></div>
+      </div>
+      <div class="form-group">
+        <label for="" class="control-label col-sm-2">Required Prop</label>
+        <div class="col-sm-10"><input type="text" class="form-control"></div>
+      </div>
+    </form>
+  </div>
+</div>

+ 123 - 0
ambari-admin/src/main/resources/ui/admin-web/app/views/ambariViews/list.html

@@ -0,0 +1,123 @@
+<!--
+* 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.
+-->
+<div class="views-list-pane">
+  <div class="clearfix">
+    <h3 class="pull-left">Views management</h3>
+    <div class="pull-right top-buffer col-sm-4">
+      <div class="input-group">
+        <input type="text" class="form-control" placeholder="Search">
+        <span class="input-group-addon">
+          <span class="glyphicon glyphicon-search"></span>
+        </span>
+      </div>
+    </div>
+  </div>
+  <hr>
+  <accordion>
+    <accordion-group>
+      <accordion-heading>
+        <div class="row">
+          <div class="col-sm-3">Pig</div>
+          <div class="col-sm-3">0.1.0, 0.2.0</div>
+          <div class="col-sm-3">v 3 instances</div>
+          <div class="col-sm-3">This is a description</div>
+        </div>
+      </accordion-heading>
+      <table class="table">
+        <tbody>
+          <tr>
+            <td class="col-sm-3"></td>
+            <td class="col-sm-3">0.1.0</td>
+            <td class="col-sm-3">PIG_CT: Pig for CT CLuster</td>
+            <td class="col-sm-3">
+              <link-to route="views.edit" id="1" class="btn btn-default"><span class="glyphicon glyphicon-cog"></span> Edit</link-to>
+              <a href="" class="btn btn-default">
+                <span class="glyphicon glyphicon-trash"></span> Delete
+              </a>
+            </td>
+          </tr>
+          <tr>
+            <td class="col-sm-3"></td>
+            <td class="col-sm-3">0.2.0</td>
+            <td class="col-sm-3">PIG_CT: Pig for CT CLuster</td>
+            <td class="col-sm-3">
+              <a href="" class="btn btn-default">
+                <span class="glyphicon glyphicon-cog"></span> Edit
+              </a>
+              <a href="" class="btn btn-default">
+                <span class="glyphicon glyphicon-trash"></span> Delete
+              </a>
+            </td>
+          </tr>
+          <tr>
+            <td class="col-sm-3"></td>
+            <td class="col-sm-3">0.1.0</td>
+            <td class="col-sm-3">PIG_CT: Pig for CT CLuster</td>
+            <td class="col-sm-3">
+              <a href="" class="btn btn-default">
+                <span class="glyphicon glyphicon-cog"></span> Edit
+              </a>
+              <a href="" class="btn btn-default">
+                <span class="glyphicon glyphicon-trash"></span> Delete
+              </a>
+            </td>
+          </tr>
+        </tbody>
+        <tfoot>
+          <tr>
+            <td class="col-sm-3"></td>
+            <td class="col-sm-3"></td>
+            <td class="col-sm-3"></td>
+            <td class="col-sm-3">
+              <a href="" class="btn btn-default">
+                <span class="glyphicon glyphicon-plus"></span> Create Instance
+              </a>
+            </td>
+          </tr>
+        </tfoot>
+      </table>
+    </accordion-group>
+    <accordion-group>
+      <accordion-heading>
+        <div class="row">
+          <div class="col-sm-3">File Browser</div>
+          <div class="col-sm-3">0.1.0, 0.2.0</div>
+          <div class="col-sm-3">> No instances</div>
+          <div class="col-sm-3">This is a description</div>
+        </div>
+      </accordion-heading>
+      <table class="table">
+        <tbody>
+        </tbody>
+        <tfoot>
+          <tr>
+            <td class="col-sm-3"></td>
+            <td class="col-sm-3"></td>
+            <td class="col-sm-3"></td>
+            <td class="col-sm-3">
+              <a href="" class="btn btn-default">
+                <span class="glyphicon glyphicon-plus"></span> Create Instance
+              </a>
+            </td>
+          </tr>
+        </tfoot>
+      </table>
+    </accordion-group>
+
+  </accordion>
+</div>

+ 63 - 0
ambari-admin/src/main/resources/ui/admin-web/app/views/clusters/manageAccess.html

@@ -0,0 +1,63 @@
+<!--
+* 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.
+-->
+<div class="cluster-manage-access-pane">
+  <div class="clearfix">
+    <h3 class="pull-left">My Cluster Permissions</h3>
+    <div class="pull-right top-buffer">
+      <a href class="btn btn-primary"  ng-click="toggleEditMode()"><span class="glyphicon glyphicon-pencil"></span> Edit</a>
+    </div>
+  </div>
+  <hr>
+  <form class="form-horizontal">
+    <div class="form-group">
+      <div class="col-sm-2"></div>
+      <label class="col-sm-5 control-label text-left">Users</label>
+      <label class="col-sm-5 control-label text-left">Groups</label>
+    </div>
+    <div class="form-group">
+      <label class="col-sm-2 control-label">READ</label>
+      <div class="col-sm-5" ng-switch="isEditMode">
+        <textarea ng-switch-when="true" name="" id="" cols="30" rows="4" class="form-control" ng-model="permissions.read.users"></textarea>
+        <div class="well" ng-switch-default>
+          <a href="#" ng-repeat="user in permissions.read.users">{{user}}{{$last ? '' :', '}}</a>
+        </div>
+      </div>
+      <div class="col-sm-5" ng-switch="isEditMode">
+        <textarea ng-switch-when="true" name="" id="" cols="30" rows="4" class="form-control" ng-model="permissions.read.groups"></textarea>
+        <div class="well" ng-switch-default>
+          <a href="#" ng-repeat="group in permissions.read.groups">{{group}}{{$last ? '' :', '}}</a>
+        </div>
+      </div>
+    </div>
+    <div class="form-group">
+      <label class="col-sm-2 control-label">OPERATE</label>
+      <div class="col-sm-5" ng-switch="isEditMode">
+        <textarea ng-switch-when="true" name="" id="" cols="30" rows="4" class="form-control" ng-model="permissions.operate.users"></textarea>
+        <div class="well" ng-switch-default>
+          <a href="#" ng-repeat="user in permissions.operate.users">{{user}}{{$last ? '' :', '}}</a>
+        </div>
+      </div>
+      <div class="col-sm-5" ng-switch="isEditMode">
+        <textarea ng-switch-when="true" name="" id="" cols="30" rows="4" class="form-control" ng-model="permissions.operate.groups"></textarea>
+        <div class="well" ng-switch-default>
+          <a href="#" ng-repeat="group in permissions.operate.groups">{{group}}{{$last ? '' :', '}}</a>
+        </div>
+      </div>
+    </div>
+</div>
+

+ 59 - 0
ambari-admin/src/main/resources/ui/admin-web/app/views/groups/list.html

@@ -0,0 +1,59 @@
+<!--
+* 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.
+-->
+<div class="groups-pane">
+  <div class="clearfix">
+    <h3 class="pull-left">Groups management</h3>
+    <div class="pull-right top-buffer">
+      <a href="#{{ROUTES.groups.new}}" class="btn btn-primary"><span class="glyphicon glyphicon-plus"></span> Create Local Group</a>
+      <button class="btn btn-default ">Sync LDAP</button>
+    </div>
+  </div>
+  <hr>
+  <table class="table table-striped table-hover">
+    <thead>
+      <tr>
+        <th>Group name</th>
+        <th>Type</th>
+        <th>Members</th>
+        <th></th>
+      </tr>
+    </thead>
+    <tbody>
+      <tr>
+        <td>operators</td>
+        <td>Local</td>
+        <td>
+          <ul>
+            <li>v 2 members</li>
+            <li>admin</li>
+            <li>usaku</li>
+          </ul>
+        </td>
+        <td>
+          <a href="" class="btn btn-default">edit</a> <a href="" class="btn btn-danger">delete</a>
+        </td>
+      </tr>
+      <tr>
+        <td>sysadmins</td>
+        <td>LDAP</td>
+        <td>> 20 members</td>
+        <td><a href="" class="btn btn-default">edit</a> <a href="" class="btn btn-danger">delete</a></td>
+      </tr>
+    </tbody>
+  </table>
+</div>

+ 17 - 0
ambari-admin/src/main/resources/ui/admin-web/app/views/groupsAdmin.html

@@ -0,0 +1,17 @@
+<!--
+* 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.
+-->

+ 53 - 0
ambari-admin/src/main/resources/ui/admin-web/app/views/leftNavbar.html

@@ -0,0 +1,53 @@
+<!--
+* 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.
+-->
+<div class="panel panel-default">
+  <div class="panel-heading"><span class="glyphicon glyphicon-cloud"></span> Clusters</div>
+  <div class="panel-body">
+    <h5>My cluster</h5>
+      <ul class="nav nav-pills nav-stacked">
+        <li>
+          <link-to route="clusters.manageAccess" id="1">Manage Access</link-to>
+        </li>
+        <li><a href="/#/main/dashboard">Go to Dashboard</a></li>
+      </ul>
+    <hr>
+    <button type="button" class="btn btn-primary btn-block">
+      <span class="glyphicon glyphicon-plus"></span>
+      Create a Cluster
+    </button>
+  </div>
+</div>
+
+<div class="panel panel-default">
+  <div class="panel-heading"><span class="glyphicon glyphicon-th"></span> Views</div>
+  <div class="panel-body">
+    <ul class="nav nav-pills nav-stacked">
+      <li><link-to route="views.list">Manage Views</link-to></li>
+    </ul>
+  </div>
+</div>
+
+<div class="panel panel-default">
+  <div class="panel-heading"><span class="glyphicon glyphicon-user"></span> Users + Groups</div>
+  <div class="panel-body">
+    <ul class="nav nav-pills nav-stacked">
+      <li><link-to route="users.list">Manage Users</link-to></li>
+      <li><link-to route="groups.list">Manage Groups</link-to></li>
+    </ul>
+  </div>
+</div>

+ 21 - 0
ambari-admin/src/main/resources/ui/admin-web/app/views/main.html

@@ -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.
+-->
+<div class="jumbotron">
+  <h2>Ambari Admin Console</h2>
+  <p class="lead">Some information about admin console.</p>
+</div>

+ 64 - 0
ambari-admin/src/main/resources/ui/admin-web/app/views/users/create.html

@@ -0,0 +1,64 @@
+<!--
+* 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.
+-->
+<h2>Create local user</h2>
+<hr>
+<form class="form-horizontal" role="form" novalidate name="form">
+  <div class="form-group" ng-class="{'has-error' : form.user_name.$error.required && form.submitted}">
+    <label for="username" class="col-sm-2 control-label">User name:</label>
+    <div class="col-sm-10">
+      <input type="text" id="username" class="form-control" name="user_name" placeholder="User name" ng-model="user.user_name" required>
+      <div class="alert alert-danger top-margin" ng-show="form.user_name.$error.required && form.submitted">
+        Required
+      </div>
+    </div>
+  </div>
+  <div class="form-group">
+    <label for="" class="col-sm-2 control-label">Type:</label>
+    <div class="col-sm-10">
+      <label for="" class="control-label">Local</label>
+    </div>
+  </div>
+  <div class="form-group">
+    <label for="" class="col-sm-2 control-label">Status</label>
+    <div class="col-sm-10">
+      <div class="btn btn-success">Active</div>
+    </div>
+  </div>
+  <div class="form-group" ng-class="{'has-error' : (form.password.$error.required && form.submitted) || form.confirmPassword.$error.passwordVerify}">
+    <label for="password" class="col-sm-2 control-label">Password:</label>
+    <div class="col-sm-10">
+      <input type="password" class="form-control bottom-margin" name="password" placeholder="Password" required ng-model="user.password">
+      <input type="password" class="form-control bottom-margin" name="confirmPassword" placeholder="Password confirmation" required ng-model="user.passwordConfirmation"
+        password-verify="user.password">
+
+      <div class="alert alert-danger" ng-show='form.confirmPassword.$error.passwordVerify'>
+        Password must match!
+      </div>
+      <div class="alert alert-danger" ng-show='form.password.$error.required && form.submitted'>
+        Password required!
+      </div>
+      
+    </div>
+  </div>
+  <div class="form-group">
+    <div class="col-sm-offset-2 col-sm-10">
+      <button class="btn btn-primary" ng-click="createUser()">Create</button>
+    </div>
+  </div>
+      
+</form>

+ 62 - 0
ambari-admin/src/main/resources/ui/admin-web/app/views/users/list.html

@@ -0,0 +1,62 @@
+<!--
+* 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.
+-->
+<div class="users-pane">
+  <div class="clearfix">
+    <h3 class="pull-left">Users management</h3>
+    <div class="pull-right top-buffer">
+      <link-to route="users.create" class="btn btn-primary"><span class="glyphicon glyphicon-plus"></span> Create Local User</link-to>
+      <button class="btn btn-default ">Sync LDAP</button>
+    </div>
+  </div>
+  <hr>
+  <table class="table table-striped table-hover">
+    <thead>
+      <tr>
+        <th>
+          <label for="">Username</label>
+          <input type="text" class="form-control" ng-model="currentNameFilter">
+        </th>
+        <th>
+          <label for="">Type</label>
+          <select class="form-control"
+            ng-model="currentTypeFilter"
+            ng-options="item for item in typeFilterOptions">
+          </select>
+
+        </th>
+        <th>
+          <label for="">Status</label>
+          <select class="form-control" 
+            ng-model="currentActiveFilter"
+            ng-options="item for item in actvieFilterOptions">
+            
+          </select>
+        </th>
+      </tr>
+    </thead>
+    <tbody>
+      <tr ng-repeat="user in users | filter:activeFilter | filter:typeFilter | filter:currentNameFilter">
+        <td>
+          <link-to route="users.show" id="{{user.Users.user_name}}">{{user.Users.user_name}}</link-to>
+        </td>
+        <td>{{user.Users.ldap_user ? 'LDAP' : 'Local'}}</td>
+        <td><span ng-class="user.Users.active ? 'text-success' : 'text-danger'">{{user.Users.active ? 'Active' : 'Inactive'}}</span></td>
+      </tr>
+    </tbody>
+  </table>    
+</div>

+ 52 - 0
ambari-admin/src/main/resources/ui/admin-web/app/views/users/modals/changePassword.html

@@ -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.
+-->
+<div class="modal-header">
+  <h3 class="modal-title">Change Password</h3>
+</div>
+<div class="modal-body">
+  <form class="form-horizontal" novalidate name="form.passwordChangeForm" role="form" >
+    <div class="form-group" ng-class="{'has-error' : (form.passwordChangeForm.currentPassword.$error.required && form.passwordChangeForm.submitted)}">
+      <label for="" class="col-sm-4 control-label" >Your Password</label>
+      <div class="col-sm-8">
+        <input type="password" name="currentPassword" class="form-control bottom-margin" placeholder="Your password" required ng-model="passwordData.currentUserPassword">
+        <div class="alert alert-danger no-margin-bottom" ng-show='form.passwordChangeForm.password.$error.required && form.passwordChangeForm.submitted'>
+          Password required!
+        </div>
+      </div>
+    </div>
+    <div class="form-group no-margin-bottom" ng-class="{'has-error' : (form.passwordChangeForm.password.$error.required && form.passwordChangeForm.submitted) || form.passwordChangeForm.confirmPassword.$error.passwordVerify}">
+      <label for="" class="col-sm-4 control-label">New Password:</label>
+      <div class="col-sm-8">
+        <input type="password" class="form-control bottom-margin" name="password" placeholder="Password" required ng-model="passwordData.password">
+        <input type="password" class="form-control bottom-margin" name="confirmPassword" placeholder="Password confirmation" required ng-model="passwordData.passwordConfirmation"
+          password-verify="passwordData.password">
+        <div class="alert alert-danger no-margin-bottom" ng-show='form.passwordChangeForm.confirmPassword.$error.passwordVerify'>
+          Password must match!
+        </div>
+        <div class="alert alert-danger no-margin-bottom" ng-show='form.passwordChangeForm.password.$error.required && form.passwordChangeForm.submitted'>
+          Password required!
+        </div>
+      </div>
+
+    </div>
+  </form>
+</div>
+<div class="modal-footer">
+  <button class="btn btn-primary" ng-click="ok()">OK</button>
+  <button class="btn btn-warning" ng-click="cancel()">Cancel</button>
+</div>

+ 24 - 0
ambari-admin/src/main/resources/ui/admin-web/app/views/users/modals/deleteUserConfirmation.html

@@ -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.
+-->
+<div class="modal-header no-border">
+  <h3 class="modal-title">Are you sure?</h3>
+</div>
+<div class="modal-footer">
+  <button class="btn btn-primary" ng-click="delete()">Delete</button>
+  <button class="btn btn-warning" ng-click="cancel()">Cancel</button>
+</div>

+ 103 - 0
ambari-admin/src/main/resources/ui/admin-web/app/views/users/show.html

@@ -0,0 +1,103 @@
+<!--
+* 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.
+-->
+<div ng-show="user.user_name">
+  <div class="clearfix">
+    <h3 class="pull-left">{{user.user_name}}</h3>
+    <div class="pull-right top-buffer">
+      <button class="btn btn-danger" ng-click="deleteUser()">Delete User</button>
+    </div>
+  </div>
+  <hr>
+  <form class="form-horizontal" role="form" >
+    <div class="form-group">
+      <label for="" class="col-sm-2 control-label">Type:</label>
+      <div class="col-sm-10">
+        <label for="" class="control-label">Local</label>
+      </div>
+    </div>
+    <div class="form-group">
+      <label for="" class="col-sm-2 control-label">Status</label>
+      <div class="col-sm-10">
+        <div class="btn" ng-class="user.active ? 'btn-success' : 'btn-danger'">
+          <span ng-show="user.active">Active</span>
+          <span ng-show="!user.active">Inactive</span>
+        </div>
+        <a href ng-click="toggleUserActive()">Make User {{user.active ? 'Inactive' : 'Active'}}</a>
+      </div>
+    </div>
+    <div class="form-group">
+      <label for="password" class="col-sm-2 control-label">Password:</label>
+      <div class="col-sm-10">
+        <a href ng-click="openChangePwdDialog()" class="btn btn-default">Change Password</a>
+      </div>
+    </div>
+    <div class="form-group">
+      <label for="groups" class="col-sm-2 control-label">Groups:</label>
+      <div class="col-sm-10">
+        <div class="row" ng-hide="isGroupEditing">
+          <div class="col-sm-10">
+            <div class="well">
+              <a href ng-repeat="group in user.user_groups">{{group}}{{$last ? '' : ', '}}</a>
+            </div>
+          </div>
+          <div class="col-sm-2">
+            <a href ng-click="enableGroupEditing()"><span class="glyphicon glyphicon-cog"></span> Edit</a>
+          </div>
+        </div>
+        <div class="row" ng-show="isGroupEditing">
+          <div class="col-sm-12">
+            <textarea name="groups" id="" cols="30" rows="5" class="form-control bottom-margin" ng-model="editingGroupsList"></textarea>
+            <a href class="btn btn-primary pull-right" ng-click="updateGroups()">Update</a>
+          </div>
+            
+        </div>
+      </div>
+        
+    </div>
+    <div class="form-group">
+      <label for="" class="col-sm-2 control-label">Clusters</label>
+      <div class="col-sm-10">
+        <div class="control-label text-left">
+          <a href="#">My Cluster</a> OPERATOR
+        </div>
+      </div>
+    </div>
+    <div class="form-group">
+      <label for="" class="col-sm-2 control-label">Views</label>
+      <div class="col-sm-10 padding-top-7">
+        <div ng-repeat="view in user.views" class="row">
+          <div class="col-sm-4">
+            <a href="#">Some limk to some view</a>
+          </div>
+          <div class="col-sm-5">
+            USE, EDIT_SCRIPT
+          </div>
+        </div>
+        <div class="row">
+          <div class="col-sm-4">
+            <a href="#">Some limk to some view</a>
+          </div>
+          <div class="col-sm-5">
+            USE, EDIT_SCRIPT
+          </div>
+        </div>
+      </div>
+    </div>    
+  </form>
+</div>
+  

+ 12 - 0
ambari-admin/src/main/resources/ui/admin-web/bower.json

@@ -0,0 +1,12 @@
+{
+  "name": "adminconsole",
+  "private": true,
+  "dependencies": {
+    "bootstrap": "~3.1.1",
+    "angular": "~1.2.18",
+    "angular-route": "~1.2.18",
+    "angular-bootstrap": "~0.11.0",
+    "restangular": "~1.4.0"
+  },
+  "devDependencies": {}
+}

+ 145 - 0
ambari-admin/src/main/resources/ui/admin-web/gulpfile.js

@@ -0,0 +1,145 @@
+/**
+ * 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.
+ */
+'use strict';
+// generated on 2014-06-25 using generator-gulp-webapp 0.1.0
+
+var gulp = require('gulp');
+
+// load plugins
+var $ = require('gulp-load-plugins')();
+
+gulp.task('styles', function () {
+    return gulp.src('app/styles/main.css')
+        .pipe($.autoprefixer('last 1 version'))
+        .pipe(gulp.dest('.tmp/styles'))
+        .pipe($.size());
+});
+
+gulp.task('scripts', function () {
+    return gulp.src('app/scripts/**/*.js')
+        .pipe($.jshint())
+        .pipe($.jshint.reporter(require('jshint-stylish')))
+        .pipe($.size());
+});
+
+gulp.task('html', ['styles'], function () {
+    var jsFilter = $.filter('**/*.js');
+    var cssFilter = $.filter('**/*.css');
+
+    return gulp.src('app/*.html')
+        .pipe($.useref.assets({searchPath: '{.tmp,app}'}))
+        .pipe(jsFilter)
+        .pipe($.uglify())
+        .pipe(jsFilter.restore())
+        .pipe(cssFilter)
+        .pipe($.csso())
+        .pipe(cssFilter.restore())
+        .pipe($.useref.restore())
+        .pipe($.useref())
+        .pipe(gulp.dest('dist'))
+        .pipe($.size());
+});
+
+gulp.task('views', function() {
+    return gulp.src('app/views/**/*.html')
+        .pipe(gulp.dest('dist/views'));
+});
+
+gulp.task('images', function () {
+    return gulp.src('app/images/**/*')
+        .pipe($.cache($.imagemin({
+            optimizationLevel: 3,
+            progressive: true,
+            interlaced: true
+        })))
+        .pipe(gulp.dest('dist/images'))
+        .pipe($.size());
+});
+
+gulp.task('fonts', function () {
+    return $.bowerFiles()
+        .pipe($.filter('**/*.{eot,svg,ttf,woff}'))
+        .pipe($.flatten())
+        .pipe(gulp.dest('dist/fonts'))
+        .pipe($.size());
+});
+
+gulp.task('extras', function () {
+    return gulp.src(['app/*.*', '!app/*.html'], { dot: true })
+        .pipe(gulp.dest('dist'));
+});
+
+gulp.task('clean', function () {
+    return gulp.src(['.tmp', 'dist'], { read: false }).pipe($.clean());
+});
+
+gulp.task('build', ['html', 'views', 'images', 'fonts', 'extras']);
+
+gulp.task('default', ['clean'], function () {
+    gulp.start('build');
+});
+
+gulp.task('connect', function () {
+    var connect = require('connect');
+    var app = connect()
+        .use(require('connect-livereload')({ port: 35729 }))
+        .use(connect.static('app'))
+        .use(connect.static('.tmp'))
+        .use(connect.directory('app'));
+
+    require('http').createServer(app)
+        .listen(9000)
+        .on('listening', function () {
+            console.log('Started connect web server on http://localhost:9000');
+        });
+});
+
+gulp.task('serve', ['connect'], function () {
+    require('opn')('http://localhost:9000');
+});
+
+// inject bower components
+gulp.task('wiredep', function () {
+    var wiredep = require('wiredep').stream;
+
+    gulp.src('app/*.html')
+        .pipe(wiredep({
+            directory: 'app/bower_components'
+        }))
+        .pipe(gulp.dest('app'));
+});
+
+gulp.task('watch', ['connect', 'serve'], function () {
+    var server = $.livereload();
+
+    // watch for changes
+
+    gulp.watch([
+        'app/*.html',
+        '.tmp/styles/**/*.css',
+        'app/scripts/**/*.js',
+        'app/images/**/*'
+    ]).on('change', function (file) {
+        server.changed(file.path);
+    });
+
+    gulp.watch('app/styles/**/*.css', ['styles']);
+    gulp.watch('app/scripts/**/*.js', ['scripts']);
+    gulp.watch('app/images/**/*', ['images']);
+    gulp.watch('bower.json', ['wiredep']);
+});

+ 67 - 0
ambari-admin/src/main/resources/ui/admin-web/mock.js

@@ -0,0 +1,67 @@
+/**
+ * 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 express = require('express');
+
+var app = express();
+
+var API = '/api/v1';
+
+app.use(function(req, res, next) {
+	res.header("Access-Control-Allow-Origin", "*");
+  res.header("Access-Control-Allow-Headers", "X-Requested-With");
+  next();
+});
+
+app.get(API + '/users', function(req, res) {
+	res.json({
+		"href" : "http://server:8080/api/v1/users/",
+		"items" : [
+			{
+				"href" : "http://server:8080/api/v1/users/admin",
+				"Users" : {
+					"user_name" : "adminx",
+					"ldap_user": false,
+					"active_user": true
+				}
+			},
+			{
+				"href" : "http://server:8080/api/v1/users/Joe",
+				"Users" : {
+					"user_name": "Joe",
+					"ldap_user": true,
+					"active_user": false
+				}
+			}
+		]
+	});
+});
+
+
+app.get(API + '/users/:id', function(req, res) {
+	res.json({
+		"href":"http://<server>:8080/api/v1/users/admin",
+		"Users":{
+			"user_name":"admin",
+			"user_groups": ["sysadmins", "hadoopadmins"]
+		}
+	});
+});
+
+app.listen(3000, function() {
+	console.log('Listening on port 3000');
+});

+ 32 - 0
ambari-admin/src/main/resources/ui/admin-web/package.json

@@ -0,0 +1,32 @@
+{
+  "name": "adminconsole",
+  "version": "0.0.0",
+  "dependencies": {},
+  "devDependencies": {
+    "bower": "1.3.8",
+    "connect": "^2.14.4",
+    "connect-livereload": "^0.4.0",
+    "express": "^4.4.5",
+    "gulp": "^3.6.0",
+    "gulp-autoprefixer": "^0.0.7",
+    "gulp-bower-files": "^0.2.1",
+    "gulp-cache": "^0.1.1",
+    "gulp-clean": "^0.2.4",
+    "gulp-csso": "^0.2.6",
+    "gulp-filter": "^0.4.1",
+    "gulp-flatten": "^0.0.2",
+    "gulp-imagemin": "^0.5.0",
+    "gulp-jshint": "^1.5.3",
+    "gulp-livereload": "^1.2.0",
+    "gulp-load-plugins": "^0.5.0",
+    "gulp-size": "^0.3.0",
+    "gulp-uglify": "^0.2.1",
+    "gulp-useref": "^0.4.2",
+    "jshint-stylish": "^0.2.0",
+    "opn": "^0.1.1",
+    "wiredep": "^1.4.3"
+  },
+  "engines": {
+    "node": ">=0.10.0"
+  }
+}

+ 3 - 0
ambari-admin/src/main/resources/ui/admin-web/test/.bowerrc

@@ -0,0 +1,3 @@
+{
+    "directory": "bower_components"
+}

+ 9 - 0
ambari-admin/src/main/resources/ui/admin-web/test/bower.json

@@ -0,0 +1,9 @@
+{
+  "name": "adminconsole",
+  "private": true,
+  "dependencies": {
+    "chai": "~1.8.0",
+    "mocha": "~1.14.0"
+  },
+  "devDependencies": {}
+}

+ 44 - 0
ambari-admin/src/main/resources/ui/admin-web/test/index.html

@@ -0,0 +1,44 @@
+<!--
+* 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.
+-->
+<!doctype html>
+<html>
+<head>
+    <meta charset="utf-8">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge">
+    <title>Mocha Spec Runner</title>
+    <link rel="stylesheet" href="bower_components/mocha/mocha.css">
+</head>
+<body>
+    <div id="mocha"></div>
+    <script src="bower_components/mocha/mocha.js"></script>
+    <script>mocha.setup('bdd')</script>
+    <script src="bower_components/chai/chai.js"></script>
+    <script>
+        var assert = chai.assert;
+        var expect = chai.expect;
+        var should = chai.should();
+    </script>
+
+    <!-- include source files here... -->
+
+    <!-- include spec files here... -->
+    <script src="spec/test.js"></script>
+
+    <script>mocha.run()</script>
+</body>
+</html>

+ 30 - 0
ambari-admin/src/main/resources/ui/admin-web/test/spec/test.js

@@ -0,0 +1,30 @@
+/**
+ * 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.
+ */
+/* global describe, it */
+
+(function () {
+    'use strict';
+
+    describe('Give it some context', function () {
+        describe('maybe a bit more context here', function () {
+            it('should run here few assertions', function () {
+
+            });
+        });
+    });
+})();

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

@@ -34,6 +34,7 @@ Em.I18n.translations = {
     '<br>You must resolve this error in order to continue.',
   'app.signout':'Sign out',
   'app.settings':'Settings',
+  'app.manageAmbari': 'Manage Ambari',
   'app.aboutAmbari':'About',
   'app.settings.notshowBgOperationsPopup': 'Do not show the Background Operations dialog when starting an operation',
   'app.settings.notShowBgOperations': 'Do not show this dialog again when starting a background operation',

+ 1 - 0
ambari-web/app/templates/application.hbs

@@ -52,6 +52,7 @@
                 {{#if isClusterDataLoaded}}
                   {{#if App.isAdmin}}
                       <li><a href="" {{action showSettingsPopup target="controller"}}>{{t app.settings}}</a></li>
+                      <li><a href="/views/ADMIN_VIEW/1.0.0/INSTANCE/#/">{{t app.manageAmbari}}</a></li>
                   {{/if}}
                 {{/if}}
                   <li class="break"></li>