mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
add separate datasource parameter withCredentials
This commit is contained in:
parent
6edd6c8f03
commit
8264c76642
@ -19,6 +19,7 @@ function (angular, _, moment, kbn, ElasticQueryBuilder, IndexPattern, ElasticRes
|
||||
function ElasticDatasource(datasource) {
|
||||
this.type = 'elasticsearch';
|
||||
this.basicAuth = datasource.basicAuth;
|
||||
this.withCredentials = datasource.withCredentials;
|
||||
this.url = datasource.url;
|
||||
this.name = datasource.name;
|
||||
this.index = datasource.index;
|
||||
@ -38,8 +39,10 @@ function (angular, _, moment, kbn, ElasticQueryBuilder, IndexPattern, ElasticRes
|
||||
data: data
|
||||
};
|
||||
|
||||
if (this.basicAuth) {
|
||||
if (this.basicAuth || this.withCredentials) {
|
||||
options.withCredentials = true;
|
||||
}
|
||||
if (this.basicAuth) {
|
||||
options.headers = {
|
||||
"Authorization": this.basicAuth
|
||||
};
|
||||
|
@ -23,6 +23,7 @@ function (angular, _, moment, dateMath) {
|
||||
this.url = datasource.url;
|
||||
this.directUrl = datasource.directUrl;
|
||||
this.basicAuth = datasource.basicAuth;
|
||||
this.withCredentials = datasource.withCredentials;
|
||||
this.lastErrors = {};
|
||||
}
|
||||
|
||||
@ -32,8 +33,10 @@ function (angular, _, moment, dateMath) {
|
||||
method: method
|
||||
};
|
||||
|
||||
if (this.basicAuth) {
|
||||
if (this.basicAuth || this.withCredentials) {
|
||||
options.withCredentials = true;
|
||||
}
|
||||
if (this.basicAuth) {
|
||||
options.headers = {
|
||||
"Authorization": this.basicAuth
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user