You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ak...@apache.org on 2015/08/24 13:15:34 UTC

ambari git commit: AMBARI-12855. Flume agents action drop-down is displayed incorrectly (akovalenko)

Repository: ambari
Updated Branches:
  refs/heads/trunk c44741876 -> 98ff9e735


AMBARI-12855. Flume agents action drop-down is displayed incorrectly (akovalenko)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/98ff9e73
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/98ff9e73
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/98ff9e73

Branch: refs/heads/trunk
Commit: 98ff9e735ca98216376bf0789038a4d8d679705a
Parents: c447418
Author: Aleksandr Kovalenko <ak...@hortonworks.com>
Authored: Mon Aug 24 14:11:43 2015 +0300
Committer: Aleksandr Kovalenko <ak...@hortonworks.com>
Committed: Mon Aug 24 14:15:08 2015 +0300

----------------------------------------------------------------------
 ambari-web/app/styles/application.less          | 15 ++++++-----
 .../app/templates/main/service/info/summary.hbs | 10 +-------
 .../app/templates/main/service/service.hbs      | 26 ++++++++++++++++++++
 .../templates/main/service/services/flume.hbs   | 12 ++++++---
 .../app/views/main/service/info/summary.js      | 11 ++-------
 ambari-web/app/views/main/service/service.js    |  7 +++++-
 .../app/views/main/service/services/flume.js    | 23 ++++++++++++++++-
 7 files changed, 74 insertions(+), 30 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/98ff9e73/ambari-web/app/styles/application.less
