module.js 967 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /*jshint globalstrict:true */
  2. /*global angular:true */
  3. /*
  4. ## filtering
  5. An experimental for interacting with the filter service
  6. ### Parameters
  7. */
  8. 'use strict';
  9. angular.module('kibana.filtering', [])
  10. .controller('filtering', function($scope, filterSrv, $rootScope, dashboard) {
  11. // Set and populate defaults
  12. var _d = {
  13. status : "Experimental"
  14. };
  15. _.defaults($scope.panel,_d);
  16. $scope.init = function() {
  17. $scope.filterSrv = filterSrv;
  18. };
  19. $scope.remove = function(id) {
  20. filterSrv.remove(id);
  21. dashboard.refresh();
  22. };
  23. $scope.toggle = function(id) {
  24. filterSrv.list[id].active = !filterSrv.list[id].active;
  25. dashboard.refresh();
  26. };
  27. $scope.refresh = function(query) {
  28. $rootScope.$broadcast('refresh');
  29. };
  30. $scope.render = function(query) {
  31. $rootScope.$broadcast('render');
  32. };
  33. $scope.show_key = function(key) {
  34. return !_.contains(['type','id','alias','mandate','active','editing'],key);
  35. };
  36. });