mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Annotations: Elasticsearch annotation and field mapping fixes, small changes for PR #830
This commit is contained in:
@@ -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 #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 #830](https://github.com/grafana/grafana/issues/830). Annotations: Fix for elasticsearch annotations and mapping nested fields
|
||||
|
||||
# 1.8.0-RC1 (2014-09-12)
|
||||
|
||||
|
||||
@@ -110,11 +110,6 @@ function (angular, $, kbn, moment, _) {
|
||||
|
||||
// Populate element
|
||||
var options = {
|
||||
hooks: {
|
||||
drawSeries: [function() {
|
||||
console.log('drawSeries', arguments);
|
||||
}]
|
||||
},
|
||||
legend: { show: false },
|
||||
series: {
|
||||
stackpercent: panel.stack ? panel.percentage : false,
|
||||
|
||||
@@ -57,7 +57,8 @@ define([
|
||||
|
||||
function errorHandler(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) {
|
||||
|
||||
@@ -87,22 +87,22 @@ function (angular, _, config, kbn, moment) {
|
||||
var hits = results.data.hits.hits;
|
||||
|
||||
var getFieldFromSource = function(source, fieldName) {
|
||||
var fieldValue;
|
||||
if (fieldName) {
|
||||
var fieldNames = fieldName.split('.');
|
||||
fieldValue = source;
|
||||
for (var i = 0; i < fieldNames.length; i++) {
|
||||
fieldValue = fieldValue[fieldNames[i]];
|
||||
}
|
||||
if (_.isArray(fieldValue)) {
|
||||
fieldValue = fieldValue.join(',');
|
||||
}
|
||||
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++) {
|
||||
console.log('annotationQuery', hits[i]);
|
||||
var source = hits[i]._source;
|
||||
var fields = hits[i].fields;
|
||||
var time = source[timeField];
|
||||
|
||||
Reference in New Issue
Block a user