mysql-connector: test MySQL data source during ds config
This commit is contained in:
12
dist/test/datasource-zabbix/datasource.js
vendored
12
dist/test/datasource-zabbix/datasource.js
vendored
@@ -392,6 +392,12 @@ var ZabbixAPIDatasource = function () {
|
||||
return this.zabbix.getVersion().then(function (version) {
|
||||
zabbixVersion = version;
|
||||
return _this5.zabbix.login();
|
||||
}).then(function () {
|
||||
if (_this5.enableDirectDBConnection) {
|
||||
return _this5.zabbix.dbConnector.testSQLDataSource();
|
||||
} else {
|
||||
return Promise.resolve();
|
||||
}
|
||||
}).then(function () {
|
||||
return {
|
||||
status: "success",
|
||||
@@ -405,6 +411,12 @@ var ZabbixAPIDatasource = function () {
|
||||
title: error.message,
|
||||
message: error.data
|
||||
};
|
||||
} else if (error.data && error.data.message) {
|
||||
return {
|
||||
status: "error",
|
||||
title: "Connection failed",
|
||||
message: error.data.message
|
||||
};
|
||||
} else {
|
||||
return {
|
||||
status: "error",
|
||||
|
||||
Reference in New Issue
Block a user