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