From 2b41bd166dd8b40da8c7ff2944caa4273bc709d1 Mon Sep 17 00:00:00 2001 From: Nabil Adouani Date: Wed, 29 Apr 2020 11:39:48 +0200 Subject: [PATCH] #1293 Display responder action error messages when an job fails --- frontend/app/scripts/directives/responder-actions.js | 8 +++++++- frontend/app/styles/case.css | 10 ++++++++++ frontend/app/styles/dashboard.css | 6 +++--- frontend/app/views/directives/responder-actions.html | 11 +++++++++-- 4 files changed, 29 insertions(+), 6 deletions(-) diff --git a/frontend/app/scripts/directives/responder-actions.js b/frontend/app/scripts/directives/responder-actions.js index 0904af5269..2620ae5133 100644 --- a/frontend/app/scripts/directives/responder-actions.js +++ b/frontend/app/scripts/directives/responder-actions.js @@ -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, diff --git a/frontend/app/styles/case.css b/frontend/app/styles/case.css index 9caab9d482..ba05d2c643 100644 --- a/frontend/app/styles/case.css +++ b/frontend/app/styles/case.css @@ -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; +} diff --git a/frontend/app/styles/dashboard.css b/frontend/app/styles/dashboard.css index d4b4791c5d..3b5c249161 100644 --- a/frontend/app/styles/dashboard.css +++ b/frontend/app/styles/dashboard.css @@ -157,9 +157,9 @@ dashboard-item .box { .dashboard-period > div{ height: 34px; - display:flex; - justify-content:flex-start; - align-items:stretch; + display: flex; + justify-content: flex-start; + align-items: stretch; } .dashboard-period .label{ diff --git a/frontend/app/views/directives/responder-actions.html b/frontend/app/views/directives/responder-actions.html index c2d7627c66..ff6c35c586 100644 --- a/frontend/app/views/directives/responder-actions.html +++ b/frontend/app/views/directives/responder-actions.html @@ -13,16 +13,23 @@

{{header}}

- {{action.status}} - {{action.responderName}} + +
{{action.responderName}}
+
+ {{action.showError ? 'Hide' : 'Show'}} error +
{{action.errorMessage}}
+
+ {{action.cortexId}} {{action.startDate | shortDate}} +