Просмотр исходного кода

AMBARI-6785. Admin View: various bug fixes and UI improvements. (yusaku)

Yusaku Sako 10 лет назад
Родитель
Сommit
e8b3554124
25 измененных файлов с 267 добавлено и 193 удалено
  1. 5 8
      ambari-admin/src/main/resources/ui/admin-web/app/index.html
  2. 0 57
      ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/LDAPModalCtrl.js
  3. 18 2
      ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/NavbarCtrl.js
  4. 32 18
      ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/ambariViews/CreateViewInstanceCtrl.js
  5. 0 12
      ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/groups/GroupsListCtrl.js
  6. 19 1
      ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/mainCtrl.js
  7. 0 12
      ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/users/UsersListCtrl.js
  8. 14 5
      ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/users/UsersShowCtrl.js
  9. 30 0
      ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/Auth.js
  10. 14 6
      ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/User.js
  11. 20 1
      ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/View.js
  12. 16 14
      ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/ldap.js
  13. 34 0
      ambari-admin/src/main/resources/ui/admin-web/app/styles/main.css
  14. 1 1
      ambari-admin/src/main/resources/ui/admin-web/app/views/ambariViews/create.html
  15. 1 1
      ambari-admin/src/main/resources/ui/admin-web/app/views/ambariViews/edit.html
  16. 5 2
      ambari-admin/src/main/resources/ui/admin-web/app/views/ambariViews/list.html
  17. 1 1
      ambari-admin/src/main/resources/ui/admin-web/app/views/groups/edit.html
  18. 0 1
      ambari-admin/src/main/resources/ui/admin-web/app/views/groups/list.html
  19. 0 47
      ambari-admin/src/main/resources/ui/admin-web/app/views/ldapModal.html
  20. 11 1
      ambari-admin/src/main/resources/ui/admin-web/app/views/leftNavbar.html
  21. 42 0
      ambari-admin/src/main/resources/ui/admin-web/app/views/modals/AboutModal.html
  22. 0 1
      ambari-admin/src/main/resources/ui/admin-web/app/views/users/list.html
  23. 1 1
      ambari-admin/src/main/resources/ui/admin-web/app/views/users/show.html
  24. 1 0
      ambari-admin/src/main/resources/ui/admin-web/gulpfile.js
  25. 2 1
      ambari-admin/src/main/resources/ui/admin-web/package.json

+ 5 - 8
ambari-admin/src/main/resources/ui/admin-web/app/index.html

@@ -40,16 +40,13 @@
       <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]-->
 
-    <div id="top-nav">
+    <div id="top-nav" ng-controller="MainCtrl">
       <header class="navbar navbar-static-top navbar-inverse">
         <div class="navbar-inner">
           <div class="container">
             <a href="#/" class="logo"><img src="/img/logo-white.png" alt="Apache Ambari" title="Apache Ambari"></a>
             <a href="#/" class="brand" title="Apache Ambari">Ambari</a>
-            <a href="" class="brand cluster-name">Ambari Admin Console</a>
-            <!-- <div class="navbar-header">
-              <a href="#/" class="navbar-brand">Ambari Admin Console</a>
-            </div>   -->
+            <a href="" class="brand cluster-name">Admin Console</a>
             <ul class="nav navbar-nav navbar-right">
               <li>
                 <div class="btn-group" dropdown is-open="status.isopen">
@@ -57,9 +54,9 @@
                     Admin <span class="caret"></span>
                   </button>
                   <ul class="dropdown-menu" role="menu">
-                    <li><a href="#">About</a></li>
+                    <li><a href ng-click="about()">About</a></li>
                     <li class="divider"></li>
-                    <li><a href="#">Sign Out</a></li>
+                    <li><a href ng-click="signOut()">Sign Out</a></li>
                   </ul>
                 </div>
               </li>
@@ -114,7 +111,6 @@
     <script src="scripts/routes.js"></script>
     <script src="scripts/controllers/mainCtrl.js"></script>
     <script src="scripts/controllers/NavbarCtrl.js"></script>
-    <script src="scripts/controllers/LDAPModalCtrl.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>
@@ -136,6 +132,7 @@
     <script src="scripts/services/PermissionLoader.js"></script>
     <script src="scripts/services/PermissionsSaver.js"></script>
     <script src="scripts/services/ConfirmationModal.js"></script>
