-
Notifications
You must be signed in to change notification settings - Fork 623
/
responder-actions.js
44 lines (40 loc) · 1.45 KB
/
responder-actions.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
(function() {
'use strict';
angular.module('theHiveDirectives').directive('responderActions', function() {
return {
restrict: 'E',
replace: true,
scope: {
actions: '=',
header: '@'
},
templateUrl: 'views/directives/responder-actions.html',
controller: function($scope, $uibModal) {
$scope.$watch('actions', function(list) {
if(!list) {
return;
}
_.each(list.values, function(action) {
if (action.status === 'Failure') {
action.errorMessage = (JSON.parse(action.report) || {}).errorMessage;
}
});
});
$scope.showResponderJob = function(action) {
$uibModal.open({
scope: $scope,
templateUrl: 'views/partials/cortex/responder-action-dialog.html',
controller: 'ResponderActionDialogCtrl',
controllerAs: '$dialog',
size: 'max',
resolve: {
action: function() {
return action;
}
}
});
};
}
};
});
})();