This commit is contained in:
Jesús Ángel González 2018-04-04 18:02:08 +02:00 committed by Jesús Ángel
parent a50fcb3918
commit 3b8ed0ce22
3 changed files with 5 additions and 3 deletions

View File

@ -152,7 +152,8 @@ app.controller('overviewController', function ($scope, $location, $rootScope, ap
// Switch tab // Switch tab
$scope.switchTab = tab => { $scope.switchTab = tab => {
if ($scope.tab === tab) return; if ($scope.tab === tab) return;
$rootScope.resultState = 'none'
// call backend to create visualizations // call backend to create visualizations
$rootScope.backFinished = false; $rootScope.backFinished = false;
genericReq.request('GET',`/api/wazuh-elastic/delete-vis/${$rootScope.visTimestamp}`) genericReq.request('GET',`/api/wazuh-elastic/delete-vis/${$rootScope.visTimestamp}`)
@ -173,6 +174,9 @@ app.controller('overviewController', function ($scope, $location, $rootScope, ap
$rootScope.backFinished = false; $rootScope.backFinished = false;
$location.search('tabView', $scope.tabView); $location.search('tabView', $scope.tabView);
if($scope.tabView === 'panels'){ if($scope.tabView === 'panels'){
// Update the implicit filter
if (tabFilters[$scope.tab].group === "") $rootScope.currentImplicitFilter = "";
else $rootScope.currentImplicitFilter = tabFilters[$scope.tab].group;
genericReq.request('GET',`/api/wazuh-elastic/delete-vis/${$rootScope.visTimestamp}`) genericReq.request('GET',`/api/wazuh-elastic/delete-vis/${$rootScope.visTimestamp}`)
.then(() => genericReq.request('GET',`/api/wazuh-elastic/create-vis/overview-${$scope.tab}/${$rootScope.visTimestamp}/${appState.getCurrentPattern()}`)) .then(() => genericReq.request('GET',`/api/wazuh-elastic/create-vis/overview-${$scope.tab}/${$rootScope.visTimestamp}/${appState.getCurrentPattern()}`))
.then(() => { .then(() => {

View File

@ -22,7 +22,6 @@ var app = require('ui/modules').get('apps/webinar_app', [])
let renderInProgress = false; let renderInProgress = false;
const myRender = function() { const myRender = function() {
console.log($rootScope.visTimestamp,$rootScope.resultState)
if ($rootScope.visTimestamp) { // Only render if we already have the timestamp for it if ($rootScope.visTimestamp) { // Only render if we already have the timestamp for it
if (($rootScope.discoverPendingUpdates && $rootScope.discoverPendingUpdates.length != 0) || $scope.visID.includes('Ruleset') ){ // There are pending updates from the discover (which is the one who owns the true app state) if (($rootScope.discoverPendingUpdates && $rootScope.discoverPendingUpdates.length != 0) || $scope.visID.includes('Ruleset') ){ // There are pending updates from the discover (which is the one who owns the true app state)

View File

@ -364,7 +364,6 @@ module.exports = (server, options) => {
const filtered = visSet.hits.total > 0 ? visSet.hits.hits.filter(vis => vis._id.includes(req.params.timestamp)) : []; const filtered = visSet.hits.total > 0 ? visSet.hits.hits.filter(vis => vis._id.includes(req.params.timestamp)) : [];
let promises = []; let promises = [];
for(let vis of filtered){ for(let vis of filtered){
console.log(`Deleting ${vis._id}...`);
let tmp = await elasticRequest.callWithInternalUser('deleteByQuery', { let tmp = await elasticRequest.callWithInternalUser('deleteByQuery', {
index: '.kibana', index: '.kibana',
body: { body: {