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