mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
influxdb: influxql: better tag-value filtering (#36570)
This commit is contained in:
@@ -130,7 +130,7 @@ export const Editor = (props: Props): JSX.Element => {
|
||||
onChange={handleTagsSectionChange}
|
||||
getTagKeyOptions={getTagKeys}
|
||||
getTagValueOptions={(key: string) =>
|
||||
withTemplateVariableOptions(getTagValues(key, measurement, policy, datasource))
|
||||
withTemplateVariableOptions(getTagValues(key, measurement, policy, query.tags ?? [], datasource))
|
||||
}
|
||||
/>
|
||||
</SectionWrap>
|
||||
|
||||
@@ -45,9 +45,10 @@ export async function getTagValues(
|
||||
tagKey: string,
|
||||
measurement: string | undefined,
|
||||
policy: string | undefined,
|
||||
tags: InfluxQueryTag[],
|
||||
datasource: InfluxDatasource
|
||||
): Promise<string[]> {
|
||||
const target = { tags: [], measurement, policy };
|
||||
const target = { tags, measurement, policy };
|
||||
const data = await runExploreQuery('TAG_VALUES', tagKey, undefined, target, datasource);
|
||||
return data.map((item) => item.text);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user