wazuh-kibana-app/public/controllers/osseclog.js

20 lines
662 B
JavaScript

let app = require('ui/modules').get('app/wazuh', []);
// Logs controller
app.controller('managerLogController', function ($scope, Logs, apiReq,Notifier) {
const notify = new Notifier({ location: 'Manager - Logs' });
$scope.searchTerm = '';
$scope.loading = true;
$scope.logs = Logs;
$scope.logs.nextPage('')
.then(() => apiReq.request('GET', '/manager/logs/summary', {}))
.then(data => {
$scope.summary = data.data.data;
$scope.loading = false;
})
.catch(error => notify.error(error.message));
// Resetting the factory configuration
$scope.$on("$destroy", () => $scope.logs.reset());
});