mirror of
https://github.com/valitydev/wazuh-kibana-app.git
synced 2024-11-06 18:05:20 +00:00
Added new function to go groups, added array of groups
This commit is contained in:
parent
0c2c72bbe1
commit
2d7c24898f
@ -6,7 +6,7 @@ app.controller('agentsPreviewController', function ($scope,$rootScope, genericRe
|
||||
$scope.status = 'all';
|
||||
$scope.osPlatform = 'all';
|
||||
$scope.osPlatforms = [];
|
||||
|
||||
$scope.groups = [];
|
||||
$scope.mostActiveAgent = {
|
||||
name: '',
|
||||
id : ''
|
||||
@ -25,6 +25,11 @@ app.controller('agentsPreviewController', function ($scope,$rootScope, genericRe
|
||||
$scope.agents.filters = [];
|
||||
if(filter.includes('Unknown')){
|
||||
$scope.agents.addFilter('status','Never connected');
|
||||
|
||||
/** Pending API implementation */
|
||||
//} else if(filter.includes('group-')){
|
||||
// $scope.agents.addFilter('group',filter.split('group-')[1]);
|
||||
|
||||
} else {
|
||||
const platform = filter.split(' - ')[0];
|
||||
const version = filter.split(' - ')[1];
|
||||
@ -38,7 +43,7 @@ app.controller('agentsPreviewController', function ($scope,$rootScope, genericRe
|
||||
// Retrieve os list
|
||||
const retrieveList = agents => {
|
||||
for(let agent of agents){
|
||||
|
||||
if(agent.group && !$scope.groups.includes(agent.group)) $scope.groups.push(agent.group);
|
||||
if('os' in agent && 'name' in agent.os){
|
||||
let exists = $scope.osPlatforms.filter((e) => e.name === agent.os.name && e.platform === agent.os.platform && e.version === agent.os.version);
|
||||
if(!exists.length){
|
||||
@ -103,6 +108,13 @@ app.controller('agentsPreviewController', function ($scope,$rootScope, genericRe
|
||||
}
|
||||
};
|
||||
|
||||
$scope.goGroup = agent => {
|
||||
$rootScope.globalAgent = agent;
|
||||
$rootScope.comeFrom = 'agents';
|
||||
$location.search('tab', 'groups');
|
||||
$location.path('/manager');
|
||||
};
|
||||
|
||||
$scope.showAgent = agent => {
|
||||
$rootScope.globalAgent = agent.id;
|
||||
$rootScope.comeFrom = 'agentsPreview';
|
||||
|
Loading…
Reference in New Issue
Block a user