module.js 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /*
  2. ## Debug
  3. Shows the exchange of events between panels. Disabled by default and usually
  4. should be. This panel exists in the ALL group by default so that it receives
  5. all of the events from every panel
  6. ### Parameters
  7. * size :: How many events to show
  8. * style :: A hash containing css style parameters
  9. ### Group Events
  10. #### Receives
  11. * $kibana_debug :: Contains a meta object of any event sent
  12. */
  13. angular.module('kibana.debug', [])
  14. .controller('debug', function($scope, eventBus) {
  15. // Set and populate defaults
  16. var _d = {
  17. group : "ALL",
  18. style : {'font-size':'9pt'},
  19. size : 20
  20. }
  21. _.defaults($scope.panel,_d)
  22. $scope.init = function () {
  23. $scope.set_listeners($scope.panel.group)
  24. // Now that we're all setup, request the time from our group
  25. eventBus.broadcast($scope.$id,$scope.panel.group,"get_time")
  26. $scope.events = []
  27. }
  28. $scope.toggle_details = function(event) {
  29. event.details = event.details ? false : true;
  30. }
  31. $scope.set_listeners = function(group) {
  32. eventBus.register($scope,'$kibana_debug',function(event,data,header) {
  33. if($scope.events.length >= $scope.panel.size)
  34. $scope.events = $scope.events.slice(0,$scope.panel.size-1)
  35. $scope.events.unshift({header:header,data:data})
  36. });
  37. }
  38. });