module.js 941 B

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