InfluxDB: support for basic authorization (PR #782)
This commit is contained in:
@@ -19,6 +19,7 @@ function (angular, _, kbn, InfluxSeries, InfluxQueryBuilder) {
|
|||||||
this.username = datasource.username;
|
this.username = datasource.username;
|
||||||
this.password = datasource.password;
|
this.password = datasource.password;
|
||||||
this.name = datasource.name;
|
this.name = datasource.name;
|
||||||
|
this.basicAuth = datasource.basicAuth;
|
||||||
|
|
||||||
this.saveTemp = _.isUndefined(datasource.save_temp) ? true : datasource.save_temp;
|
this.saveTemp = _.isUndefined(datasource.save_temp) ? true : datasource.save_temp;
|
||||||
this.saveTempTTL = _.isUndefined(datasource.save_temp_ttl) ? '30d' : datasource.save_temp_ttl;
|
this.saveTempTTL = _.isUndefined(datasource.save_temp_ttl) ? '30d' : datasource.save_temp_ttl;
|
||||||
@@ -170,6 +171,11 @@ function (angular, _, kbn, InfluxSeries, InfluxQueryBuilder) {
|
|||||||
inspect: { type: 'influxdb' },
|
inspect: { type: 'influxdb' },
|
||||||
};
|
};
|
||||||
|
|
||||||
|
options.headers = options.headers || {};
|
||||||
|
if (_this.basicAuth) {
|
||||||
|
options.headers.Authorization = 'Basic ' + _this.basicAuth;
|
||||||
|
}
|
||||||
|
|
||||||
return $http(options).success(function (data) {
|
return $http(options).success(function (data) {
|
||||||
deferred.resolve(data);
|
deferred.resolve(data);
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user