Merge branch 'master' into refactor

This commit is contained in:
Alexander Zobnin
2018-06-08 13:24:17 +03:00
29 changed files with 263 additions and 1266 deletions

View File

@@ -28,7 +28,7 @@ class ZabbixAPIDatasource {
this.basicAuth = instanceSettings.basicAuth;
this.withCredentials = instanceSettings.withCredentials;
const jsonData = instanceSettings.jsonData;
const jsonData = instanceSettings.jsonData || {};
// Zabbix API credentials
this.username = jsonData.username;
@@ -48,6 +48,9 @@ class ZabbixAPIDatasource {
this.addThresholds = jsonData.addThresholds;
this.alertingMinSeverity = jsonData.alertingMinSeverity || c.SEV_WARNING;
// Other options
this.disableReadOnlyUsersAck = jsonData.disableReadOnlyUsersAck;
// Direct DB Connection options
let dbConnectionOptions = jsonData.dbConnection || {};
this.enableDirectDBConnection = dbConnectionOptions.enable;
@@ -206,11 +209,7 @@ class ZabbixAPIDatasource {
return getHistoryPromise
.then(timeseries => this.applyDataProcessingFunctions(timeseries, target))
.then(timeseries => downsampleSeries(timeseries, options))
.catch(error => {
console.log(error);
return [];
});
.then(timeseries => downsampleSeries(timeseries, options));
}
getTrendValueType(target) {