observability-page.ts 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. // @ts-nocheck
  2. import { RegistryDefinations } from '../types'
  3. /**
  4. * Shortcuts scoped to Observability report pages. Reuses the existing
  5. * conventions from logs-preview (Shift+R refresh, Shift+P toggle date picker)
  6. * and list-page (Shift+F focus filter/search, F C reset filters,
  7. * Shift+N create new). Pages bind these via `useShortcut` and pass `label`
  8. * overrides where the surface action is more specific than the generic label.
  9. */
  10. export const OBSERVABILITY_PAGE_SHORTCUT_IDS = {
  11. OBSERVABILITY_REFRESH: 'observability.refresh',
  12. OBSERVABILITY_TOGGLE_DATE_PICKER: 'observability.toggle-date-picker',
  13. OBSERVABILITY_FOCUS_FILTER: 'observability.focus-filter',
  14. OBSERVABILITY_RESET_FILTERS: 'observability.reset-filters',
  15. OBSERVABILITY_NEW_REPORT: 'observability.new-report',
  16. OBSERVABILITY_RESET_REPORT: 'observability.reset-report',
  17. OBSERVABILITY_FILTER_REQUESTS: 'observability.filter-requests',
  18. }
  19. export type ObservabilityPageShortcutId =
  20. (typeof OBSERVABILITY_PAGE_SHORTCUT_IDS)[keyof typeof OBSERVABILITY_PAGE_SHORTCUT_IDS]
  21. export const observabilityPageRegistry: RegistryDefinations<ObservabilityPageShortcutId> = {
  22. [OBSERVABILITY_PAGE_SHORTCUT_IDS.OBSERVABILITY_REFRESH]: {
  23. id: OBSERVABILITY_PAGE_SHORTCUT_IDS.OBSERVABILITY_REFRESH,
  24. label: 'Refresh report',
  25. sequence: ['Shift+R'],
  26. showInSettings: false,
  27. options: { ignoreInputs: true, registerInCommandMenu: true, conflictBehavior: 'allow' },
  28. },
  29. [OBSERVABILITY_PAGE_SHORTCUT_IDS.OBSERVABILITY_TOGGLE_DATE_PICKER]: {
  30. id: OBSERVABILITY_PAGE_SHORTCUT_IDS.OBSERVABILITY_TOGGLE_DATE_PICKER,
  31. label: 'Open time picker',
  32. sequence: ['Shift+P'],
  33. showInSettings: false,
  34. options: { ignoreInputs: true, registerInCommandMenu: true, conflictBehavior: 'allow' },
  35. },
  36. [OBSERVABILITY_PAGE_SHORTCUT_IDS.OBSERVABILITY_FOCUS_FILTER]: {
  37. id: OBSERVABILITY_PAGE_SHORTCUT_IDS.OBSERVABILITY_FOCUS_FILTER,
  38. label: 'Add filter',
  39. sequence: ['Shift+F'],
  40. showInSettings: false,
  41. options: { registerInCommandMenu: true },
  42. },
  43. [OBSERVABILITY_PAGE_SHORTCUT_IDS.OBSERVABILITY_RESET_FILTERS]: {
  44. id: OBSERVABILITY_PAGE_SHORTCUT_IDS.OBSERVABILITY_RESET_FILTERS,
  45. label: 'Reset filters',
  46. sequence: ['F', 'C'],
  47. showInSettings: false,
  48. options: { ignoreInputs: true, registerInCommandMenu: true },
  49. },
  50. [OBSERVABILITY_PAGE_SHORTCUT_IDS.OBSERVABILITY_NEW_REPORT]: {
  51. id: OBSERVABILITY_PAGE_SHORTCUT_IDS.OBSERVABILITY_NEW_REPORT,
  52. label: 'New custom report',
  53. sequence: ['Shift+N'],
  54. showInSettings: false,
  55. options: { ignoreInputs: true, registerInCommandMenu: true },
  56. },
  57. [OBSERVABILITY_PAGE_SHORTCUT_IDS.OBSERVABILITY_RESET_REPORT]: {
  58. id: OBSERVABILITY_PAGE_SHORTCUT_IDS.OBSERVABILITY_RESET_REPORT,
  59. label: 'Reset report',
  60. sequence: ['R', 'C'],
  61. showInSettings: false,
  62. options: { ignoreInputs: true, registerInCommandMenu: true },
  63. },
  64. [OBSERVABILITY_PAGE_SHORTCUT_IDS.OBSERVABILITY_FILTER_REQUESTS]: {
  65. id: OBSERVABILITY_PAGE_SHORTCUT_IDS.OBSERVABILITY_FILTER_REQUESTS,
  66. label: 'Filter requests',
  67. sequence: ['Shift+S'],
  68. showInSettings: false,
  69. options: { ignoreInputs: true, registerInCommandMenu: true },
  70. },
  71. }