소스 검색

Merge branch 'master' of github.com:torkelo/grafana-private into pro

Torkel Ödegaard 11 년 전
부모
커밋
e0dc530e94

+ 1 - 0
CHANGELOG.md

@@ -5,6 +5,7 @@
 - [Issue #795](https://github.com/grafana/grafana/issues/795). Chrome: Fix for display issue in chrome beta & chrome canary when entering edit mode
 - [Issue #795](https://github.com/grafana/grafana/issues/795). Chrome: Fix for display issue in chrome beta & chrome canary when entering edit mode
 - [Issue #818](https://github.com/grafana/grafana/issues/818). Graph: Added percent y-axis format
 - [Issue #818](https://github.com/grafana/grafana/issues/818). Graph: Added percent y-axis format
 - [Issue #828](https://github.com/grafana/grafana/issues/828). Elasticsearch: saving new dashboard with title equal to slugified url would cause it to deleted.
 - [Issue #828](https://github.com/grafana/grafana/issues/828). Elasticsearch: saving new dashboard with title equal to slugified url would cause it to deleted.
+- [Issue #830](https://github.com/grafana/grafana/issues/830). Annotations: Fix for elasticsearch annotations and mapping nested fields
 
 
 # 1.8.0-RC1 (2014-09-12)
 # 1.8.0-RC1 (2014-09-12)
 
 

+ 5 - 2
src/app/directives/dashEditLink.js

@@ -51,9 +51,12 @@ function (angular, $) {
           scope.onAppEvent('hide-dash-editor', hideEditorPane);
           scope.onAppEvent('hide-dash-editor', hideEditorPane);
 
 
           scope.onAppEvent('show-dash-editor', function(evt, payload) {
           scope.onAppEvent('show-dash-editor', function(evt, payload) {
-            hideEditorPane();
+            if (lastEditor === payload.src) {
+              hideEditorPane();
+              return;
+            }
 
 
-            if (lastEditor === payload.src) { return; }
+            hideEditorPane();
 
 
             scope.exitFullscreen();
             scope.exitFullscreen();
 
 

+ 0 - 5
src/app/directives/grafanaGraph.js

@@ -110,11 +110,6 @@ function (angular, $, kbn, moment, _) {
 
 
           // Populate element
           // Populate element
           var options = {
           var options = {
-            hooks: {
-              drawSeries: [function() {
-                console.log('drawSeries', arguments);
-              }]
-            },
             legend: { show: false },
             legend: { show: false },
             series: {
             series: {
               stackpercent: panel.stack ? panel.percentage : false,
               stackpercent: panel.stack ? panel.percentage : false,

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

@@ -5,7 +5,7 @@
        ng-class="{'pull-right': series.yaxis === 2, 'graph-legend-series-hidden': hiddenSeries[series.alias]}"
        ng-class="{'pull-right': series.yaxis === 2, 'graph-legend-series-hidden': hiddenSeries[series.alias]}"
        >
        >
     <div class="graph-legend-icon">
     <div class="graph-legend-icon">
-      <i class='icon-minus pointer' ng-style="{color: series.color}" bs-popover="'colorPopup.html'">
+      <i class='icon-minus pointer' ng-style="{color: series.color}" bs-popover="'colorPopup.html'" data-placement="bottom">
       </i>
       </i>
     </div>
     </div>
     <div class="graph-legend-alias small">
     <div class="graph-legend-alias small">

+ 2 - 1
src/app/services/annotationsSrv.js

@@ -57,7 +57,8 @@ define([
 
 
     function errorHandler(err) {
     function errorHandler(err) {
       console.log('Annotation error: ', err);
       console.log('Annotation error: ', err);
-      alertSrv.set('Annotations','Could not fetch annotations','error');
+      var message = err.message || "Aannotation query failed";
+      alertSrv.set('Annotations error', message,'error');
     }
     }
 
 
     function addAnnotation(options) {
     function addAnnotation(options) {

+ 19 - 13
src/app/services/elasticsearch/es-datasource.js

@@ -86,6 +86,22 @@ function (angular, _, config, kbn, moment) {
         var list = [];
         var list = [];
         var hits = results.data.hits.hits;
         var hits = results.data.hits.hits;
 
 
+        var getFieldFromSource = function(source, fieldName) {
+          if (!fieldName) { return; }
+
+          var fieldNames = fieldName.split('.');
+          var fieldValue = source;
+
+          for (var i = 0; i < fieldNames.length; i++) {
+            fieldValue = fieldValue[fieldNames[i]];
+          }
+
+          if (_.isArray(fieldValue)) {
+            fieldValue = fieldValue.join(', ');
+          }
+          return fieldValue;
+        };
+
         for (var i = 0; i < hits.length; i++) {
         for (var i = 0; i < hits.length; i++) {
           var source = hits[i]._source;
           var source = hits[i]._source;
           var fields = hits[i].fields;
           var fields = hits[i].fields;
@@ -98,21 +114,11 @@ function (angular, _, config, kbn, moment) {
           var event = {
           var event = {
             annotation: annotation,
             annotation: annotation,
             time: moment.utc(time).valueOf(),
             time: moment.utc(time).valueOf(),
-            title: source[titleField],
+            title: getFieldFromSource(source, titleField),
+            tags: getFieldFromSource(source, tagsField),
+            text: getFieldFromSource(source, textField)
           };
           };
 
 
-          if (source[tagsField]) {
-            if (_.isArray(source[tagsField])) {
-              event.tags = source[tagsField].join(', ');
-            }
-            else {
-              event.tags = source[tagsField];
-            }
-          }
-          if (textField && source[textField]) {
-            event.text = source[textField];
-          }
-
           list.push(event);
           list.push(event);
         }
         }
         return list;
         return list;

+ 5 - 6
src/config.sample.js

@@ -1,8 +1,7 @@
-///// @scratch /configuration/config.js/1
- // == Configuration
- // config.js is where you will find the core Grafana configuration. This file contains parameter that
- // must be set before Grafana is run for the first time.
- ///
+// == Configuration
+// config.js is where you will find the core Grafana configuration. This file contains parameter that
+// must be set before Grafana is run for the first time.
+
 define(['settings'],
 define(['settings'],
 function (Settings) {
 function (Settings) {
   "use strict";
   "use strict";
@@ -97,7 +96,7 @@ function (Settings) {
     // Change window title prefix from 'Grafana - <dashboard title>'
     // Change window title prefix from 'Grafana - <dashboard title>'
     window_title_prefix: 'Grafana - ',
     window_title_prefix: 'Grafana - ',
 
 
-    // Add your own custom pannels
+    // Add your own custom panels
     plugins: {
     plugins: {
       // list of plugin panels
       // list of plugin panels
       panels: [],
       panels: [],

+ 3 - 0
src/css/less/grafana.less

@@ -436,6 +436,9 @@ select.grafana-target-segment-input {
   background-color: rgb(58, 57, 57);
   background-color: rgb(58, 57, 57);
   border-radius: 5px;
   border-radius: 5px;
   z-index: 9999;
   z-index: 9999;
+  max-width: 800px;
+  max-height: 600px;
+  overflow: hidden;
 }
 }
 
 
 .tooltip.in {
 .tooltip.in {

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

@@ -257,7 +257,7 @@
 // Form states and alerts
 // Form states and alerts
 // -------------------------
 // -------------------------
 @warningText:             darken(#c09853, 10%);
 @warningText:             darken(#c09853, 10%);
-@warningBackground:       @grayLighter;
+@warningBackground:       @orange;
 @warningBorder:           transparent;
 @warningBorder:           transparent;
 
 
 @errorText:               #b94a48;
 @errorText:               #b94a48;