----------------------------------------------------------------------
diff --git a/ambari-web/app/styles/application.less b/ambari-web/app/styles/application.less
index f5feffc..ac8896f 100644
--- a/ambari-web/app/styles/application.less
+++ b/ambari-web/app/styles/application.less
@@ -5640,16 +5640,16 @@ input[type="radio"].align-checkbox, input[type="checkbox"].align-checkbox {
       width: 40%;
     }
     th:first-child + th {
-      width: 40%;
+      width: 30%;
     }
     th:first-child + th + th {
-      width: 16px;
+      width: 10%;
     }
     th:first-child + th + th + th {
-      width: 16px;
+      width: 10%;
     }
     th:first-child + th + th + th + th {
-      width: 16px;
+      width: 10%;
     }
     td.agent-status {
       width: 125px;
@@ -5699,10 +5699,10 @@ input[type="radio"].align-checkbox, input[type="checkbox"].align-checkbox {
     margin: 0 5px 5px 0;
     float: right;
     width:60px;
-    position: relative;
+    position: static;
   }
   .flume-agents-actions {
-    position: absolute;
+    position: static;
     a {
       text-decoration: none;
     }
@@ -5711,6 +5711,9 @@ input[type="radio"].align-checkbox, input[type="checkbox"].align-checkbox {
       font-size: 11px;
       line-height: 17px;
     }
+    .dropdown-menu {
+      position: absolute;
+    }
   }
   .scrollable-container {
     max-height: 450px;

http://git-wip-us.apache.org/repos/asf/ambari/blob/98ff9e73/ambari-web/app/templates/main/service/info/summary.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/service/info/summary.hbs b/ambari-web/app/templates/main/service/info/summary.hbs
index ed96e9a..85d7414 100644
--- a/ambari-web/app/templates/main/service/info/summary.hbs
+++ b/ambari-web/app/templates/main/service/info/summary.hbs
@@ -62,15 +62,7 @@
       {{/if}}
     </div>
     {{#if view.serviceSummaryView}}
-      <div class="service-content row-fluid">
-        <div class="span6">
-          <table class="summary-info table no-borders table-condensed">
-            <tbody>
-            {{view view.serviceSummaryView}}
-            </tbody>
-          </table>
-        </div>
-      </div>
+      {{view view.serviceSummaryView}}
     {{else}}
       <div class="spinner"></div>
     {{/if}}

http://git-wip-us.apache.org/repos/asf/ambari/blob/98ff9e73/ambari-web/app/templates/main/service/service.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/service/service.hbs b/ambari-web/app/templates/main/service/service.hbs
new file mode 100644
index 0000000..262d80f
--- /dev/null
+++ b/ambari-web/app/templates/main/service/service.hbs
@@ -0,0 +1,26 @@
+{{!
+* 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="service-content row-fluid">
+  <div {{bindAttr class="view.isFullWidth:span12:span6"}}>
+    <table class="summary-info table no-borders table-condensed">
+      <tbody>
+        {{yield}}
+      </tbody>
+    </table>
+  </div>
+</div>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/98ff9e73/ambari-web/app/templates/main/service/services/flume.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/service/services/flume.hbs b/ambari-web/app/templates/main/service/services/flume.hbs
index 3dd773d..40ea738 100644
--- a/ambari-web/app/templates/main/service/services/flume.hbs
+++ b/ambari-web/app/templates/main/service/services/flume.hbs
@@ -17,6 +17,8 @@
 }}
 
 <!-- Flume Agents -->
+<tr>
+  <td>
     <div id="flume-summary">
       <a href="#" {{action filterHosts view.flumeHandlerComponent}}>{{view.summaryHeader}}</a>
       <a href="#" class="pull-right" {{action gotoConfigs target="controller"}}>{{t dashboard.services.flume.summary.configure}}</a>
@@ -26,9 +28,9 @@
           {{#view view.sortView contentBinding="view.filteredContent" class="label-row"}}
             {{view view.parentView.hostSort}}
             <th>{{t dashboard.services.flume.agent}}</th>
-            <th><i class="icon-signin" {{translateAttr title="dashboard.services.flume.sources"}}></i></th>
-            <th><i class="icon-random" {{translateAttr title="dashboard.services.flume.channels"}}></i></th>
-            <th><i class="icon-signout" {{translateAttr title="dashboard.services.flume.sinks"}}></i></th>
+            <th><i class="icon-signin" {{translateAttr title="dashboard.services.flume.sources"}}></i> {{t dashboard.services.flume.sources}}</th>
+            <th><i class="icon-random" {{translateAttr title="dashboard.services.flume.channels"}}></i> {{t dashboard.services.flume.channels}}</th>
+            <th><i class="icon-signout" {{translateAttr title="dashboard.services.flume.sinks"}}></i> {{t dashboard.services.flume.sinks}}</th>
           {{/view}}
           </thead>
           {{#if view.pageContent}}
@@ -45,7 +47,7 @@
                       <div class="pull-left"><span {{bindAttr class="host.firtstAgent.healthClass"}}></span> {{host.firtstAgent.name}}</div>
                       <div class="btn-wrapper">
                         <div class="btn-group display-inline-block flume-agents-actions">
-                            <a {{bindAttr class=":btn :dropdown-toggle"}} data-toggle="dropdown" href="javascript:void(null)">{{host.firtstAgent.displayStatus}}
+                            <a class="btn dropdown-toggle" data-toggle="dropdown" href="javascript:void(null)">{{host.firtstAgent.displayStatus}}
                                 <span class="caret"></span>
                             </a>
                             <ul class="pull-left dropdown-menu">
@@ -127,3 +129,5 @@
         </table>
       </div>
     </div>
+  </td>
+</tr>

http://git-wip-us.apache.org/repos/asf/ambari/blob/98ff9e73/ambari-web/app/views/main/service/info/summary.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/service/info/summary.js b/ambari-web/app/views/main/service/info/summary.js
index e6a7e68..4e58bda 100644
--- a/ambari-web/app/views/main/service/info/summary.js
+++ b/ambari-web/app/views/main/service/info/summary.js
@@ -72,14 +72,7 @@ App.MainServiceInfoSummaryView = Em.View.extend(App.UserPref, {
       STORM: App.MainDashboardServiceStormView,
       YARN: App.MainDashboardServiceYARNView,
       RANGER: App.MainDashboardServiceRangerView,
-      FLUME: Em.View.extend({
-        template: Em.Handlebars.compile('' +
-          '<tr>' +
-            '<td>' +
-              '{{view App.MainDashboardServiceFlumeView serviceBinding="view.service"}}' +
-            '</td>' +
-          '</tr>')
-      })
+      FLUME: App.MainDashboardServiceFlumeView
     }
   }.property('serviceName'),
   /** @property collapsedMetrics {object[]} - metrics list for collapsed section
@@ -537,7 +530,7 @@ App.MainServiceInfoSummaryView = Em.View.extend(App.UserPref, {
         service: this.get('service')
       });
     } else  {
-      serviceSummaryView = Em.View.extend({
+      serviceSummaryView = Em.View.extend(App.MainDashboardServiceViewWrapper, {
         templateName: this.get('templatePathPrefix') + 'base'
       });
     }

http://git-wip-us.apache.org/repos/asf/ambari/blob/98ff9e73/ambari-web/app/views/main/service/service.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/service/service.js b/ambari-web/app/views/main/service/service.js
index 841d819..269f261 100644
--- a/ambari-web/app/views/main/service/service.js
+++ b/ambari-web/app/views/main/service/service.js
@@ -118,7 +118,12 @@ App.ComponentLiveTextView =  Em.View.extend({
   }.property("liveComponents", 'totalComponents')
 });
 
-App.MainDashboardServiceView = Em.View.extend({
+App.MainDashboardServiceViewWrapper = Em.Mixin.create({
+  layoutName: require('templates/main/service/service'),
+  isFullWidth: false
+});
+
+App.MainDashboardServiceView = Em.View.extend(App.MainDashboardServiceViewWrapper, {
   classNames: ['service', 'clearfix'],
 
   data: function () {

http://git-wip-us.apache.org/repos/asf/ambari/blob/98ff9e73/ambari-web/app/views/main/service/services/flume.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/service/services/flume.js b/ambari-web/app/views/main/service/services/flume.js
index 4be5018..819e994 100644
--- a/ambari-web/app/views/main/service/services/flume.js
+++ b/ambari-web/app/views/main/service/services/flume.js
@@ -19,9 +19,11 @@ var App = require('app');
 var date = require('utils/date');
 var sort = require('views/common/sort_view');
 
-App.MainDashboardServiceFlumeView = App.TableView.extend({
+App.MainDashboardServiceFlumeView = App.TableView.extend(App.MainDashboardServiceViewWrapper, {
   templateName: require('templates/main/service/services/flume'),
 
+  isFullWidth: true,
+
   pagination: false,
 
   selectedHost: null,
@@ -91,7 +93,26 @@ App.MainDashboardServiceFlumeView = App.TableView.extend({
   }),
 
   didInsertElement: function () {
+    var self = this;
     this.filter();
+    this.$().on('click','.flume-agents-actions .dropdown-toggle', function (e){
+      self.setDropdownPosition(this);
+    });
+  },
+
+  /**
+   * Locate dropdown menu absolutely outside of scrollable block
+   * @param element
+   */
+  setDropdownPosition: function (element) {
+    var button = $(element);
+    var dropdown = button.parent().find('.dropdown-menu');
+    dropdown.css('top', button.offset().top + button.outerHeight() + "px");
+    dropdown.css('left', button.offset().left + "px");
+  },
+
+  willDestroyElement: function () {
+    this.$().off();
   },
 
   /**