浏览代码

AMBARI-1073. Remove cluster name entry from top titlebar. (Srimanth Gunturi via yusaku)

git-svn-id: https://svn.apache.org/repos/asf/incubator/ambari/trunk@1431592 13f79535-47bb-0310-9956-ffa450edef68
Yusaku Sako 12 年之前
父节点
当前提交
7ef0f4abc9
共有 4 个文件被更改,包括 15 次插入3 次删除
  1. 3 0
      CHANGES.txt
  2. 9 0
      ambari-web/app/controllers/main.js
  3. 1 1
      ambari-web/app/templates/application.hbs
  4. 2 2
      ambari-web/app/templates/main.hbs

+ 3 - 0
CHANGES.txt

@@ -642,6 +642,9 @@ AMBARI-666 branch (unreleased changes)
 
   BUG FIXES
 
+  AMBARI-1073. Remove cluster name entry from top titlebar. (Srimanth Gunturi
+  via yusaku)
+
   AMBARI-1071. Nagios alerts not updating in UI. (Srimanth Gunturi via yusaku)
 
   AMBARI-1063. Workflow Web Service potentially leaks DB connections upon

+ 9 - 0
ambari-web/app/controllers/main.js

@@ -21,7 +21,16 @@ require('models/background_operation');
 
 App.MainController = Em.Controller.extend({
   name: 'mainController',
+  
   clusterName: function () {
+    var name = App.router.get('clusterController.clusterName');
+    if (name) {
+      return name;
+    }
+    return 'My Cluster';
+  }.property('App.router.clusterController.clusterName'),
+  
+  clusterDisplayName: function () {
     var name = App.router.get('clusterController.clusterName');
     if (name) {
       var displayName = name.length > 13 ? name.substr(0, 10) + "..." : name;

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

@@ -25,7 +25,7 @@
           <a class="brand" {{translateAttr href="topnav.logo.href"}} target="_blank">{{t app.name}}</a>
             {{#if App.router.loggedIn}}
               <a class="brand cluster-name" href="#">
-                - {{clusterName}}
+<!--                 - {{clusterName}} -->
               </a>
             {{/if}}
           <ul class="nav">

+ 2 - 2
ambari-web/app/templates/main.hbs

@@ -20,8 +20,8 @@
 <div id="main-nav">
   <div class="navbar">
     <div class="navbar-inner">
-      <a class="brand" href="#">
-        {{clusterName}}
+      <a class="brand" href="#" {{bindAttr title="clusterName"}}>
+        {{clusterDisplayName}}
 
         {{#view App.EmptyView controllerBinding="App.router.backgroundOperationsController"}}
           {{#if allOperationsCount}}