mirror of
https://github.com/valitydev/redash.git
synced 2024-11-07 01:25:16 +00:00
Fix the way we were calling the test API -
Previously it was overriding the content of $scope.dataSource and resulting in a broken form. Also updated the messages.
This commit is contained in:
parent
37a02bfe37
commit
8464d8c64a
@ -37,15 +37,15 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
$scope.test = function () {
|
$scope.test = function () {
|
||||||
$scope.dataSource.$test(function (httpResponse) {
|
DataSource.test({id: $scope.dataSource.id}, function (httpResponse) {
|
||||||
if (httpResponse.ok) {
|
if (httpResponse.ok) {
|
||||||
growl.addSuccessMessage("Connection test successful.");
|
growl.addSuccessMessage('<i class="fa fa-check-circle"></i> <strong>Success.</strong>', {enableHtml: true, ttl: 3000});
|
||||||
} else {
|
} else {
|
||||||
growl.addErrorMessage("Connection test" + httpResponse.msg);
|
growl.addErrorMessage('<i class="fa fa-exclamation-triangle"></i> <strong>Connection Test Failed:</strong><br/>' + httpResponse.message, {enableHtml: true, ttl: -1});
|
||||||
}
|
}
|
||||||
}, function (httpResponse) {
|
}, function (httpResponse) {
|
||||||
console.log("Failed to test data source: ", httpResponse.status, httpResponse.statusText, httpResponse);
|
console.log("Failed to test data source: ", httpResponse.status, httpResponse.statusText, httpResponse);
|
||||||
growl.addErrorMessage("Failed to test data source.");
|
growl.addErrorMessage('<i class="fa fa-exclamation-triangle"></i> <strong> Unknown error occurred while performing connection test. Please try again later.', {enableHtml: true, ttl: -1});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user