module.js 767 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /*
  2. ## filtering
  3. An experimental for interacting with the filter service
  4. ### Parameters
  5. */
  6. angular.module('kibana.filtering', [])
  7. .controller('filtering', function($scope, filterSrv, $rootScope, dashboard) {
  8. // Set and populate defaults
  9. var _d = {
  10. status : "Experimental"
  11. }
  12. _.defaults($scope.panel,_d);
  13. $scope.init = function() {
  14. $scope.filterSrv = filterSrv
  15. }
  16. $scope.remove = function(id) {
  17. filterSrv.remove(id);
  18. dashboard.refresh();
  19. }
  20. $scope.refresh = function(query) {
  21. $rootScope.$broadcast('refresh')
  22. }
  23. $scope.render = function(query) {
  24. $rootScope.$broadcast('render')
  25. }
  26. $scope.stripped = function(filter) {
  27. var filter = _.omit(filter,'type','id','alias','mandate')
  28. return filter
  29. }
  30. });