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

Graph: small fix to legend table mode

Torkel Ödegaard 11 лет назад
Родитель
Сommit
81b1939f92

+ 1 - 1
CHANGELOG.md

@@ -22,7 +22,7 @@
 
 **OpenTSDB**
 - [Issue #930](https://github.com/grafana/grafana/issues/930). OpenTSDB: Adding counter max and counter reset value to open tsdb query editor, thx @rsimiciuc
-- [Issue #917](https://github.com/grafana/grafana/issues/917). OpenTSDB: Templating support for OpenTSDB series name and tags
+- [Issue #917](https://github.com/grafana/grafana/issues/917). OpenTSDB: Templating support for OpenTSDB series name and tags, thx @mchataigner
 
 **Fixes**
 - [Issue #925](https://github.com/grafana/grafana/issues/925). Graph: bar width calculation fix for some edge cases (bars would render on top of each other)

+ 1 - 0
src/app/directives/panelMenu.js

@@ -22,6 +22,7 @@ function (angular, $, _) {
         template += '</div>';
 
         template += '<div class="panel-menu-row">';
+        template += '<a class="panel-menu-link" bs-dropdown="[{text: \'hej\'}]"><i class="icon-th-list"></i></a>';
 
         _.each($scope.panelMeta.menu, function(item) {
           template += '<a class="panel-menu-link" ';

+ 4 - 4
src/app/panels/graph/axisEditor.html

@@ -40,11 +40,11 @@
 <div class="editor-row">
   <div class="section">
     <h5>Legend styles</h5>
-		<editor-opt-bool text="Show legend" model="panel.legend.show" change="get_data();"></editor-opt-bool>
-		<editor-opt-bool text="Include values" model="panel.legend.values" change="render()"></editor-opt-bool>
-		<editor-opt-bool text="Align as table" model="panel.legend.alignAsTable" change="render()"></editor-opt-bool>
+		<editor-opt-bool text="Show" model="panel.legend.show" change="get_data();"></editor-opt-bool>
+		<editor-opt-bool text="Values" model="panel.legend.values" change="render()"></editor-opt-bool>
+		<editor-opt-bool text="Table" model="panel.legend.alignAsTable" change="render()"></editor-opt-bool>
 		<editor-opt-bool text="Right side" model="panel.legend.rightSide" change="render()"></editor-opt-bool>
-  </div>
+	</div>
 
   <div class="section" ng-if="panel.legend.values">
     <h5>Legend values</h5>

+ 1 - 1
src/app/panels/graph/legend.js

@@ -63,7 +63,7 @@ function (angular, app, _, kbn, $) {
 
           $container.empty();
 
-          $container.toggleClass('graph-legend-table', panel.legend.alignAsTable);
+          $container.toggleClass('graph-legend-table', panel.legend.alignAsTable === true);
 
           if (panel.legend.alignAsTable) {
             var header = '<tr>';

+ 5 - 0
src/app/services/dashboard/dashboardKeyBindings.js

@@ -50,6 +50,11 @@ function(angular, $) {
         scope.dashboard.emit_refresh('refresh');
       }, { inputDisabled: true });
 
+      keyboardManager.bind('ctrl+l', function() {
+        scope.dashboard.hideAllLegends = !scope.dashboard.hideAllLegends;
+        scope.dashboard.emit_refresh('refresh');
+      }, { inputDisabled: true });
+
       keyboardManager.bind('ctrl+h', function() {
         var current = scope.dashboard.hideControls;
         scope.dashboard.hideControls = !current;

+ 1 - 1
src/css/less/variables.dark.less

@@ -146,7 +146,7 @@
 
 // Dropdowns
 // -------------------------
-@dropdownBackground:            @heroUnitBackground;
+@dropdownBackground:            @grafanaTargetFuncBackground;
 @dropdownBorder:                rgba(0,0,0,.2);
 @dropdownDividerTop:            transparent;
 @dropdownDividerBottom:         #222;