diff --git a/public/app.js b/public/app.js index f8cd42a2f..fd6df2e75 100644 --- a/public/app.js +++ b/public/app.js @@ -111,7 +111,6 @@ app.run(function($rootScope, $route, $location, appState, $window) { $rootScope.$on('$locationChangeSuccess', () => { const navigation = appState.getNavigation(); - $rootScope.hideWzMenu = navigation.currLocation === '/health-check'; appState.setNavigation({ currLocation: $location.path() }); if (navigation.currLocation !== navigation.prevLocation) { if (navigation.discoverSections.includes(navigation.currLocation)) { @@ -240,4 +239,4 @@ uiModules.get('kibana').provider('dashboardConfig', () => { }; } }; -}); +}); \ No newline at end of file diff --git a/public/services/resolves/settings-wizard.js b/public/services/resolves/settings-wizard.js index a35b01525..728a96c49 100644 --- a/public/services/resolves/settings-wizard.js +++ b/public/services/resolves/settings-wizard.js @@ -198,7 +198,6 @@ export function settingsWizard( genericReq .request('GET', '/elastic/apis') .then(data => { - appState.setWzMenu(); if (data.data.length > 0) { const apiEntries = data.data; appState.setCurrentAPI( @@ -229,7 +228,6 @@ export function settingsWizard( genericReq .request('GET', '/elastic/apis') .then(data => { - appState.setWzMenu(); if ( data.data.length > 0 && data.data.find(x => x['_id'] == apiId) @@ -259,8 +257,9 @@ export function settingsWizard( }); } } + appState.setWzMenu(); return deferred.promise; } catch (error) { !disableErrors && errorHandler.handle(error); } -} +} \ No newline at end of file diff --git a/public/services/routes.js b/public/services/routes.js index b3bbd45de..481271e53 100644 --- a/public/services/routes.js +++ b/public/services/routes.js @@ -128,6 +128,10 @@ function wzConfig($q, genericReq, wazuhConfig, $rootScope, $location) { function wzKibana($location, $window, $rootScope) { assignPreviousLocation($rootScope, $location); + // Sets ?_a=(columns:!(_source),filters:!()) + $location.search('_a', '(columns:!(_source),filters:!())'); + // Removes ?_g + $location.search('_g', null); return goToKibana($location, $window); } @@ -136,6 +140,11 @@ function clearRuleId(commonData) { return Promise.resolve(); } +function enableWzMenu($rootScope, $location) { + const location = $location.path(); + $rootScope.hideWzMenu = location.includes('/health-check'); +} + //Routes routes.enable(); routes @@ -145,27 +154,27 @@ routes }) .when('/agents/:id?/:tab?/:view?', { template: agentsTemplate, - resolve: { nestedResolve, ip, savedSearch } + resolve: { enableWzMenu, nestedResolve, ip, savedSearch } }) .when('/agents-preview/', { template: agentsPrevTemplate, - resolve: { nestedResolve, ip, savedSearch } + resolve: { enableWzMenu, nestedResolve, ip, savedSearch } }) .when('/manager/', { template: managementTemplate, - resolve: { nestedResolve, ip, savedSearch, clearRuleId } + resolve: { enableWzMenu, nestedResolve, ip, savedSearch, clearRuleId } }) .when('/overview/', { template: overviewTemplate, - resolve: { nestedResolve, ip, savedSearch } + resolve: { enableWzMenu, nestedResolve, ip, savedSearch } }) .when('/wazuh-discover/', { template: discoverTemplate, - resolve: { nestedResolve, ip, savedSearch } + resolve: { enableWzMenu, nestedResolve, ip, savedSearch } }) .when('/settings', { template: settingsTemplate, - resolve: { nestedResolve, ip, savedSearch } + resolve: { enableWzMenu, nestedResolve, ip, savedSearch } }) .when('/visualize/create?', { redirectTo: function() {}, @@ -181,11 +190,11 @@ routes }) .when('/wazuh-dev', { template: devToolsTemplate, - resolve: { nestedResolve } + resolve: { enableWzMenu, nestedResolve } }) .when('/blank-screen', { template: blankScreenTemplate, - resolve: { wzConfig } + resolve: { enableWzMenu, wzConfig } }) .when('/', { redirectTo: '/overview/' @@ -195,4 +204,4 @@ routes }) .otherwise({ redirectTo: '/overview' - }); + }); \ No newline at end of file