mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Merge branch 'master' into alerting_opentsdb
This commit is contained in:
@@ -358,9 +358,15 @@ function (angular, _, moment, dateMath, kbn, CloudWatchAnnotationQuery) {
|
||||
}
|
||||
|
||||
this.getExpandedVariables = function(target, dimensionKey, variable) {
|
||||
/* if the all checkbox is marked we should add all values to the targets */
|
||||
var allSelected = _.find(variable.options, {'selected': true, 'text': 'All'});
|
||||
return _.chain(variable.options)
|
||||
.filter(function(v) {
|
||||
return v.selected;
|
||||
if (allSelected) {
|
||||
return v.text !== 'All';
|
||||
} else {
|
||||
return v.selected;
|
||||
}
|
||||
})
|
||||
.map(function(v) {
|
||||
var t = angular.copy(target);
|
||||
@@ -369,6 +375,10 @@ function (angular, _, moment, dateMath, kbn, CloudWatchAnnotationQuery) {
|
||||
}).value();
|
||||
};
|
||||
|
||||
this.containsVariable = function (str, variableName) {
|
||||
return str.indexOf('$' + variableName) !== -1;
|
||||
};
|
||||
|
||||
this.expandTemplateVariable = function(targets, templateSrv) {
|
||||
var self = this;
|
||||
return _.chain(targets)
|
||||
@@ -379,7 +389,7 @@ function (angular, _, moment, dateMath, kbn, CloudWatchAnnotationQuery) {
|
||||
|
||||
if (dimensionKey) {
|
||||
var variable = _.find(templateSrv.variables, function(variable) {
|
||||
return templateSrv.containsVariable(target.dimensions[dimensionKey], variable.name);
|
||||
return self.containsVariable(target.dimensions[dimensionKey], variable.name);
|
||||
});
|
||||
return self.getExpandedVariables(target, dimensionKey, variable);
|
||||
} else {
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
<div class="gf-form">
|
||||
<label class="gf-form-label width-13">Default Region</label>
|
||||
<div class="gf-form-select-wrapper max-width-18 gf-form-select-wrapper--has-help-icon">
|
||||
<select class="gf-form-input" ng-model="ctrl.current.jsonData.defaultRegion" ng-options="region for region in ['ap-northeast-1', 'ap-northeast-2', 'ap-southeast-1', 'ap-southeast-2', 'cn-north-1', 'eu-central-1', 'eu-west-1', 'sa-east-1', 'us-east-1', 'us-west-1', 'us-west-2']"></select>
|
||||
<select class="gf-form-input" ng-model="ctrl.current.jsonData.defaultRegion" ng-options="region for region in ['ap-northeast-1', 'ap-northeast-2', 'ap-southeast-1', 'ap-southeast-2', 'ap-south-1', 'cn-north-1', 'eu-central-1', 'eu-west-1', 'sa-east-1', 'us-east-1', 'us-east-2', 'us-west-1', 'us-west-2']"></select>
|
||||
<info-popover mode="right-absolute">
|
||||
Specify the region, such as for US West (Oregon) use ` us-west-2 ` as the region.
|
||||
</info-popover>
|
||||
|
||||
@@ -478,7 +478,7 @@
|
||||
"steppedLine": false,
|
||||
"targets": [
|
||||
{
|
||||
"expr": "prometheus_evaluator_duration_milliseconds{quantile!=\"0.01\", quantile!=\"0.05\"}",
|
||||
"expr": "prometheus_evaluator_duration_seconds{quantile!=\"0.01\", quantile!=\"0.05\"}",
|
||||
"interval": "",
|
||||
"intervalFactor": 2,
|
||||
"legendFormat": "{{quantile}}",
|
||||
|
||||
@@ -392,17 +392,21 @@ module.directive('grafanaGraph', function($rootScope, timeSrv) {
|
||||
position: 'BOTTOM',
|
||||
markerSize: 5,
|
||||
};
|
||||
|
||||
types['$__ok'] = {
|
||||
color: 'rgba(11, 237, 50, 1)',
|
||||
position: 'BOTTOM',
|
||||
markerSize: 5,
|
||||
};
|
||||
types['$__nodata'] = {
|
||||
|
||||
types['$__no_data'] = {
|
||||
color: 'rgba(150, 150, 150, 1)',
|
||||
position: 'BOTTOM',
|
||||
markerSize: 5,
|
||||
};
|
||||
|
||||
types['$__execution_error'] = ['$__no_data'];
|
||||
|
||||
for (var i = 0; i < annotations.length; i++) {
|
||||
var item = annotations[i];
|
||||
if (item.newState) {
|
||||
|
||||
@@ -149,8 +149,6 @@ function ($, _) {
|
||||
|
||||
seriesHtml = '';
|
||||
|
||||
absoluteTime = dashboard.formatDate(seriesHoverInfo.time, tooltipFormat);
|
||||
|
||||
// Dynamically reorder the hovercard for the current time point if the
|
||||
// option is enabled, sort by yaxis by default.
|
||||
if (panel.tooltip.sort === 2) {
|
||||
@@ -161,13 +159,14 @@ function ($, _) {
|
||||
seriesHoverInfo.sort(function(a, b) {
|
||||
return a.value - b.value;
|
||||
});
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
seriesHoverInfo.sort(function(a, b) {
|
||||
return a.yaxis - b.yaxis;
|
||||
});
|
||||
}
|
||||
|
||||
var distance, time;
|
||||
|
||||
for (i = 0; i < seriesHoverInfo.length; i++) {
|
||||
hoverInfo = seriesHoverInfo[i];
|
||||
|
||||
@@ -175,6 +174,11 @@ function ($, _) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (! distance || hoverInfo.distance < distance) {
|
||||
distance = hoverInfo.distance;
|
||||
time = hoverInfo.time;
|
||||
}
|
||||
|
||||
var highlightClass = '';
|
||||
if (item && i === item.seriesIndex) {
|
||||
highlightClass = 'graph-tooltip-list-item--highlight';
|
||||
@@ -190,6 +194,7 @@ function ($, _) {
|
||||
plot.highlight(hoverInfo.index, hoverInfo.hoverIndex);
|
||||
}
|
||||
|
||||
absoluteTime = dashboard.formatDate(time, tooltipFormat);
|
||||
self.showTooltip(absoluteTime, seriesHtml, pos);
|
||||
}
|
||||
// single series tooltip
|
||||
|
||||
Reference in New Issue
Block a user