mysql-connector: test MySQL data source during ds config
This commit is contained in:
@@ -318,6 +318,13 @@ class ZabbixAPIDatasource {
|
||||
zabbixVersion = version;
|
||||
return this.zabbix.login();
|
||||
})
|
||||
.then(() => {
|
||||
if (this.enableDirectDBConnection) {
|
||||
return this.zabbix.dbConnector.testSQLDataSource();
|
||||
} else {
|
||||
return Promise.resolve();
|
||||
}
|
||||
})
|
||||
.then(() => {
|
||||
return {
|
||||
status: "success",
|
||||
@@ -332,6 +339,12 @@ class ZabbixAPIDatasource {
|
||||
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