mirror of
				https://github.com/gyurix1968/guacamole-client.git
				synced 2025-10-31 00:53:21 +00:00 
			
		
		
		
	GUACAMOLE-292: Display user attributes within user menu.
This commit is contained in:
		| @@ -47,6 +47,8 @@ angular.module('navigation').directive('guacUserMenu', [function guacUserMenu() | ||||
|             var $location             = $injector.get('$location'); | ||||
|             var $route                = $injector.get('$route'); | ||||
|             var authenticationService = $injector.get('authenticationService'); | ||||
|             var schemaService         = $injector.get('schemaService'); | ||||
|             var userService           = $injector.get('userService'); | ||||
|             var userPageService       = $injector.get('userPageService'); | ||||
|  | ||||
|             /** | ||||
| @@ -56,6 +58,18 @@ angular.module('navigation').directive('guacUserMenu', [function guacUserMenu() | ||||
|              */ | ||||
|             $scope.username = authenticationService.getCurrentUsername(); | ||||
|              | ||||
|             // Pull user attribute schema | ||||
|             schemaService.getUserAttributes(authenticationService.getDataSource()) | ||||
|                     .success(function attributesReceived(attributes) { | ||||
|                 $scope.attributes = attributes; | ||||
|             }); | ||||
|  | ||||
|             // Pull user data | ||||
|             userService.getUser(authenticationService.getDataSource(), $scope.username) | ||||
|                     .success(function userRetrieved(user) { | ||||
|                 $scope.user = user; | ||||
|             }); | ||||
|  | ||||
|             /** | ||||
|              * The available main pages for the current user. | ||||
|              *  | ||||
|   | ||||
| @@ -22,6 +22,7 @@ | ||||
|  */ | ||||
| angular.module('navigation', [ | ||||
|     'auth', | ||||
|     'form', | ||||
|     'notification', | ||||
|     'rest' | ||||
| ]); | ||||
|   | ||||
| @@ -82,3 +82,15 @@ | ||||
| .user-menu .menu-dropdown .menu-contents li a.logout { | ||||
|     background-image: url('images/action-icons/guac-logout-dark.png'); | ||||
| } | ||||
|  | ||||
| .user-menu .menu-dropdown .menu-contents .profile { | ||||
|     margin: 1em; | ||||
|     padding-bottom: 1em; | ||||
|     border-bottom: 1px solid rgba(0, 0, 0, 0.25); | ||||
|     width: 2in; | ||||
| } | ||||
|  | ||||
| .user-menu .menu-dropdown .menu-contents .profile span.field-header, | ||||
| .user-menu .menu-dropdown .menu-contents .profile h3 { | ||||
|     display: none; | ||||
| } | ||||
|   | ||||
| @@ -1,6 +1,13 @@ | ||||
| <div class="user-menu" ng-show="!isAnonymous()"> | ||||
|     <guac-menu menu-title="username"> | ||||
|             | ||||
|         <!-- User profile view --> | ||||
|         <div class="profile"> | ||||
|             <guac-form namespace="'USER_ATTRIBUTES'" content="attributes" | ||||
|                        model="user.attributes" values-only="true" | ||||
|                        read-only="true"></guac-form> | ||||
|         </div> | ||||
|  | ||||
|         <!-- Local actions --> | ||||
|         <ul class="action-list"> | ||||
|             <li ng-repeat="action in localActions"> | ||||
|   | ||||
		Reference in New Issue
	
	Block a user