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;
|
name: string;
|
||||||
database: any;
|
database: any;
|
||||||
basicAuth: any;
|
basicAuth: any;
|
||||||
|
withCredentials: any;
|
||||||
interval: any;
|
interval: any;
|
||||||
supportAnnotations: boolean;
|
supportAnnotations: boolean;
|
||||||
supportMetrics: boolean;
|
supportMetrics: boolean;
|
||||||
@ -33,6 +34,7 @@ export default class InfluxDatasource {
|
|||||||
this.name = instanceSettings.name;
|
this.name = instanceSettings.name;
|
||||||
this.database = instanceSettings.database;
|
this.database = instanceSettings.database;
|
||||||
this.basicAuth = instanceSettings.basicAuth;
|
this.basicAuth = instanceSettings.basicAuth;
|
||||||
|
this.withCredentials = instanceSettings.withCredentials;
|
||||||
this.interval = (instanceSettings.jsonData || {}).timeInterval;
|
this.interval = (instanceSettings.jsonData || {}).timeInterval;
|
||||||
this.supportAnnotations = true;
|
this.supportAnnotations = true;
|
||||||
this.supportMetrics = true;
|
this.supportMetrics = true;
|
||||||
@ -187,6 +189,9 @@ export default class InfluxDatasource {
|
|||||||
};
|
};
|
||||||
|
|
||||||
options.headers = options.headers || {};
|
options.headers = options.headers || {};
|
||||||
|
if (this.basicAuth || this.withCredentials) {
|
||||||
|
options.withCredentials = true;
|
||||||
|
}
|
||||||
if (self.basicAuth) {
|
if (self.basicAuth) {
|
||||||
options.headers.Authorization = self.basicAuth;
|
options.headers.Authorization = self.basicAuth;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user