Skip to content

Commit

Permalink
#53 Sidplay an error message on analysis job failure
Browse files Browse the repository at this point in the history
  • Loading branch information
nadouani committed Dec 12, 2016
1 parent 07140be commit 7e13ade
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions ui/app/scripts/controllers/case/CaseObservablesItemCtrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@
$scope.updateField = function (fieldName, newValue) {
var field = {};
field[fieldName] = newValue;
console.log('update artifact field ' + fieldName + ':' + field[fieldName]);

return CaseArtifactSrv.api().update({
artifactId: $scope.artifact.id
}, field, function () {}, function (response) {
Expand All @@ -135,21 +135,21 @@
};

$scope.runAnalyzer = function (analyzerId) {
console.log('running analyzer ' + analyzerId + ' on artifact ' + $scope.artifact.id);
var artifactName = $scope.artifact.data || $scope.artifact.attachment.name;
return CortexSrv.createJob({
cortexId: 'local',
artifactId: $scope.artifact.id,
analyzerId: analyzerId
}, function () {}, function (response) {
AlertSrv.error('artifactDetails', response.data, response.status);
}).then(function () {
AlertSrv.log('Analyzer ' + analyzerId + ' has been successfully started for observable: ' + artifactName, 'success');
}, function (response) {
AlertSrv.log('Unable to run analyzer ' + analyzerId + ' for observable: ' + artifactName, 'error');
});
};

$scope.runAll = function() {
_.each($scope.analyzers, function(analyzer, id) {
if(analyzer.active === true) {
console.log('Bulk Run: ' + id);

$scope.runAnalyzer(id);
}
});
Expand Down

0 comments on commit 7e13ade

Please sign in to comment.