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
$scope.switchTab = tab => {
if ($scope.tab === tab) return;
$rootScope.resultState = 'none'
// call backend to create visualizations
$rootScope.backFinished = false;
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;
$location.search('tabView', $scope.tabView);
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}`)
.then(() => genericReq.request('GET',`/api/wazuh-elastic/create-vis/overview-${$scope.tab}/${$rootScope.visTimestamp}/${appState.getCurrentPattern()}`))
.then(() => {

View File

@ -22,7 +22,6 @@ var app = require('ui/modules').get('apps/webinar_app', [])
let renderInProgress = false;
const myRender = function() {
console.log($rootScope.visTimestamp,$rootScope.resultState)
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)

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)) : [];
let promises = [];
for(let vis of filtered){
console.log(`Deleting ${vis._id}...`);
let tmp = await elasticRequest.callWithInternalUser('deleteByQuery', {
index: '.kibana',
body: {