Skip to content

Commit

Permalink
#609 Add a modal to display responder reports
Browse files Browse the repository at this point in the history
  • Loading branch information
nadouani committed Jul 13, 2018
1 parent 705b6ac commit 6341f1c
Show file tree
Hide file tree
Showing 7 changed files with 50 additions and 1 deletion.
1 change: 1 addition & 0 deletions ui/app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@
<script src="scripts/controllers/case/ObservableCreationCtrl.js"></script>
<script src="scripts/controllers/case/ObservablesStatsCtrl.js"></script>
<script src="scripts/controllers/cortex/CortexInstanceDialogCtrl.js"></script>
<script src="scripts/controllers/cortex/ResponderActionDialogCtrl.js"></script>
<script src="scripts/controllers/dashboard/DashboardViewCtrl.js"></script>
<script src="scripts/controllers/dashboard/DashboardsCtrl.js"></script>
<script src="scripts/controllers/misc/ServerInstanceDialogCtrl.js"></script>
Expand Down
1 change: 1 addition & 0 deletions ui/app/scripts/controllers/case/CaseDetailsCtrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
}
]
},
sort: ['-startDate'],
pageSize: 100
});

Expand Down
1 change: 1 addition & 0 deletions ui/app/scripts/controllers/case/CaseObservablesItemCtrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@
}
]
},
sort: ['-startDate'],
pageSize: 100
});
};
Expand Down
1 change: 1 addition & 0 deletions ui/app/scripts/controllers/case/CaseTasksItemCtrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
}
]
},
sort: ['-startDate'],
pageSize: 100
});
};
Expand Down
16 changes: 16 additions & 0 deletions ui/app/scripts/controllers/cortex/ResponderActionDialogCtrl.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
(function() {
'use strict';
angular.module('theHiveControllers')
.controller('ResponderActionDialogCtrl', ResponderActionDialogCtrl);

function ResponderActionDialogCtrl($uibModalInstance, action) {
var self = this;

this.action = action;
this.report = (JSON.parse(action.report) || {}).full;

this.close = function() {
$uibModalInstance.dismiss();
};
}
})();
22 changes: 21 additions & 1 deletion ui/app/scripts/directives/responder-actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,27 @@
},
templateUrl: 'views/directives/responder-actions.html',
link: function(scope, el) {
console.log(scope);

},
controller: function($scope, $uibModal) {
$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;
}
}
});
};

$scope.close = function() {
$uibModalInstance.dismiss();
}
}
};
});
Expand Down
9 changes: 9 additions & 0 deletions ui/app/views/partials/cortex/responder-action-dialog.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<div class="modal-header bg-primary">
<h3 class="modal-title">Report of {{$dialog.action.responderName || $dialog.action.responderId}} responder</h3>
</div>
<div class="modal-body observable-report">
<pre>{{ $dialog.report | json}}</pre>
</div>
<div class="modal-footer text-left">
<button class="btn btn-primary pull-right" type="button" ng-click="$dialog.close()">Close</button>
</div>

0 comments on commit 6341f1c

Please sign in to comment.