alerting.static.actions.ts 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. import { Priority } from 'kbar';
  2. import { locationService } from '@grafana/runtime';
  3. import { NavBarActions } from './global.static.actions';
  4. // Grafana Alerting and alerting sub navigation items
  5. const alertingCommandPaletteStaticActions: NavBarActions[] = [
  6. {
  7. url: '/alerting/list',
  8. actions: [
  9. {
  10. id: 'go/alerting',
  11. name: 'Go to alerting',
  12. keywords: 'alerting navigate',
  13. perform: () => locationService.push('/alerting'),
  14. section: 'Navigation',
  15. priority: Priority.NORMAL,
  16. },
  17. ],
  18. },
  19. {
  20. url: '/alerting/list',
  21. actions: [
  22. {
  23. id: 'go/alerting/rules',
  24. name: 'Go to alert rules',
  25. keywords: 'alerting navigate rules',
  26. perform: () => locationService.push('/alerting/list'),
  27. section: 'Navigation',
  28. parent: 'go/alerting',
  29. },
  30. ],
  31. },
  32. {
  33. url: '/alerting/notifications',
  34. actions: [
  35. {
  36. id: 'go/alerting/contact-points',
  37. name: 'Go to contact points',
  38. keywords: 'alerting navigate contact-points',
  39. perform: () => locationService.push('/alerting/notifications'),
  40. parent: 'go/alerting',
  41. },
  42. ],
  43. },
  44. {
  45. url: '/alerting/routes',
  46. actions: [
  47. {
  48. id: 'go/alerting/notification-policies',
  49. name: 'Go to notification policies',
  50. keywords: 'alerting navigate notification-policies',
  51. perform: () => locationService.push('/alerting/routes'),
  52. parent: 'go/alerting',
  53. },
  54. ],
  55. },
  56. {
  57. url: '/alerting/silences',
  58. actions: [
  59. {
  60. id: 'go/alerting/silences',
  61. name: 'Go to silences',
  62. keywords: 'alerting navigate silences',
  63. perform: () => locationService.push('/alerting/silences'),
  64. parent: 'go/alerting',
  65. },
  66. ],
  67. },
  68. ];
  69. export { alertingCommandPaletteStaticActions };