mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
support [[var]] in cloudwatch datasource (#7649)
* support [[var]] form in cloudwatch datasource * support multi variable in single dimension * fix test
This commit is contained in:
committed by
Torkel Ödegaard
parent
d88286ab81
commit
68bb417db9
@@ -134,11 +134,18 @@ describe('CloudWatchDatasource', function() {
|
||||
{
|
||||
name: 'instance_id',
|
||||
options: [
|
||||
{ value: 'i-23456789', selected: false },
|
||||
{ value: 'i-34567890', selected: true }
|
||||
{ text: 'i-23456789', value: 'i-23456789', selected: false },
|
||||
{ text: 'i-34567890', value: 'i-34567890', selected: true }
|
||||
]
|
||||
}
|
||||
],
|
||||
replace: function (target, scopedVars) {
|
||||
if (target === '$instance_id' && scopedVars['instance_id']['text'] === 'i-34567890') {
|
||||
return 'i-34567890';
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
},
|
||||
getVariableName: function (e) { return 'instance_id'; },
|
||||
variableExists: function (e) { return true; },
|
||||
containsVariable: function (str, variableName) { return str.indexOf('$' + variableName) !== -1; }
|
||||
|
||||
Reference in New Issue
Block a user