Skip to content

Commit

Permalink
#10 refresh metrics cache when a new metric is created from the admin…
Browse files Browse the repository at this point in the history
…istration section
  • Loading branch information
nadouani committed Nov 18, 2016
1 parent e47513c commit f06694c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
7 changes: 7 additions & 0 deletions ui/app/scripts/controllers/RootCtrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,13 @@ angular.module('theHiveControllers').controller('RootCtrl',
AlertSrv.error('RootCtrl', data, status);
});

$scope.$on('metrics:refresh', function() {
// Get metrics cache
MetricsCacheSrv.all().then(function(list) {
$scope.metricsCache = list;
});
});

$scope.$on('misp:status-updated', function(event, enabled) {
$scope.mispEnabled = enabled;
});
Expand Down
2 changes: 2 additions & 0 deletions ui/app/scripts/controllers/admin/AdminMetricsCtrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
$scope.initMetrics();

MetricsCacheSrv.clearCache();

$scope.$emit('metrics:refresh');
},
function(response) {
AlertSrv.error('AdminMetricsCtrl', response.data, response.status);
Expand Down
1 change: 1 addition & 0 deletions ui/app/views/partials/case/case.details.html
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ <h4 class="vpad10 text-primary">
</ul>
</span>
</h4>

<div ng-if="hasNoMetrics(caze)">
<em>No metrics need to be set</em>
</div>
Expand Down

0 comments on commit f06694c

Please sign in to comment.