functions-overview.ts 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. // @ts-nocheck
  2. import { RegistryDefinations } from '../types'
  3. /**
  4. * Shortcuts scoped to the per-function Overview tab (the new flag-gated UI).
  5. *
  6. * The interval picker uses an `I + <letter>` chord matching the first letter
  7. * of the interval's unit (M=minute, H=hour, T=three-hour, D=day).
  8. */
  9. export const FUNCTIONS_OVERVIEW_SHORTCUT_IDS = {
  10. FUNCTION_OVERVIEW_INTERVAL_15MIN: 'functions-overview.interval-15min',
  11. FUNCTION_OVERVIEW_INTERVAL_1HR: 'functions-overview.interval-1hr',
  12. FUNCTION_OVERVIEW_INTERVAL_3HR: 'functions-overview.interval-3hr',
  13. FUNCTION_OVERVIEW_INTERVAL_1DAY: 'functions-overview.interval-1day',
  14. FUNCTION_OVERVIEW_REFRESH: 'functions-overview.refresh',
  15. FUNCTION_OVERVIEW_OPEN_LOGS: 'functions-overview.open-logs',
  16. }
  17. export type FunctionsOverviewShortcutId =
  18. (typeof FUNCTIONS_OVERVIEW_SHORTCUT_IDS)[keyof typeof FUNCTIONS_OVERVIEW_SHORTCUT_IDS]
  19. export const functionsOverviewRegistry: RegistryDefinations<FunctionsOverviewShortcutId> = {
  20. [FUNCTIONS_OVERVIEW_SHORTCUT_IDS.FUNCTION_OVERVIEW_INTERVAL_15MIN]: {
  21. id: FUNCTIONS_OVERVIEW_SHORTCUT_IDS.FUNCTION_OVERVIEW_INTERVAL_15MIN,
  22. label: 'Show last 15 minutes',
  23. sequence: ['I', 'M'],
  24. showInSettings: false,
  25. options: { ignoreInputs: true, registerInCommandMenu: true },
  26. },
  27. [FUNCTIONS_OVERVIEW_SHORTCUT_IDS.FUNCTION_OVERVIEW_INTERVAL_1HR]: {
  28. id: FUNCTIONS_OVERVIEW_SHORTCUT_IDS.FUNCTION_OVERVIEW_INTERVAL_1HR,
  29. label: 'Show last hour',
  30. sequence: ['I', 'H'],
  31. showInSettings: false,
  32. options: { ignoreInputs: true, registerInCommandMenu: true },
  33. },
  34. [FUNCTIONS_OVERVIEW_SHORTCUT_IDS.FUNCTION_OVERVIEW_INTERVAL_3HR]: {
  35. id: FUNCTIONS_OVERVIEW_SHORTCUT_IDS.FUNCTION_OVERVIEW_INTERVAL_3HR,
  36. label: 'Show last 3 hours',
  37. sequence: ['I', 'T'],
  38. showInSettings: false,
  39. options: { ignoreInputs: true, registerInCommandMenu: true },
  40. },
  41. [FUNCTIONS_OVERVIEW_SHORTCUT_IDS.FUNCTION_OVERVIEW_INTERVAL_1DAY]: {
  42. id: FUNCTIONS_OVERVIEW_SHORTCUT_IDS.FUNCTION_OVERVIEW_INTERVAL_1DAY,
  43. label: 'Show last day',
  44. sequence: ['I', 'D'],
  45. showInSettings: false,
  46. options: { ignoreInputs: true, registerInCommandMenu: true },
  47. },
  48. [FUNCTIONS_OVERVIEW_SHORTCUT_IDS.FUNCTION_OVERVIEW_REFRESH]: {
  49. id: FUNCTIONS_OVERVIEW_SHORTCUT_IDS.FUNCTION_OVERVIEW_REFRESH,
  50. label: 'Refresh function stats',
  51. sequence: ['Shift+R'],
  52. showInSettings: false,
  53. options: { ignoreInputs: true, registerInCommandMenu: true },
  54. },
  55. [FUNCTIONS_OVERVIEW_SHORTCUT_IDS.FUNCTION_OVERVIEW_OPEN_LOGS]: {
  56. id: FUNCTIONS_OVERVIEW_SHORTCUT_IDS.FUNCTION_OVERVIEW_OPEN_LOGS,
  57. label: 'Open logs',
  58. sequence: ['O', 'L'],
  59. showInSettings: false,
  60. options: { ignoreInputs: true, registerInCommandMenu: true },
  61. },
  62. }