help.ts 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. ///<reference path="../../../headers/common.d.ts" />
  2. import coreModule from '../../core_module';
  3. import appEvents from 'app/core/app_events';
  4. export class HelpCtrl {
  5. tabIndex: any;
  6. shortcuts: any;
  7. /** @ngInject */
  8. constructor(private $scope, $sce) {
  9. this.tabIndex = 0;
  10. this.shortcuts = {
  11. 'Global': [
  12. {keys: ['g', 'h'], description: 'Go to Home Dashboard'},
  13. {keys: ['g', 'p'], description: 'Go to Profile'},
  14. {keys: ['s', 'o'], description: 'Open search'},
  15. {keys: ['s', 's'], description: 'Open search with starred filter'},
  16. {keys: ['s', 't'], description: 'Open search in tags view'},
  17. {keys: ['esc'], description: 'Exit edit/setting views'},
  18. ],
  19. 'Focused Panel': [
  20. {keys: ['e'], description: 'Toggle panel edit view'},
  21. {keys: ['v'], description: 'Toggle panel fullscreen view'},
  22. {keys: ['p', 's'], description: 'Open Panel Share Modal'},
  23. {keys: ['p', 'r'], description: 'Remove Panel'},
  24. ],
  25. 'Focused Row': [
  26. {keys: ['r', 'c'], description: 'Collapse Row'},
  27. {keys: ['r', 'r'], description: 'Remove Row'},
  28. ],
  29. 'Dashboard': [
  30. {keys: ['mod+s'], description: 'Save dashboard'},
  31. {keys: ['mod+h'], description: 'Hide row controls'},
  32. {keys: ['d', 'r'], description: 'Refresh all panels'},
  33. {keys: ['d', 's'], description: 'Dashboard settings'},
  34. {keys: ['mod+o'], description: 'Toggle shared graph crosshair'},
  35. ],
  36. 'Time Range': [
  37. {keys: ['t', 'z'], description: 'Zoom out time range'},
  38. {keys: ['t', '<i class="fa fa-long-arrow-left"></i>'], description: 'Move time range back'},
  39. {keys: ['t', '<i class="fa fa-long-arrow-right"></i>'], description: 'Move time range forward'},
  40. ],
  41. };
  42. }
  43. dismiss() {
  44. appEvents.emit('hide-modal');
  45. }
  46. }
  47. export function helpModal() {
  48. return {
  49. restrict: 'E',
  50. templateUrl: 'public/app/core/components/help/help.html',
  51. controller: HelpCtrl,
  52. bindToController: true,
  53. transclude: true,
  54. controllerAs: 'ctrl',
  55. scope: {},
  56. };
  57. }
  58. coreModule.directive('helpModal', helpModal);