mirror of
https://github.com/valitydev/wazuh-kibana-app.git
synced 2024-11-06 18:05:20 +00:00
Replaced if statement by a trace deletion on main controller
This commit is contained in:
parent
45e794f5c7
commit
c40dcb84d1
@ -285,6 +285,9 @@ app.controller('agentsController',
|
||||
if($scope.tab === 'configuration'){
|
||||
return $scope.getAgentConfig(newAgentId);
|
||||
}
|
||||
|
||||
// Deleting app state traces in the url
|
||||
$location.search('_a', null);
|
||||
let id = null;
|
||||
|
||||
// They passed an id
|
||||
|
@ -331,29 +331,6 @@ function discoverController(
|
||||
/////////////////////////////// WAZUH ///////////////////////////////////
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/** Start of "Prevents from double agent" */
|
||||
if($rootScope.agentsAutoCompleteFired){
|
||||
$rootScope.agentsAutoCompleteFired = false;
|
||||
if(!$rootScope.$$phase) $rootScope.$digest();
|
||||
let agentsIncluded = [];
|
||||
// Get all filters related to agent.id and store them on an array
|
||||
queryFilter.getFilters().filter(item => {
|
||||
if(item && item.query && item.query.match && typeof item.query.match['agent.id'] !== 'undefined') agentsIncluded.push(item);
|
||||
});
|
||||
// If the array has a length greater than 1 it means that there are more than one agent.id filter
|
||||
if(agentsIncluded.length > 1) {
|
||||
// Keep safe the last agent.id filter
|
||||
const lastAgent = agentsIncluded.pop();
|
||||
// Remove all the agent.id filters
|
||||
agentsIncluded.filter(item => queryFilter.removeFilter(item));
|
||||
// Add the safe kept agent.id filter
|
||||
queryFilter.addFilters(lastAgent);
|
||||
// Clear the temporary array
|
||||
agentsIncluded = [];
|
||||
}
|
||||
}
|
||||
/** End of "Prevents from double agent" */
|
||||
|
||||
$rootScope.discoverPendingUpdates = [];
|
||||
$rootScope.discoverPendingUpdates.push($state.query, queryFilter.getFilters());
|
||||
$rootScope.$broadcast('updateVis', $state.query, queryFilter.getFilters());
|
||||
|
Loading…
Reference in New Issue
Block a user