Skip to content

Commit

Permalink
#1410 Use StreamQuerySrv for case stats that build the case list quic…
Browse files Browse the repository at this point in the history
… filters menu
  • Loading branch information
nadouani committed Jul 22, 2020
1 parent 8ffb94b commit 14c9396
Showing 1 changed file with 23 additions and 5 deletions.
28 changes: 23 additions & 5 deletions frontend/app/scripts/controllers/case/CaseListCtrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
angular.module('theHiveControllers')
.controller('CaseListCtrl', CaseListCtrl);

function CaseListCtrl($scope, $q, $state, $window, $uibModal, FilteringSrv, SecuritySrv, StreamStatSrv, PaginatedQuerySrv, EntitySrv, CaseSrv, UserSrv, AuthenticationSrv, CaseResolutionStatus, NotificationSrv, Severity, Tlp, CortexSrv) {
function CaseListCtrl($scope, $q, $state, $window, $uibModal, StreamQuerySrv, FilteringSrv, SecuritySrv, StreamStatSrv, PaginatedQuerySrv, EntitySrv, CaseSrv, UserSrv, AuthenticationSrv, CaseResolutionStatus, NotificationSrv, Severity, Tlp, CortexSrv) {
var self = this;

this.openEntity = EntitySrv.open;
Expand Down Expand Up @@ -48,13 +48,31 @@
});
});

this.caseStats = StreamStatSrv({

StreamQuerySrv('v1', [
{
"_name": "listCase"
},
{
"_name": "aggregation",
"_agg": "field",
"_field": "status",
"_select": [
{"_agg": "count"}
]
}
], {
scope: $scope,
rootId: 'any',
query: {},
result: {},
objectType: 'case',
field: 'status'
query: {
params: {
name: "case-status-stats"
}
},
onUpdate: function(updates) {
self.caseStats = updates;
}
});
};

Expand Down

0 comments on commit 14c9396

Please sign in to comment.