+    <script src="scripts/services/Auth.js"></script>
     <!-- endbuild -->
 </body>
 </html>

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

@@ -1,57 +0,0 @@
-/**
- * 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('LDAPModalCtrl',['$scope', 'LDAP', 'resourceType', '$modalInstance', 'uiAlert', function($scope, LDAP, resourceType, $modalInstance, uiAlert) {
-  $scope.resourceType = resourceType;
-  $scope.isConfigured = false;
-  $scope.isDataLoaded = false;
-
-  $scope.items = [
-  ];
-
-
-  LDAP.get(resourceType).then(function(data) {
-    $scope.isConfigured = data['LDAP']['configured'];
-    $scope.items = data['LDAP'][resourceType];
-    $scope.isDataLoaded = true;
-  }).catch(function(data) {
-    uiAlert.danger(data.data.status, data.data.message);
-    $modalInstance.dismiss();
-  });
-
-  $scope.sync = function() {
-    if($scope.items){
-      var itemsToSync = $scope.items.filter(function(item) {return item.selected}).map(function(item) {
-        return item.name
-      });
-
-      LDAP.sync(resourceType, itemsToSync).then(function() {
-        $modalInstance.close();
-      }).catch(function(data) {
-        uiAlert.danger(data.data.status, data.data.message);
-        $modalInstance.close();
-      });
-    }
-  };
-
-  $scope.cancel = function() {
-    $modalInstance.dismiss();
-  };
-}]);

+ 18 - 2
ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/NavbarCtrl.js

@@ -18,7 +18,7 @@
 'use strict';
 
 angular.module('ambariAdminConsole')
-.controller('NavbarCtrl',['$scope', 'Cluster', '$location', 'uiAlert', 'ROUTES', function($scope, Cluster, $location, uiAlert, ROUTES) {
+.controller('NavbarCtrl',['$scope', 'Cluster', '$location', 'uiAlert', 'ROUTES', 'LDAP', 'ConfirmationModal', function($scope, Cluster, $location, uiAlert, ROUTES, LDAP, ConfirmationModal) {
   $scope.cluster = null;
   Cluster.getStatus().then(function(cluster) {
     $scope.cluster = cluster;
@@ -26,7 +26,6 @@ angular.module('ambariAdminConsole')
   	uiAlert.danger(data.status, data.message);
   });
 
-  // console.log($state);
   $scope.isActive = function(path) {
   	var route = ROUTES;
   	angular.forEach(path.split('.'), function(routeObj) {
@@ -35,4 +34,21 @@ angular.module('ambariAdminConsole')
   	var r = new RegExp( route.url.replace(/(:\w+)/, '\\w+'));
   	return r.test($location.path());
   };
+
+  $scope.isLDAPConfigured = false;
+  $scope.ldapData = {};
+  LDAP.get().then(function(data) {
+    $scope.ldapData = data;
+    $scope.isLDAPConfigured = data['LDAP']['configured'];
+  });
+
+  $scope.syncLDAP = function() {
+    ConfirmationModal.show('Sync LDAP', 'Are you sure you want to sync LDAP?').then(function() {
+      LDAP.sync($scope.ldapData.groups, $scope.ldapData.users).then(function() {
+        uiAlert.success('LDAP synced successful');
+      }).catch(function(data) {
+        uiAlert.danger(data.data.status, data.data.message);
+      });
+    });
+  };
 }]);

+ 32 - 18
ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/ambariViews/CreateViewInstanceCtrl.js

@@ -21,26 +21,45 @@ angular.module('ambariAdminConsole')
 .controller('CreateViewInstanceCtrl',['$scope', 'View', 'uiAlert', '$routeParams', '$location', function($scope, View, uiAlert, $routeParams, $location) {
   $scope.form = {};
 
-  View.getMeta($routeParams.viewId, $routeParams.version).then(function(data) {
-    var viewVersion = data.data;
-    $scope.view = viewVersion;
+  function loadMeta(){
+    View.getMeta($routeParams.viewId, $scope.version).then(function(data) {
+      var viewVersion = data.data;
+      $scope.view = viewVersion;
 
-    $scope.instance = {
-      view_name: viewVersion.ViewVersionInfo.view_name,
-      version: viewVersion.ViewVersionInfo.version,
-      instance_name: '',
-      label: '',
-      visible: true,
-      icon_path: '',
-      icon64_path: '',
-      properties: viewVersion.ViewVersionInfo.parameters
-    };    
+      $scope.instance = {
+        view_name: viewVersion.ViewVersionInfo.view_name,
+        version: viewVersion.ViewVersionInfo.version,
+        instance_name: '',
+        label: '',
+        visible: true,
+        icon_path: '',
+        icon64_path: '',
+        properties: viewVersion.ViewVersionInfo.parameters
+      };    
+    });
+  }
+    
+
+  $scope.$watch(function(scope) {
+    return scope.version;
+  }, function(version) {
+    if( version ){
+      loadMeta();
+    }
   });
 
   // $scope.view = viewVersion;
   $scope.isAdvancedClosed = true;
   $scope.instanceExists = false;
 
+  $scope.versions = [];
+  $scope.version = null;
+
+  View.getVersions($routeParams.viewId).then(function(versions) {
+    $scope.versions = versions;
+    $scope.version = $scope.versions[$scope.versions.length-1];
+  });
+
 
   $scope.nameValidationPattern = /^\s*\w*\s*$/;
 
@@ -66,9 +85,4 @@ angular.module('ambariAdminConsole')
       });
     }
   };
-
-  $scope.cancel = function() {
-    $modalInstance.dismiss();
-  };
-
 }]);

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

@@ -40,16 +40,4 @@ angular.module('ambariAdminConsole')
   .catch(function(data) {
     console.error('Get groups list error');
   });
-
-  $scope.syncLDAP = function() {
-    var modaInstance = $modal.open({
-      templateUrl: 'views/ldapModal.html',
-      controller: 'LDAPModalCtrl',
-      resolve:{
-        resourceType: function() {
-          return 'groups';
-        }
-      }
-    });
-  };
 }]);

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

@@ -18,5 +18,23 @@
 'use strict';
 
 angular.module('ambariAdminConsole')
-.controller('MainCtrl',[function() {
+.controller('MainCtrl',['$scope', 'Auth', 'uiAlert', '$modal', function($scope, Auth, uiAlert, $modal) {
+  $scope.signOut = function() {
+    Auth.signout().then(function() {
+     window.location.pathname = ''; // Change location hard, because Angular works only with relative urls
+    }).catch(function(data) {
+      uiAlert.danger(data.data.status, data.data.message);
+    });
+  };
+
+  $scope.about = function() {
+  	var modalInstance = $modal.open({
+  		templateUrl:'views/modals/AboutModal.html',
+  		controller: ['$scope', function($scope) {
+  			$scope.ok = function() {
+  				modalInstance.close();
+  			};
+  		}]
+  	});
+  };
 }]);

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

@@ -49,16 +49,4 @@ angular.module('ambariAdminConsole')
       return user;
     }
   };
-
-  $scope.syncLDAP = function() {
-    var modaInstance = $modal.open({
-      templateUrl: 'views/ldapModal.html',
-      controller: 'LDAPModalCtrl',
-      resolve:{
-        resourceType: function() {
-          return 'users';
-        }
-      }
-    });
-  };
 }]);

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

@@ -18,7 +18,7 @@
 'use strict';
 
 angular.module('ambariAdminConsole')
-.controller('UsersShowCtrl', ['$scope', '$routeParams', 'User', '$modal', '$location', 'ConfirmationModal', function($scope, $routeParams, User, $modal, $location, ConfirmationModal) {
+.controller('UsersShowCtrl', ['$scope', '$routeParams', 'User', '$modal', '$location', 'ConfirmationModal', 'uiAlert', function($scope, $routeParams, User, $modal, $location, ConfirmationModal, uiAlert) {
   $scope.user = {};
 
   $scope.isGroupEditing = false;
@@ -37,7 +37,8 @@ angular.module('ambariAdminConsole')
       templateUrl: 'views/users/modals/changePassword.html',
       controller: ['$scope', function($scope) {
         $scope.passwordData = {
-          password: ''
+          password: '',
+          currentUserPassword: ''
         };
 
         $scope.form = {};
@@ -45,7 +46,11 @@ angular.module('ambariAdminConsole')
         $scope.ok = function() {
           $scope.form.passwordChangeForm.submitted = true;
           if($scope.form.passwordChangeForm.$valid){
-            modalInstance.close($scope.passwordData.password, $scope.passwordData.currentUserPassword);
+
+            modalInstance.close({
+              password: $scope.passwordData.password, 
+              currentUserPassword: $scope.passwordData.currentUserPassword
+            });
           }
         };
         $scope.cancel = function() {
@@ -54,8 +59,12 @@ angular.module('ambariAdminConsole')
       }]
     });
 
-    modalInstance.result.then(function(newPassword, currentUserPassword) {
-      User.setPassword($scope.user, newPassword, currentUserPassword);
+    modalInstance.result.then(function(data) {
+      User.setPassword($scope.user, data.password, data.currentUserPassword).then(function() {
+        uiAlert.success('Password changed.');
+      }).catch(function(data) {
+        uiAlert.danger(data.data.status, data.data.message);
+      });
     }); 
   };
 

+ 30 - 0
ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/Auth.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.
+ */
+'use strict';
+
+angular.module('ambariAdminConsole')
+.factory('Auth',['$http', 'Settings', function($http, Settings) {
+  return {
+    signout: function() {
+      return $http({
+        method: 'GET',
+        url: Settings.baseUrl + '/logout'
+      });
+    }
+  };
+}]);

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

