mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Enable "With Credentials" for InfluxDB datasource (#6018)
This commit is contained in:
parent
52dc2db769
commit
e53b815956
@ -16,6 +16,7 @@ export default class InfluxDatasource {
|
||||
name: string;
|
||||
database: any;
|
||||
basicAuth: any;
|
||||
withCredentials: any;
|
||||
interval: any;
|
||||
supportAnnotations: boolean;
|
||||
supportMetrics: boolean;
|
||||
@ -33,6 +34,7 @@ export default class InfluxDatasource {
|
||||
this.name = instanceSettings.name;
|
||||
this.database = instanceSettings.database;
|
||||
this.basicAuth = instanceSettings.basicAuth;
|
||||
this.withCredentials = instanceSettings.withCredentials;
|
||||
this.interval = (instanceSettings.jsonData || {}).timeInterval;
|
||||
this.supportAnnotations = true;
|
||||
this.supportMetrics = true;
|
||||
@ -187,6 +189,9 @@ export default class InfluxDatasource {
|
||||
};
|
||||
|
||||
options.headers = options.headers || {};
|
||||
if (this.basicAuth || this.withCredentials) {
|
||||
options.withCredentials = true;
|
||||
}
|
||||
if (self.basicAuth) {
|
||||
options.headers.Authorization = self.basicAuth;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user