diff --git a/frontend/app/index.html b/frontend/app/index.html index dc172a5f24..5460192e47 100644 --- a/frontend/app/index.html +++ b/frontend/app/index.html @@ -133,11 +133,13 @@ + + diff --git a/frontend/app/scripts/components/charts/donut-chart.component.js b/frontend/app/scripts/components/charts/donut-chart.component.js new file mode 100644 index 0000000000..909d394faa --- /dev/null +++ b/frontend/app/scripts/components/charts/donut-chart.component.js @@ -0,0 +1,56 @@ +(function() { + 'use strict'; + + angular.module('theHiveComponents') + .component('donutChart', { + controller: function($scope) { + var self = this; + + this.$onInit = function() { + $scope.$watch('$cmp.data', function (data) { + self.updateChart(data); + }); + }; + + this.updateChart = function(rawData) { + this.error = false; + + var data = _.map(rawData, function(item) { + return [item.key, item.count]; + }); + + this.chart = { + data: { + columns: data, + names: self.labels || undefined, + type: 'donut', + onclick: function(d) { + if(self.onItemClicked) { + self.onItemClicked({ + value: d.id + }); + } + } + }, + donut: { + label: { + show: false + } + }, + legend: { + position: 'right' + } + }; + }; + }, + controllerAs: '$cmp', + template: '', + bindings: { + data: '<', + labels: '<', + title: '@', + field: '@', + onItemClicked: '&' + } + }); +})(); diff --git a/frontend/app/scripts/components/list/stats-item.component.js b/frontend/app/scripts/components/list/stats-item.component.js new file mode 100644 index 0000000000..1e7dedb8f9 --- /dev/null +++ b/frontend/app/scripts/components/list/stats-item.component.js @@ -0,0 +1,28 @@ +(function() { + 'use strict'; + angular.module('theHiveComponents') + .component('statsItem', { + controller: function() { + var self = this; + + this.onClick = function(value) { + self.onItemClicked({ + field: self.field, + value: self.values ? self.values[value] : value + }); + }; + }, + controllerAs: '$cmp', + templateUrl: 'views/components/list/stats-item.component.html', + replace: true, + bindings: { + field: '@', + title: '@', + data: '<', + mode: '<', + labels: '<', + values: '<', + onItemClicked: '&' + } + }); +})(); diff --git a/frontend/app/scripts/controllers/alert/AlertStatsCtrl.js b/frontend/app/scripts/controllers/alert/AlertStatsCtrl.js index 4883fb8ff1..a05d92b580 100644 --- a/frontend/app/scripts/controllers/alert/AlertStatsCtrl.js +++ b/frontend/app/scripts/controllers/alert/AlertStatsCtrl.js @@ -14,6 +14,16 @@ this.byStatus = {}; this.byTags = {}; + this.readAlerts = { + 'true': 'Read', + 'false': 'Unread' + }; + + this.readValues = { + 'true': true, + 'false': false + }; + self.$onInit = function() { // Get stats by tags diff --git a/frontend/app/scripts/controllers/case/ObservablesStatsCtrl.js b/frontend/app/scripts/controllers/case/ObservablesStatsCtrl.js index 59a22251af..e48194916b 100644 --- a/frontend/app/scripts/controllers/case/ObservablesStatsCtrl.js +++ b/frontend/app/scripts/controllers/case/ObservablesStatsCtrl.js @@ -12,6 +12,16 @@ this.byIoc = {}; this.byTags = {}; + this.iocLabels = { + 'true': 'IOC', + 'false': 'Not IOC' + }; + + this.iocValues = { + 'true': true, + 'false': false + }; + self.$onInit = function() { var caseId = $stateParams.caseId; diff --git a/frontend/app/scripts/directives/charts/c3Chart.js b/frontend/app/scripts/directives/charts/c3Chart.js index 92c296b7b2..467ef621c4 100644 --- a/frontend/app/scripts/directives/charts/c3Chart.js +++ b/frontend/app/scripts/directives/charts/c3Chart.js @@ -8,6 +8,8 @@ chart: '=', resizeOn: '@', error: '=', + height: ' +
+

{{$cmp.title}}

+
+
+ + +
+
+
+
+ + + + + +
{{$cmp.labels[item.key] || item.key}} + {{item.count}} +
+ +
+ diff --git a/frontend/app/views/directives/charts/c3.html b/frontend/app/views/directives/charts/c3.html index e66667cc10..109179d500 100644 --- a/frontend/app/views/directives/charts/c3.html +++ b/frontend/app/views/directives/charts/c3.html @@ -7,7 +7,7 @@

-
+
CSV Image Save as diff --git a/frontend/app/views/partials/alert/list.html b/frontend/app/views/partials/alert/list.html index 6fbbf1fe8d..b87e43732c 100644 --- a/frontend/app/views/partials/alert/list.html +++ b/frontend/app/views/partials/alert/list.html @@ -7,12 +7,12 @@

List of alerts ({{$vm.list.total || 0}} of {{$vm.alertList
-
+
-
+
-
+
List of alerts ({{$vm.list.total || 0}} of {{$vm.alertList
-
+
No records
diff --git a/frontend/app/views/partials/alert/list/mini-stats.html b/frontend/app/views/partials/alert/list/mini-stats.html index 183fb1725f..6db30f8742 100644 --- a/frontend/app/views/partials/alert/list/mini-stats.html +++ b/frontend/app/views/partials/alert/list/mini-stats.html @@ -1,52 +1,23 @@
-
-

Statistics

-
-
-
Alerts by Status
-
- - - - - -
{{item.key === 'true' ? 'Read' : 'Unread'}} - {{item.count}} -
-
+
+ + +
-
-
Top 5 Types
-
- - - - - -
{{item.key}} - {{item.count}} -
-
+
+ +
-
-
Top 5 tags
-
- - - - - -
{{item.key}} - {{item.count}} -
-
+
+ +
diff --git a/frontend/app/views/partials/case/case.list.html b/frontend/app/views/partials/case/case.list.html index e86b33b0fc..36e3c63db6 100644 --- a/frontend/app/views/partials/case/case.list.html +++ b/frontend/app/views/partials/case/case.list.html @@ -14,11 +14,11 @@

List of cases ({{$vm.list.total || 0}} of {{$vm.caseCount}
-
+
-
+
-
+
-
+
-
-
+
-
- -
-
+
diff --git a/frontend/app/views/partials/case/list/mini-stats.html b/frontend/app/views/partials/case/list/mini-stats.html index 7cc02b8da2..af698a4948 100644 --- a/frontend/app/views/partials/case/list/mini-stats.html +++ b/frontend/app/views/partials/case/list/mini-stats.html @@ -1,61 +1,22 @@
-
-

Statistics

-
-
-
Cases by Status
-
- - - - - -
{{item.key}} - {{item.count}} -
-
+
+ +
-
-
Case by Resolution
-
- - - - - -
{{item.key}} - {{item.count}} -
-
+
+ +
-
-
Top 5 tags
-
- - - - - -
{{item.key}} - {{item.count}} -
-
+
+ +
- diff --git a/frontend/app/views/partials/observables/list/mini-stats.html b/frontend/app/views/partials/observables/list/mini-stats.html index ca1b0c66fa..4e2b789c52 100644 --- a/frontend/app/views/partials/observables/list/mini-stats.html +++ b/frontend/app/views/partials/observables/list/mini-stats.html @@ -1,61 +1,22 @@
-
-

Statistics

-
-
-
Observables by type
-
- - - - - -
{{item.key}} - {{item.count}} -
-
+
+ +
-
-
Observables as IOC
-
- - - - - -
{{(item.key === 'false') ? 'Not IOC' : 'IOC' }} - {{item.count}} -
-
+
+ +
-
-
Top 10 tags
-
- - - - - -
{{item.key}} - {{item.count}} -
-
+
+ +
-