@@ -18,7 +18,7 @@
 'use strict';
 
 angular.module('ambariAdminConsole')
-.factory('User', ['Restangular', function(Restangular) {
+.factory('User', ['Restangular', '$http', 'Settings', function(Restangular, $http, Settings) {
   Restangular.addResponseInterceptor(function(data, operation, what, url, response, deferred) {
     var extractedData;
     if(operation === 'getList'){
@@ -48,12 +48,20 @@ angular.module('ambariAdminConsole')
       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'
+      return $http({
+        method: 'PUT',
+        url: Settings.baseUrl + '/users/' + user.user_name,
+        data: {
+          'Users/password': password,
+          'Users/old_password': currentUserPassword,
+          'Users/roles': user.roles[0] || 'user' 
+        }
       });
+      // 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();

+ 20 - 1
ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/View.js

@@ -126,7 +126,26 @@ angular.module('ambariAdminConsole')
     });
 
     return deferred.promise;
-  }
+  };
+
+  View.getVersions = function(viewName) {
+    var deferred = $q.defer();
+
+    $http({
+      method: 'GET',
+      url: Settings.baseUrl + '/views/'+viewName
+    }).success(function(data) {
+      var versions = [];
+      angular.forEach(data.versions, function(version) {
+        versions.push(version.ViewVersionInfo.version);
+      });
+
+      deferred.resolve(versions);
+    }).catch(function(data) {
+      deferred.reject(data);
+    });
+    return deferred.promise;
+  };
 
   View.createInstance = function(instanceInfo) {
     var deferred = $q.defer();

+ 16 - 14
ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/ldap.js

@@ -18,27 +18,29 @@
 'use strict';
 
 angular.module('ambariAdminConsole')
-.factory('LDAP', ['$http', '$q', function($http, $q) {
+.factory('LDAP', ['$http', '$q', 'Settings', function($http, $q, Settings) {
 
 
   return {
-    get: function(resourceType) {
-      var deferred = $q.defer();
-
-      $http({
+    get: function() {
+      return $http({
         method: 'GET',
         url: '/api/v1/controllers/ldap'
-      })
-      .success(function(data) {
-        deferred.resolve(data);
-      })
-      .catch(function(data) {
-        deferred.reject(data);
       });
-
-      return deferred.promise;
     },
-    sync: function(resourceType, items) {
+    sync: function(groupsList, usersList) {
+      return $http({
+        method: 'POST',
+        url: Settings.baseUrl + '/controllers/ldap',
+        data:{
+          LDAP:{
+            "synced_groups": groupsList.join(','),
+            "synced_users": usersList.join(',')
+          }
+        }
+      });
+    },
+    syncResource: function(resourceType, items) {
       var items = items.map(function(item) {
         var name = 'LDAP/synced_' + resourceType;
         var obj = {};

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

@@ -17,6 +17,40 @@
  */
 
 
+.views-list-pane .glyphicon.glyphicon-chevron-right{
+  -webkit-transition: all 0.3s;
+  -o-transition: all 0.3s;
+  transition: all 0.3s;
+}
+.views-list-pane .glyphicon.glyphicon-chevron-right.opened{
+  -webkit-transform: rotateZ(90deg);
+  -ms-transform: rotateZ(90deg);
+  -o-transform: rotateZ(90deg);
+  transform: rotateZ(90deg);
+}
+
+.pulldown2{
+  -webkit-transform: translateY(2px);
+  -ms-transform: translateY(2px);
+  -o-transform: translateY(2px);
+  transform: translateY(2px);
+}
+.btn.disabled.syncldapbtn{
+  pointer-events: auto;
+  background-color: #0044cc;
+}
+
+.about .logo{
+  float: left;
+  width: 20%;
+}
+.about .content{
+  float: left;
+}
+.about .content .project{
+  font-weight: bold;
+  font-size: 2em;
+}
 /*
   Style topnav menu
 */

+ 1 - 1
ambari-admin/src/main/resources/ui/admin-web/app/views/ambariViews/create.html

@@ -27,7 +27,7 @@
     <img src="http://placehold.it/32x32" alt="" class="icon-small">
     <div class="description">
       <h3>{{view.ViewVersionInfo.view_name}}</h3>
-      <span>{{view.ViewVersionInfo.label}} | Version: {{view.ViewVersionInfo.version}}</span>
+      <span>{{view.ViewVersionInfo.label}} | Version: <select ng-model="version" ng-change="versionChanged()" ng-options="o as o for o in versions"></select></span>
     </div>
   </div>
   

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

@@ -17,7 +17,7 @@
 -->
 <ol class="breadcrumb">
   <li><a href="#/views">Views</a></li>
-  <li class="active">Edit instance</li>
+  <li class="active">Edit {{instance.ViewInstanceInfo.label}}</li>
 </ol>
 <h2>Edit {{instance.ViewInstanceInfo.view_name}}: {{instance.ViewInstanceInfo.label}}</h2>
 <hr>

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

@@ -38,10 +38,13 @@
     <div class="col-sm-3"><h4>Descirption</h4></div>
   </div>
   <accordion>
-    <accordion-group ng-repeat="view in filteredViews">
+    <accordion-group ng-repeat="view in filteredViews" is-open="open">
       <accordion-heading>
         <div class="row">
-          <div class="col-sm-3">{{view.view_name}}</div>
+          <div class="col-sm-3">
+            <i class="glyphicon glyphicon-chevron-right" ng-class="{'opened': open}"></i>
+            {{view.view_name}}
+          </div>
           <div class="col-sm-3">{{view.versions}}</div>
           <div class="col-sm-3">{{view.instances.length ? view.instances.length : 'No'}} instances</div>
           <div class="col-sm-3">This is a description</div>

+ 1 - 1
ambari-admin/src/main/resources/ui/admin-web/app/views/groups/edit.html

@@ -17,7 +17,7 @@
 -->
 <ol class="breadcrumb">
   <li><a href="#/groups">Groups</a></li>
-  <li class="active">Edit group</li>
+  <li class="active">Edit {{group.group_name}}</li>
 </ol>
 <div class="clearfix">
   <h3 class="pull-left">Edit {{group.group_name}}</h3>

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

@@ -23,7 +23,6 @@
     <h3 class="pull-left">Groups management</h3>
     <div class="pull-right top-buffer">
       <link-to route="groups.create" class="btn btn-primary"><span class="glyphicon glyphicon-plus"></span> Create Local Group</link-to>
-      <button class="btn btn-default" ng-click="syncLDAP()">Sync LDAP</button>
     </div>
   </div>
   <hr>

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

@@ -1,47 +0,0 @@
-<!--
-* 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">LDAP {{resourceType}}</h3>
-</div>
-<div class="modal-body">
-  <div class="alert alert-danger" ng-show="isDataLoaded && !isConfigured">
-    LDAP is not configured.
-  </div>
-  <table class="table table-hover table-striped ldap-table" ng-show="isDataLoaded">
-    <tbody>
-      <tr ng-repeat="item in items">
-        <td class="col-sm-10">{{item.name}}</td>
-        <td class="col-sm-2">
-          <div class="checkbox">
-            <label>
-              <input type="checkbox" ng-model="item.selected">
-            </label>
-          </div>
-        </td>
-      </tr>
-    </tbody>
-  </table>
-  <div class="alert alert-info" ng-show="isConfigured && isDataLoaded && !items">
-    No {{resourceType}} to sync.
-  </div>
-  <progressbar ng-hide="isDataLoaded" class="progress-striped active" max="200" value="200" type="default"></progressbar>
-</div>
-<div class="modal-footer">
-  <button class="btn btn-primary" ng-click="sync()">Sync</button>
-  <button class="btn btn-warning" ng-click="cancel()">Cancel</button>
-</div>

+ 11 - 1
ambari-admin/src/main/resources/ui/admin-web/app/views/leftNavbar.html

@@ -22,7 +22,7 @@
       <h5>{{cluster.Clusters.cluster_name}}</h5>
       <ul class="nav nav-pills nav-stacked">
         <li ng-class="{active: isActive('clusters.manageAccess')}">
-          <link-to route="clusters.manageAccess" id="{{cluster.Clusters.cluster_name}}">Permissions</link-to>
+          <a href="#/clusters/{{cluster.Clusters.cluster_name}}/manageAccess">Permissions</a>
         </li>
         <li><a href="/#/main/dashboard">Go to Dashboard</a></li>
       </ul>
@@ -54,5 +54,15 @@
       <li ng-class="{active: isActive('users.list')}"><link-to route="users.list">Users</link-to></li>
       <li ng-class="{active: isActive('groups.list')}"><link-to route="groups.list">Groups</link-to></li>
     </ul>
+    <hr>
+    <div ng-switch="isLDAPConfigured">
+      <a ng-switch-when="true" href class="btn btn-primary btn-block syncldapbtn" ng-click="syncLDAP()">
+        <span class="glyphicon glyphicon-transfer pulldown2"></span> Sync LDAP
+      </a>
+      <a ng-switch-default href class="btn btn-primary btn-block syncldapbtn disabled" popover="LDAP is not configured. To configure LDAP, run ambari-server setup-ldap from the command line." popover-trigger="mouseenter">
+        <span class="glyphicon glyphicon-transfer pulldown2"></span> Sync LDAP
+      </a>
+    </div>
+      
   </div>
 </div>

+ 42 - 0
ambari-admin/src/main/resources/ui/admin-web/app/views/modals/AboutModal.html

@@ -0,0 +1,42 @@
+<!--
+* 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">
+  <button type="button" class="close" data-dismiss="modal" ng-click="ok()"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
+  <h3 class="modal-title">About</h3>
+</div>
+<div class="modal-body">
+  <div class="about clearfix">
+    <div class="logo">
+      <img src="/img/logo.png" alt="Apache Ambari" title="Apache Ambari">
+    </div>
+    <div class="content">
+      <div class="project">Apache Ambari</div>
+      <br>
+      <span id="i18n-33">Version</span>
+      <script id="metamorph-199-start" type="text/x-placeholder"></script>1.7.0<script id="metamorph-199-end" type="text/x-placeholder"></script>
+      <br>
+      <br>
+      <a href="http://ambari.apache.org/" target="_blank"><span id="i18n-34">Get involved!</span></a>
+      <br>
+      <a href="http://www.apache.org/licenses/LICENSE-2.0" target="_blank"><span id="i18n-35">Licensed under the Apache License, Version 2.0</span></a>
+  </div>
+  </div>
+</div>
+<div class="modal-footer">
+    <button class="btn btn-success" ng-click="ok()">OK</button>
+</div>

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

@@ -23,7 +23,6 @@
     <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" ng-click="syncLDAP()">Sync LDAP</button>
     </div>
   </div>
   <hr>

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

@@ -17,7 +17,7 @@
 -->
 <ol class="breadcrumb">
   <li><a href="#/users">Users</a></li>
-  <li class="active">Edit user</li>
+  <li class="active">Edit {{user.user_name}}</li>
 </ol>
 <div ng-show="user.user_name">
   <div class="clearfix">

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

@@ -42,6 +42,7 @@ gulp.task('html', ['styles'], function () {
     var cssFilter = $.filter('**/*.css');
 
     return gulp.src('app/*.html')
+        .pipe($.plumber())
         .pipe($.useref.assets({searchPath: '{.tmp,app}'}))
         .pipe(jsFilter)
         .pipe($.uglify())

+ 2 - 1
ambari-admin/src/main/resources/ui/admin-web/package.json

@@ -24,7 +24,8 @@
     "gulp-useref": "^0.4.2",
     "jshint-stylish": "^0.2.0",
     "opn": "^0.1.1",
-    "wiredep": "^1.4.3"
+    "wiredep": "^1.4.3",
+    "gulp-plumber": "*"
   },
   "engines": {
     "node": ">=0.10.0"