mirror of
https://github.com/valitydev/wazuh-kibana-app.git
synced 2024-11-06 09:55:18 +00:00
Moved "hideWzMenu" to resolving section
This commit is contained in:
parent
06fd16edc1
commit
789bf1fd04
@ -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', () => {
|
||||
};
|
||||
}
|
||||
};
|
||||
});
|
||||
});
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
@ -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'
|
||||
});
|
||||
});
|
Loading…
Reference in New Issue
Block a user