From 5a295a0699a24fdcefd720dd3c034df58379295f Mon Sep 17 00:00:00 2001 From: Pedro S Date: Tue, 20 Sep 2016 16:16:44 +0200 Subject: [PATCH] Update overview.js --- public/controllers/overview.js | 34 ++++++++++++++++++++++++++-------- 1 file changed, 26 insertions(+), 8 deletions(-) diff --git a/public/controllers/overview.js b/public/controllers/overview.js index 4d9ee0b40..8783ed926 100644 --- a/public/controllers/overview.js +++ b/public/controllers/overview.js @@ -142,22 +142,40 @@ app.controller('overviewFimController', function ($scope, DataFactory, genericRe var date = new Date(); date.setDate(date.getDate() - daysAgo); var timeAgo = date.getTime(); - genericReq.request('GET', '/api/wazuh-elastic/top/srcuser/' + timeAgo) + + // Top fields + genericReq.request('GET', '/api/wazuh-elastic/top/AgentName/'+timeAgo) .then(function (data) { - $scope.topsrcuser = data.data; + $scope.topagent = data.data; }, printError); - genericReq.request('GET', '/api/wazuh-elastic/top/srcip/' + timeAgo) + genericReq.request('GET', '/api/wazuh-elastic/top/SyscheckFile.perm_before/'+timeAgo) .then(function (data) { - $scope.topsrcip = data.data; - }, printError); - genericReq.request('GET', '/api/wazuh-elastic/top/rule.groups/' + timeAgo) - .then(function (data) { - $scope.topgroup = data.data; + $scope.toppermissions = data.data; }, printError); genericReq.request('GET', '/api/wazuh-elastic/top/rule.PCI_DSS/' + timeAgo) .then(function (data) { $scope.toppci = data.data; }, printError); + + // Last fields + + genericReq.request('GET', '/api/wazuh-elastic/last/SyscheckFile/SyscheckFile.event/modified') + .then(function (data) { + if(data.data != "") + $scope.last_file_changed = (data.data != "") ? data.data.path : "(no data)"; + }, printError); + + genericReq.request('GET', '/api/wazuh-elastic/last/SyscheckFile/SyscheckFile.event/addded') + .then(function (data) { + $scope.last_file_added = (data.data != "") ? data.data.path : "(no data)"; + }, printError); + + genericReq.request('GET', '/api/wazuh-elastic/last/SyscheckFile/SyscheckFile.event/deleted') + .then(function (data) { + if(data.data != "") + $scope.last_file_deleted = (data.data != "") ? data.data.path : "(no data)"; + }, printError); + }; var load = function () {