ryantxu / ajax-panel

Ajax Panel Plugin for Grafana
MIT License
153 stars 154 forks source link

REST API Calls #104

Open Aetrius opened 1 year ago

Aetrius commented 1 year ago

Making REST API calls is a little difficult within the plugin. I'm noticing that the URL value doesn't seem to accept any local variables. i.e. if I set a hash variable = xyz when I go to configure the request section of the Ajax plugin, the Parameters (via javascript) section appears to not accept any format for variables.

Do you have any examples on how to add the variables set on a dashboard that pulls into the plugin?

Some examples I tried { hash: "$__hash" }

{ hash: "$hash" }

Aetrius commented 1 year ago

Basically I'm observing that the URL section does work, but I can't seem to apply variables from the dashboard. In addition, the Parameters (via Javascript) does not seem to pull in the variables as well.

Aetrius commented 1 year ago

Sample Parameter: -> This parameter work in the query URLs for Data links (urls) ${data.fields.hash} { hash: '${data.fields.hash}' }