mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
BackendSrv: Queues data source requests but passes through api requests (#26947)
* Refactor: initial commit * wip * Refactor: getting into a simpler model * Refactor: adds some comments * Refactor: renames statuses according to PR comments * Refactor: adds more comments * Tests: adds tests for FetchQueue * Tests: adds tests for ResponseQueue * Tests: adds tests for FetchQueueWorker * Tests: simplified the tests for ResponseQueue * Refactor: adds http2 scenario * Refactor: using Cfg instead of global variable Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com> * Refactor: reverted change in frontendsettings.go * Tests: fix test mocks * Fix: changes how cfg.Protocol gets its value Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
This commit is contained in:
@@ -18,3 +18,19 @@ export function addQuery(queries: DataQuery[], query?: Partial<DataQuery>): Data
|
||||
q.refId = getNextRefIdChar(queries);
|
||||
return [...queries, q as DataQuery];
|
||||
}
|
||||
|
||||
export function isDataQuery(url: string): boolean {
|
||||
if (
|
||||
url.indexOf('api/datasources/proxy') !== -1 ||
|
||||
url.indexOf('api/tsdb/query') !== -1 ||
|
||||
url.indexOf('api/ds/query') !== -1
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
export function isLocalUrl(url: string) {
|
||||
return !url.match(/^http/);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user