|
|
|
@ -57,10 +57,17 @@ class GrafanaDatasource { |
|
|
|
if (!_.isArray(options.annotation.tags) || options.annotation.tags.length === 0) { |
|
|
|
if (!_.isArray(options.annotation.tags) || options.annotation.tags.length === 0) { |
|
|
|
return this.$q.when([]); |
|
|
|
return this.$q.when([]); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
const delimiter = '__delimiter__'; |
|
|
|
const tags = []; |
|
|
|
const tags = []; |
|
|
|
for (const t of params.tags) { |
|
|
|
for (const t of params.tags) { |
|
|
|
const renderedValues = this.templateSrv.replace(t, {}, 'pipe'); |
|
|
|
const renderedValues = this.templateSrv.replace(t, {}, value => { |
|
|
|
for (const tt of renderedValues.split('|')) { |
|
|
|
if (typeof value === 'string') { |
|
|
|
|
|
|
|
return value; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return value.join(delimiter); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
for (const tt of renderedValues.split(delimiter)) { |
|
|
|
tags.push(tt); |
|
|
|
tags.push(tt); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|