mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Canvas: Support template variables in base URL of actions (#91227)
This commit is contained in:
parent
0a34b51055
commit
a71dfd3109
@ -12,7 +12,8 @@ type IsLoadingCallback = (loading: boolean) => void;
|
||||
export const callApi = (api: APIEditorConfig, updateLoadingStateCallback?: IsLoadingCallback) => {
|
||||
if (api && api.endpoint) {
|
||||
// If API endpoint origin matches Grafana origin, don't call it.
|
||||
if (requestMatchesGrafanaOrigin(api.endpoint)) {
|
||||
const interpolatedUrl = interpolateVariables(api.endpoint);
|
||||
if (requestMatchesGrafanaOrigin(interpolatedUrl)) {
|
||||
appEvents.emit(AppEvents.alertError, ['Cannot call API at Grafana origin.']);
|
||||
updateLoadingStateCallback && updateLoadingStateCallback(false);
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user