mirror of https://github.com/grafana/grafana.git
stackdriver: make it possible to use aligner template variable
This commit is contained in:
parent
2a6aec721e
commit
a027a87d50
|
@ -43,7 +43,7 @@ export class StackdriverAggregationCtrl {
|
|||
|
||||
setAlignOptions() {
|
||||
this.alignOptions = getAlignmentOptionsByMetric(this.target.valueType, this.target.metricKind);
|
||||
if (!this.alignOptions.find(o => o.value === this.target.aggregation.perSeriesAligner)) {
|
||||
if (!this.alignOptions.find(o => o.value === this.templateSrv.replace(this.target.aggregation.perSeriesAligner))) {
|
||||
this.target.aggregation.perSeriesAligner = this.alignOptions.length > 0 ? this.alignOptions[0].value : '';
|
||||
}
|
||||
}
|
||||
|
@ -62,7 +62,9 @@ export class StackdriverAggregationCtrl {
|
|||
}
|
||||
|
||||
formatAlignmentText() {
|
||||
const selectedAlignment = this.alignOptions.find(ap => ap.value === this.target.aggregation.perSeriesAligner);
|
||||
const selectedAlignment = this.alignOptions.find(
|
||||
ap => ap.value === this.templateSrv.replace(this.target.aggregation.perSeriesAligner)
|
||||
);
|
||||
return `${kbn.secondsToHms(this.$scope.alignmentPeriod)} interval (${selectedAlignment.text})`;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue