mail: add js code to get eventlog
This commit is contained in:
@@ -10,12 +10,38 @@ angular.module('Application').controller('EmailsController', ['$scope', '$locati
|
||||
$scope.config = Client.getConfig();
|
||||
$scope.domains = [];
|
||||
|
||||
$scope.activity = {
|
||||
eventlogs: [],
|
||||
currentPage: 1,
|
||||
perPage: 20,
|
||||
|
||||
fetchEventLogs: function () {
|
||||
Client.getMailEventLogs($scope.activity.currentPage, $scope.activity.perPage, function (error, result) {
|
||||
if (error) return console.error(error);
|
||||
$scope.activity.eventlogs = result;
|
||||
});
|
||||
},
|
||||
|
||||
showNextPage: function () {
|
||||
$scope.activity.currentPage++;
|
||||
$scope.activity.fetchEventLogs();
|
||||
},
|
||||
|
||||
showPrevPage: function () {
|
||||
if ($scope.activity.currentPage > 1) $scope.activity.currentPage--;
|
||||
else $scope.activity.currentPage = 1;
|
||||
$scope.activity.fetchEventLogs();
|
||||
}
|
||||
};
|
||||
|
||||
Client.onReady(function () {
|
||||
Client.getDomains(function (error, domains) {
|
||||
if (error) return console.error('Unable to get domain listing.', error);
|
||||
|
||||
$scope.domains = domains;
|
||||
$scope.ready = true;
|
||||
|
||||
$scope.activity.fetchEventLogs();
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user