NeoCat / grafana-cal-heatmap-panel

Cal-HeatMap Panel Plugin for Grafana
MIT License
33 stars 5 forks source link

FR: Interpret dashboard variables in link template #9

Open nathanpegram opened 5 years ago

nathanpegram commented 5 years ago

It looks like the link template only has the ability to use the time span variables, $ts_from and $ts_to. It would be really useful if the link could also interpret values of grafana dashboard variables.

tkhadimullin commented 4 years ago

I actually just ran into the same problem. At the bare minimum, it seems, we need to get the result or current interpolation function: var url = template.replace('$ts_from', from).replace('$ts_to', to); and feed it to Grafana's own replaceWithText engine: url = this.templateSrv.replaceWithText(url, []); // note the empty array, it works like this, but ideally we'd get the time ranges passed in there

@NeoCat, @MacroPower if you are happy with my suggestion and would review a PR, I'm keen to put it together.