Skip to content

Commit

Permalink
#962 Display responder job errors
Browse files Browse the repository at this point in the history
  • Loading branch information
nadouani committed Apr 24, 2020
1 parent 7fd7058 commit a1a575e
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 3 deletions.
8 changes: 7 additions & 1 deletion ui/app/scripts/directives/responder-actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,14 @@
actions: '=',
header: '@'
},
templateUrl: 'views/directives/responder-actions.html',
templateUrl: 'views/directives/responder-actions.html',
controller: function($scope, $uibModal) {
_.each($scope.actions.values, function(action) {
if(action.status === 'Failure') {
action.errorMessage = (JSON.parse(action.report) || {}).errorMessage;
}
});

$scope.showResponderJob = function(action) {
$uibModal.open({
scope: $scope,
Expand Down
10 changes: 10 additions & 0 deletions ui/app/styles/case.css
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,13 @@ table.case-list .case-tags .label,
font-size: 12px !important;
font-weight: normal;
}

pre.error-trace {
color: #a94442;
border: none;
font-size: 10px;
word-wrap: break-word;
word-break: break-all;
white-space: pre-wrap;
background-color: #f9f1f1;
}
11 changes: 9 additions & 2 deletions ui/app/views/directives/responder-actions.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,18 @@ <h4 class="text-primary">{{header}}</h4>
'InProgress': 'label-warning',
'Failure': 'label-danger'}[action.status]">{{action.status}}</span>
</td>
<td>{{action.responderName}}</td>
<td>
<div>{{action.responderName}}</div>
<div ng-if="action.status === 'Failure'" class="text-danger wrap mt-xxs">
<a class="text-danger" href
ng-click="action.showError = !!!action.showError">{{action.showError ? 'Hide' : 'Show'}} error</a>
<pre ng-show="action.showError" class="error-trace">{{action.errorMessage}}</pre>
</div>
</td>
<td>{{action.cortexId}}</td>
<td>{{action.startDate | shortDate}}</td>
<td class="text-center">
<a href class="noline" ng-click="showResponderJob(action)"><i class="fa fa-search"></i></a>
<a ng-if="action.status !== 'Failure'" href class="noline" ng-click="showResponderJob(action)" uib-tooltip="Show action report" tooltip-placement="left-middle"><i class="fa fa-search"></i></a>
</td>
</tr>
</tbody>
Expand Down

0 comments on commit a1a575e

Please # to comment.