Added new extensions on more controllers

This commit is contained in:
Juanjo Jiménez 2018-01-23 12:52:02 +01:00
parent 0352b33687
commit 51c65caf06
3 changed files with 27 additions and 13 deletions

View File

@ -62,6 +62,12 @@ function ($scope, $location, $q, $rootScope, Notifier, appState, genericReq, api
},
"pci": {
"group": "pci_dss"
},
"aws": {
"group": "amazon"
},
"virustotal": {
"group": "virustotal"
}
};
@ -276,8 +282,8 @@ function ($scope, $location, $q, $rootScope, Notifier, appState, genericReq, api
// They passed an id
if (newAgentId) {
$location.search('agent', newAgentId);
}
}
};
$scope.getAgentConfig = newAgentId => {
@ -291,7 +297,7 @@ function ($scope, $location, $q, $rootScope, Notifier, appState, genericReq, api
$location.search('tab', 'groups');
$location.path('/manager');
};
const firstLoad = async () => {
try{
$scope.configurationError = false;
@ -309,7 +315,7 @@ function ($scope, $location, $q, $rootScope, Notifier, appState, genericReq, api
$scope.groupName = $scope.agent.group;
if(!$scope.groupName){
$scope.configurationError = true;
$scope.load = false;
if($scope.agent.id === '000'){
@ -330,7 +336,7 @@ function ($scope, $location, $q, $rootScope, Notifier, appState, genericReq, api
apiReq.request('GET', `/agents/groups/${$scope.groupName}`, {})
]);
let filtered = data[0].data.data.items.filter(item => item.name === $scope.groupName);
$scope.groupMergedSum = (filtered.length) ? filtered[0].merged_sum : 'Unknown';
@ -346,5 +352,5 @@ function ($scope, $location, $q, $rootScope, Notifier, appState, genericReq, api
}
}
/** End of agent configuration */
});

View File

@ -5,7 +5,7 @@ app.controller('overviewController', function ($scope, $location, $rootScope, ap
$rootScope.page = 'overview';
$scope.extensions = appState.getExtensions().extensions;
// Check the url hash and retriew the tabView information
// Check the url hash and retriew the tabView information
if ($location.search().tabView) {
$scope.tabView = $location.search().tabView;
} else { // If tabView doesn't exist, default it to 'panels' view
@ -13,7 +13,7 @@ app.controller('overviewController', function ($scope, $location, $rootScope, ap
$location.search('tabView', 'panels');
}
// Check the url hash and retrivew the tab information
// Check the url hash and retrivew the tab information
if ($location.search().tab) {
$scope.tab = $location.search().tab;
} else { // If tab doesn't exist, default it to 'general' view
@ -57,6 +57,12 @@ app.controller('overviewController', function ($scope, $location, $rootScope, ap
},
"pci": {
"group": "pci_dss"
},
"aws": {
"group": "amazon"
},
"virustotal": {
"group": "virustotal"
}
};
@ -91,7 +97,7 @@ app.controller('overviewController', function ($scope, $location, $rootScope, ap
if (tabFilters[$scope.tab].group === "") $rootScope.currentImplicitFilter = "";
else $rootScope.currentImplicitFilter = tabFilters[$scope.tab].group;
});
$scope.$on('$destroy',() => {
for(let h of $rootScope.ownHandlers){
h._scope.$destroy();
@ -115,4 +121,4 @@ app.controller('overviewController', function ($scope, $location, $rootScope, ap
$scope.tabs = tabs;
$scope.selectedIndex = 0;
});
});

View File

@ -8,9 +8,11 @@ require('ui/modules').get('app/wazuh', []).service('appState', function ($cookie
if(typeof data.extensions === 'undefined'){
return {
extensions : {
audit: true,
pci : true,
oscap: true
audit : true,
pci : true,
oscap : true,
aws : true,
virustotal: true
}
}
}