mirror of
https://github.com/valitydev/wazuh-kibana-app.git
synced 2024-11-07 02:15:24 +00:00
Sending event from table to groups controller
This commit is contained in:
parent
f77b06d726
commit
895d960cdd
@ -128,6 +128,10 @@ export function GroupsController(
|
||||
return $scope.showFile(parameters.groupName, parameters.fileName);
|
||||
});
|
||||
|
||||
$scope.$on('updateGroupInformation', (event, parameters) => {
|
||||
console.log('Event updateGroupInformation received');
|
||||
});
|
||||
|
||||
$scope.goBackToAgents = () => {
|
||||
$scope.groupsSelectedTab = 'agents';
|
||||
$scope.file = false;
|
||||
|
@ -256,21 +256,29 @@ app.directive('wzTable', function() {
|
||||
|
||||
$scope.showConfirm = function(ev, agent) {
|
||||
const group = instance.path.split('/').pop();
|
||||
// Appending dialog to document.body to cover sidenav in docs app
|
||||
var confirm = $mdDialog.confirm()
|
||||
|
||||
const confirm = $mdDialog
|
||||
.confirm()
|
||||
.title(`Delete agent ${agent.id} from group ${group}?`)
|
||||
.targetEvent(ev)
|
||||
.ok('Agree')
|
||||
.cancel('Cancel');
|
||||
|
||||
$mdDialog.show(confirm).then(() => {
|
||||
groupHandler.removeAgentFromGroup(group, agent.id).then(()=> init()).catch(error => errorHandler.handle(
|
||||
$mdDialog.show(confirm).then(
|
||||
() => {
|
||||
groupHandler
|
||||
.removeAgentFromGroup(group, agent.id)
|
||||
.then(() => init())
|
||||
.then(() => $scope.$emit('updateGroupInformation', { group }))
|
||||
.catch(error =>
|
||||
errorHandler.handle(
|
||||
error.message || error,
|
||||
'Error removing agent from group'
|
||||
))
|
||||
}, () => {
|
||||
|
||||
});
|
||||
)
|
||||
);
|
||||
},
|
||||
() => {}
|
||||
);
|
||||
};
|
||||
},
|
||||
template
|
||||
|
Loading…
Reference in New Issue
Block a user