mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Made the annotation tags support more cross datasource compatible
This commit is contained in:
parent
494ede5bbf
commit
96bd66e811
@ -3,7 +3,7 @@ define([
|
||||
'jquery',
|
||||
'lodash'
|
||||
],
|
||||
function (angular, $) {
|
||||
function (angular, $, _) {
|
||||
'use strict';
|
||||
|
||||
angular
|
||||
@ -23,8 +23,17 @@ function (angular, $) {
|
||||
tooltip += text.replace(/\n/g, '<br>') + '<br>';
|
||||
}
|
||||
|
||||
if (event.tags && event.tags.length > 0) {
|
||||
tooltip += '<span class="label label-tag" ng-repeat="tag in event.tags" tag-color-from-name="tag">{{tag}}</span><br/>';
|
||||
var tags = event.tags;
|
||||
if (_.isString(event.tags)) {
|
||||
tags = event.tags.split(',');
|
||||
if (tags.length === 1) {
|
||||
tags = event.tags.split(' ');
|
||||
}
|
||||
}
|
||||
|
||||
if (tags && tags.length) {
|
||||
scope.tags = tags;
|
||||
tooltip += '<span class="label label-tag" ng-repeat="tag in tags" tag-color-from-name="tag">{{tag}}</span><br/>';
|
||||
}
|
||||
|
||||
tooltip += "</div>";
|
||||
|
@ -111,19 +111,12 @@ function (angular, _, $, config, kbn, moment) {
|
||||
var list = [];
|
||||
for (var i = 0; i < results.data.length; i++) {
|
||||
var e = results.data[i];
|
||||
var tags = [];
|
||||
if (e.tags) {
|
||||
tags = e.tags.split(',');
|
||||
if (tags.length === 1) {
|
||||
tags = e.tags.split(' ');
|
||||
}
|
||||
}
|
||||
|
||||
list.push({
|
||||
annotation: annotation,
|
||||
time: e.when * 1000,
|
||||
title: e.what,
|
||||
tags: tags,
|
||||
tags: e.tags,
|
||||
text: e.data
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user