diff --git a/frontend/app/index.html b/frontend/app/index.html index d419c6d6d0..4bc5afcf49 100644 --- a/frontend/app/index.html +++ b/frontend/app/index.html @@ -210,6 +210,7 @@ + diff --git a/frontend/app/scripts/directives/alert-duration.js b/frontend/app/scripts/directives/alert-duration.js new file mode 100644 index 0000000000..fbc90e06d5 --- /dev/null +++ b/frontend/app/scripts/directives/alert-duration.js @@ -0,0 +1,15 @@ +(function() { + 'use strict'; + angular.module('theHiveDirectives').directive('alertDuration', function() { + return { + restrict: 'E', + scope: { + start: '=', + end: '=', + icon: '@', + indicator: '=' + }, + templateUrl: 'views/directives/alert-duration.html' + }; + }); +})(); diff --git a/frontend/app/scripts/services/api/AlertingSrv.js b/frontend/app/scripts/services/api/AlertingSrv.js index 0d20782547..4d53efc81e 100644 --- a/frontend/app/scripts/services/api/AlertingSrv.js +++ b/frontend/app/scripts/services/api/AlertingSrv.js @@ -139,7 +139,8 @@ onUpdate: callback || undefined, operations: [ {'_name': 'listAlert'} - ] + ], + extraData: ['importDate'] }); }, diff --git a/frontend/app/views/directives/alert-duration.html b/frontend/app/views/directives/alert-duration.html new file mode 100644 index 0000000000..5a876f3de6 --- /dev/null +++ b/frontend/app/views/directives/alert-duration.html @@ -0,0 +1,8 @@ + + + {{indicator ? 'During ' : ''}}{{start | duration:end}} + + + {{start | duration}} {{indicator ? 'ago' : ''}} + + diff --git a/frontend/app/views/partials/alert/list.html b/frontend/app/views/partials/alert/list.html index b87e43732c..7ccef1b92e 100644 --- a/frontend/app/views/partials/alert/list.html +++ b/frontend/app/views/partials/alert/list.html @@ -136,6 +136,9 @@

List of alerts ({{$vm.list.total || 0}} of {{$vm.alertList {{::event.observableCount || 0}} {{event.date | shortDate}} +
+ +