Przeglądaj źródła

AMBARI-1373. Since there is the ability to log in to Ambari Web as different users the current user should be indicated. (jaimin)

git-svn-id: https://svn.apache.org/repos/asf/incubator/ambari/trunk@1444931 13f79535-47bb-0310-9956-ffa450edef68
Jaimin Jetly 12 lat temu
rodzic
commit
c603ba9b93

+ 3 - 0
CHANGES.txt

@@ -40,6 +40,9 @@ Trunk (unreleased changes):
 
  IMPROVEMENTS
 
+ AMBARI-1373. Since there is the ability to log in to Ambari Web as 
+ different users the current user should be indicated. (jaimin)
+
  AMBARI-1366. Nagios alert tweaks. (jaimin)
 
  AMBARI-1365. Make Hosts table update dynamically. (jaimin)

+ 4 - 0
ambari-web/app/router.js

@@ -79,6 +79,10 @@ App.Router = Em.Router.extend({
 
   loggedIn: false,
 
+  loginName: function() {
+    return this.getLoginName();
+  }.property('loggedIn'),
+
   getAuthenticated: function () {
     var auth = App.db.getAuthenticated();
     var authResp = (auth && auth === true);

+ 1 - 1
ambari-web/app/styles/application.less

@@ -96,7 +96,7 @@ footer {
   }
 
   .navbar-inner{
-    min-height: 30px;
+    min-height: 40px;
   }
 
   .navbar .nav .active > a, .navbar .nav .active > a:hover {

+ 10 - 7
ambari-web/app/templates/application.hbs

@@ -37,13 +37,16 @@
               </a>
           {{/if}}
 
-          <ul class="nav">
-            <!-- <li class="right"><a class="help" {{!translateAttr href="topnav.help.href"}} target="_blank">Help</a></li> -->
-            {{#if App.router.loggedIn}}
-            <li class="right"><a class="help" href="" {{action logoff}}>{{t app.sighout}}</a></li>
-            {{/if}}
-            <li class="right">{{loginName}}</li>
-          </ul>
+          {{#if App.router.loggedIn}}
+            <div class="btn-group pull-right usermenu-wrapper">
+              <button class="btn btn-group dropdown-toggle"  data-toggle="dropdown">
+                {{App.router.loginName}}&nbsp;<span class="caret"></span>
+              </button>
+              <ul class="dropdown-menu">
+                <li><a href="" {{action logoff}}>{{t app.sighout}}</a></li>
+              </ul>
+            </div>
+          {{/if}}
         </div>
       </div>
     </div>